Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

[Solved] QGraphicsItem::ItemFlagsHaveChanged: correct cast?

$
0
0
I would like to use the QVariant value from QGraphicsItem::itemChange with the change flag QGraphicsItem::ItemFlagsHaveChanged. The docs say about this change: bq. The item’s flags have changed. The value argument is the new flags (i.e., a quint32). Do not call setFlags() in itemChange() as this notification is delivered. The return value is ignored. From this, I gather the correct cast from value to QGraphicsItem::GraphicsItemFlags is: static_cast<QGraphicsItem::GraphicsItemFlags>(value.value<qint32>()) However, this feels wrong. What if I compile with 64 bits? Won’t the Flags be 64 bits wide by default then? Okay, the cast would still work, but it doesn’t feel right? IS it right?

Viewing all articles
Browse latest Browse all 18427

Trending Articles