summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-04-14 03:18:03 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-04-14 03:21:55 (GMT)
commit37581fa549c5cbe56afc68c71fa97d8f933512c0 (patch)
tree621a068e2a786eec416facdce9aa2eccd92e36f2 /src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
parent298335af52cd39ad6683198674e799799d5b6d6f (diff)
downloadQt-37581fa549c5cbe56afc68c71fa97d8f933512c0.zip
Qt-37581fa549c5cbe56afc68c71fa97d8f933512c0.tar.gz
Qt-37581fa549c5cbe56afc68c71fa97d8f933512c0.tar.bz2
Bring support of anchors in QML for QGraphicsWidget derived classes.
This commit add a extension object to bring the anchors property for a QGraphicsWidget. The actual implement uses a separate object for storing the anchor pointer. In the future it would be nice if the extension object is the anchor itself. Also there are two connects extra for QGraphicsWidget one can perhaps disappear with a later commit. Only baseline case is not supported because QGraphicsWidget don't have any concept of baseline. Reviewed-by:akennedy
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeanchors_p_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors_p_p.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
index 4cadb43..f8489aa 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeanchors_p_p.h
@@ -77,7 +77,7 @@ public:
Vertical_Mask = Top | Bottom | VCenter | Baseline
};
- QDeclarativeItem *item;
+ QGraphicsObject *item;
AnchorLine anchorLine;
};
@@ -90,7 +90,7 @@ class QDeclarativeAnchorsPrivate : public QObjectPrivate, public QDeclarativeIte
{
Q_DECLARE_PUBLIC(QDeclarativeAnchors)
public:
- QDeclarativeAnchorsPrivate(QDeclarativeItem *i)
+ QDeclarativeAnchorsPrivate(QGraphicsObject *i)
: componentComplete(true), updatingMe(false), updatingHorizontalAnchor(0),
updatingVerticalAnchor(0), updatingFill(0), updatingCenterIn(0), item(i), usedAnchors(0), fill(0),
centerIn(0), leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0),
@@ -98,10 +98,10 @@ public:
{
}
- void clearItem(QDeclarativeItem *);
+ void clearItem(QGraphicsObject *);
- void addDepend(QDeclarativeItem *);
- void remDepend(QDeclarativeItem *);
+ void addDepend(QGraphicsObject *);
+ void remDepend(QGraphicsObject *);
bool isItemComplete() const;
bool componentComplete:1;
@@ -123,6 +123,8 @@ public:
// QDeclarativeItemGeometryListener interface
void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &);
+ void _q_widgetDestroyed(QObject *);
+ void _q_widgetGeometryChanged();
QDeclarativeAnchorsPrivate *anchorPrivate() { return this; }
bool checkHValid() const;
@@ -136,11 +138,11 @@ public:
void fillChanged();
void centerInChanged();
- QDeclarativeItem *item;
+ QGraphicsObject *item;
QDeclarativeAnchors::UsedAnchors usedAnchors;
- QDeclarativeItem *fill;
- QDeclarativeItem *centerIn;
+ QGraphicsObject *fill;
+ QGraphicsObject *centerIn;
QDeclarativeAnchorLine left;
QDeclarativeAnchorLine right;