Questions tagged [qgraphicstextitem]

The QGraphicsTextItem class, part of the Qt framework, provides a text item that you can add to a QGraphicsScene to display formatted text.

Documentation can be found here (Qt4) and here (Qt5).

64 questions
8
votes
1 answer

Set QGraphicsTextItem text contents of exact height and width

I am required to create text items with exact width and height of text contents. The height of the text is the most important requirement. The position of the text should be relative to the text itself. I also have to be able to place it on canvas…
Thalia
  • 13,637
  • 22
  • 96
  • 190
4
votes
1 answer

Qt Editable QGraphicsTextItem validating text and emitting signal on change

I am really stuck up with a task relating to Qt GraphicsView. Any help or suggestions will be highly appreciated. In my QGraphicsView application, I have a few editable QGraphicsTextItems that I have added to the scene. I need the following…
Abhishek Bansal
  • 12,589
  • 4
  • 31
  • 46
4
votes
1 answer

How create custom text(glyph) animation by Qt

I want to make a dynamic text animation with Qt for arabic and persian texts?can you help me? You can see an example of what i need. Trust sample wrong sample
3
votes
1 answer

QGraphicsTextItem RightToLeft text

I have to write some Farsi texts to a QGraphicsTextItem , but I can't find how I can make QGraphicsTextItem to write RightToLeft!. Can any one help me?. I tryed this way but it didn't work for me: class DiagramTextItem(QtGui.QGraphicsTextItem): def…
3
votes
1 answer

How to get PyQt QGraphicsTextItem opaque area

self.boundingRect() give me dashed line dimensions shown in image. i need to get opaque area (where actual text is drawn) I tried getting self.opaqueArea() but it returns QPainterPath object, which seems pretty complicated and apparently doesn't…
haseeb
  • 190
  • 3
  • 12
3
votes
1 answer

Application stops responding when using QMap to store objects

A friend of mine and I are trying to make a game in C++ using Qt. We want to store a few QGraphicsTextItem in a QMap to access them during runtime. I've pasted the relevant parts of our code here, and our problem is that the program stops…
Dromnes
  • 302
  • 2
  • 3
  • 12
3
votes
3 answers

Preventing font scale in QGraphicsItem

I am using QGraphicsTextItem to paint the text on the scene. Text is painted along the path (QGraphicsPathItem), wich is parent of my QGraphicsTextItem - so the text rotation is changed to be along the path element and is sticked to it while zooming…
pau
  • 352
  • 3
  • 14
2
votes
3 answers

How to center text in QGraphicsSimpleTextItem?

Sorry for my English, it's not my native language. I have a problem - I need to center text in my QGraphicsSimpleTextItem. I inherited my class from QGraphicsSimpleTextItem. Do I need to override the paint() method or what should I do? I've read…
2
votes
1 answer

Qt - children set font breaks positioning

Okay, so I've started making a game using Qt so that I can learn both Qt and C++ at the same time :D However, I'm stuck with an issue at the moment. I'm trying to make a textbox using a QGraphicsRectItem as a container (parent), and a…
Kodemikkel
  • 133
  • 12
2
votes
2 answers

How to make a QGraphicsTextItem clickable?

In the "About box" of my software, I used a QGraphicsTextItem to show the about-text. This text contains hypertext links (in the form of: link). The item shows up properly (hypertext links are blue and…
ereOn
  • 53,676
  • 39
  • 161
  • 238
2
votes
1 answer

Pagination of QGraphicsTextItem: Confining text to a specific rectangular area

I am trying to use Qt for creating a WYSIWYG word processor, focusing mainly on the layout of pages and pagination of a document. The first thing I'm trying to focus on is a printing preview feature and I thought I would use a QGraphicsScene/View…
jollyroger
  • 659
  • 1
  • 10
  • 19
2
votes
1 answer

how to clickable a QGraphicsTextItem?

I have a QDialog for beginning of my game.in this class I have a QGraphicsTextItem. I want to it is clickable. When user clicked play game start. I do this but not work. class Mydialog_start:public QDialog { Q_OBJECT public: explicit…
maryam
  • 1,437
  • 2
  • 18
  • 40
2
votes
0 answers

setPos() doesn't use parent coordinates

Here is part of the code, when sending x=0 and y=0, it places the child item "text" in the (0,0) of the scene not relative to its parent ! void ClassA::putLabel(qreal x, qreal y, QString text, QGraphicsPolygonItem* parent) { QGraphicsTextItem *…
Mahmoud Hassan
  • 598
  • 1
  • 3
  • 15
2
votes
1 answer

PySide QGraphicsTextItem issues

I am trying to produce a text editor similar to word (paginated) in PySide. The way I decided to tackle this is having a QGraphicsScene with QGraphicsTextItem for each page, and to code the focus by interaction. Now all I am trying to do now is have…
2
votes
1 answer

Edit QGraphicsTextItem inside QGraphicsItemGroup

I want a python application that displays a bunch of small portraits and a names below it. Like that: They should be movable and editable (by double clicking the text). I am using PyQt4 so I figured out, it would be easiest to use a QGraphicsView…
Qlaus
  • 885
  • 5
  • 15
1
2 3 4 5