diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-03 14:34:58 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-06-09 07:33:01 (GMT) |
commit | 728179ed60b43187d28c77a2d6930a74a62791d6 (patch) | |
tree | 9b48a4077f356138ce5c536b06d9cdcda2fe7af3 /src/gui/graphicsview/qgraphicsitem.h | |
parent | 1598ef761a8c3f0c9cccf5318e3de30f6c50880f (diff) | |
download | Qt-728179ed60b43187d28c77a2d6930a74a62791d6.zip Qt-728179ed60b43187d28c77a2d6930a74a62791d6.tar.gz Qt-728179ed60b43187d28c77a2d6930a74a62791d6.tar.bz2 |
Add QGraphicsItem::itemChangeEnabled().
This function allows the user to disable notifications for item changes.
In QSimpleCanvasItem, all notifications are disabled by default, and
you can enable them one at a time. QGraphicsItem's behavior is to by
default enable all notifications.
A side effect of this change is that I've removed one optimization in
favor of another: by not constructing a QVariant at all when there's no
notification we get maximum performance, at the expense of constructing
it twice if there is a notification.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index 737ea80..7c87176 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -129,6 +129,7 @@ public: ItemZValueHasChanged, ItemOpacityChange, ItemOpacityHasChanged + // NB! Don't forget to increase d_ptr->itemChangesEnabled when adding a new entry. }; enum CacheMode { @@ -165,6 +166,10 @@ public: void setFlag(GraphicsItemFlag flag, bool enabled = true); void setFlags(GraphicsItemFlags flags); + bool itemChangeEnabled(GraphicsItemChange change) const; + void setItemChangeEnabled(GraphicsItemChange change, bool enabled); + void setItemChangesEnabled(bool enabled); + CacheMode cacheMode() const; void setCacheMode(CacheMode mode, const QSize &cacheSize = QSize()); |