summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.h
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-08-26 09:02:33 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-08-26 14:18:45 (GMT)
commitda5033d8b48b24580e3b6faf7b4e2a8fe2cec254 (patch)
tree5870b468e418a29a8269bd462e93e54bb0ee5b7b /src/gui/graphicsview/qgraphicsitem.h
parent7e30c92186878beb300a13093c3668ae8a10f2be (diff)
downloadQt-da5033d8b48b24580e3b6faf7b4e2a8fe2cec254.zip
Qt-da5033d8b48b24580e3b6faf7b4e2a8fe2cec254.tar.gz
Qt-da5033d8b48b24580e3b6faf7b4e2a8fe2cec254.tar.bz2
Introduce QGraphicsItem::ItemIsPanel, light-weight window.
ItemIsPanel allows items that act like windows. They can be activated and deactivated just like windows and focus is handled just like with windows. The main difference is that panels are more light-weight. There's less built-in functionality (e.g., clicking a panel doesn't automatically activate nor raise it). This patch also introduces QGraphicsItem::panel(), QGraphicsItem::isPanel(), and QGraphicsItem::isActive(), as well as QGraphicsScene::activePanel(), QGraphicsScene::setActivePanel(). and QGraphicsScene::isActive(). Regular windows (QGraphicsWidgets with Qt::Window set) are also panels, with added functionality. The ItemIsPanel flag is set automatically for windows. Reviewed-by: brad
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 7af7c2f..b23941d 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -104,7 +104,8 @@ public:
ItemSendsGeometryChanges = 0x800,
ItemAcceptsInputMethod = 0x1000,
ItemAutoDetectsFocusProxy = 0x2000,
- ItemNegativeZStacksBehindParent = 0x4000
+ ItemNegativeZStacksBehindParent = 0x4000,
+ ItemIsPanel = 0x8000
// NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
};
Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
@@ -161,11 +162,13 @@ public:
QGraphicsWidget *parentWidget() const;
QGraphicsWidget *topLevelWidget() const;
QGraphicsWidget *window() const;
+ QGraphicsItem *panel() const;
void setParentItem(QGraphicsItem *parent);
QList<QGraphicsItem *> children() const; // ### obsolete
QList<QGraphicsItem *> childItems() const;
bool isWidget() const;
bool isWindow() const;
+ bool isPanel() const;
QGraphicsObject *toGraphicsObject();
const QGraphicsObject *toGraphicsObject() const;
@@ -231,6 +234,7 @@ public:
bool handlesChildEvents() const;
void setHandlesChildEvents(bool enabled);
+ bool isActive() const;
bool hasFocus() const;
void setFocus(Qt::FocusReason focusReason = Qt::OtherFocusReason);
void clearFocus();