qt - QGraphicsProxyWidget::setPos(qreal x, qreal y) doesn't place correctly in a QGraphicsScene when coordinates > 2^15 -
I have a large dimension QGraphicsScene
to display a database content
in front of these images, I QCheckbox
QGraphicsProxyWidget Accessing via
s But given the brief instructions signed in QGraphicsScene
in the results given in QGraphicsProxyWidget :: setPos (qreal x, qreal y)
casting.
However, QGraphicsProxyWidget:: Pos ()
also gives the original coordinates above 2 ^ 16 too.
Here is the code:
QCheckBox * checkbox = new QCheckBox ("", this); QWidget * dummyWidget = new QWidget; // A Transparent Background Dummy Widget-> setStyleSheet ( "background-color: transparent;" "outline-color: transparent;" font-size: 8pt; "); QHBoxLayout * Dmileaut = new QHBoxLayout (Dmividtet); dummyLayout- & gt; addWidget (box); QGraphicsProxyWidget * Proksividt = Scene .addWidget (Dmividtet); Proksivijet- & gt; Setpos (0, 120 * i);
when the 120 * i 3276 9 and 65536, QChekBox
For the above values, QCheckBox
es such as y = value - 65536
is displayed.
I tried many things without success Such as - ProxyWidget-> Run
- Dummit-> move
- dmvidate- & gt; set size (0, 240) * I) Checkbox-> Move (0, 120 * i);
Any solution?
PS: Toolken / Cross-toolchain I Embedded QT4 Depending on the .8.1. For the desktop side.
I have no way to upgrade from QT5.x to an option.
You can use the next move:
zero setwaps (QGraphicsItem * Item, QPointF POS) {item-> resetTransform (); QTransform trans = item- & gt; Conversion (); Item- & gt; Settransforms (trans. (Paus. X), pause. (());}
Now, you can call this function:
QPushButton * btn = new QPushButton ( "Hello, people!"); QGraphicsProxyWidget * wdgItem = scene- & gt; Advijet (Bitian); set Nupos (wdgItem, view- & gt; Mancitrtossen (0,0)); // There is no visible cord.
Comments
Post a Comment