qgraphicsitem

What leads to incomplete types? (QGraphicsItem: Source or target has incomplete type)

江枫思渺然 提交于 2019-11-29 12:38:42
I have a custom QGraphicsItem, that (among other things) changed the cursor to an open hand when clicked, using the standard procedure as described in the Qt documentation. This worked fine for the past two weeks or so. Yesterday, I changed a few things inside the class. Most significantly, I now subclass directly from QGraphicsPixmapItem instead of QGraphicsItem. At some point I started to get the following error (partly my own translation): C664: Conversion of parameter 1 from 'Qt::CursorShape' to 'const QCursor &' not possible. Source or target has incomplete type. I now try to figure out

What leads to incomplete types? (QGraphicsItem: Source or target has incomplete type)

大兔子大兔子 提交于 2019-11-28 05:53:10
问题 I have a custom QGraphicsItem, that (among other things) changed the cursor to an open hand when clicked, using the standard procedure as described in the Qt documentation. This worked fine for the past two weeks or so. Yesterday, I changed a few things inside the class. Most significantly, I now subclass directly from QGraphicsPixmapItem instead of QGraphicsItem. At some point I started to get the following error (partly my own translation): C664: Conversion of parameter 1 from 'Qt:

Draw an item in a static location relative to the QGraphicsView

我是研究僧i 提交于 2019-11-27 21:36:33
I would like to draw a notification that always appears in the upper right corner of my QGraphicsView . However, QGraphicsItems positions are specified in scene coordinates, so if the user panned/zoomed to view a different part of the scene, this notification would move off screen. I have figured out that I could simulate this behavior by moving and scaling the notification any time the current view changes. But this seems terribly ineffective and not at all elegant. It seems that QGraphicsView should support this kind of behavior. The docs mention a flag ItemIsPanel that sounds hopeful, but

Draw an item in a static location relative to the QGraphicsView

自古美人都是妖i 提交于 2019-11-26 20:28:59
问题 I would like to draw a notification that always appears in the upper right corner of my QGraphicsView . However, QGraphicsItems positions are specified in scene coordinates, so if the user panned/zoomed to view a different part of the scene, this notification would move off screen. I have figured out that I could simulate this behavior by moving and scaling the notification any time the current view changes. But this seems terribly ineffective and not at all elegant. It seems that