diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-05-31 01:50:46 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-05-31 01:52:58 (GMT) |
commit | 1e60f5fb1c1ad9289247ef3bc47a94434b27dbea (patch) | |
tree | 6d3cf59900ba38531d7215a7370eb8eddbc4b85b | |
parent | 33bf5e9941d4c1c257d22280cd0e8fb64382c782 (diff) | |
download | Qt-1e60f5fb1c1ad9289247ef3bc47a94434b27dbea.zip Qt-1e60f5fb1c1ad9289247ef3bc47a94434b27dbea.tar.gz Qt-1e60f5fb1c1ad9289247ef3bc47a94434b27dbea.tar.bz2 |
Rename QGraphics...Layout classes/QML items to Graphics...Layout
to make it clear they are custom classes/items (not built-in)
8 files changed, 64 insertions, 64 deletions
diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp index 1792696..b52305e 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.cpp @@ -58,18 +58,18 @@ void GridLayoutAttached::setAlignment(Qt::Alignment a) } } -QHash<QGraphicsLayoutItem*, GridLayoutAttached*> QGraphicsGridLayoutObject::attachedProperties; +QHash<QGraphicsLayoutItem*, GridLayoutAttached*> GraphicsGridLayoutObject::attachedProperties; -QGraphicsGridLayoutObject::QGraphicsGridLayoutObject(QObject *parent) +GraphicsGridLayoutObject::GraphicsGridLayoutObject(QObject *parent) : QObject(parent) { } -QGraphicsGridLayoutObject::~QGraphicsGridLayoutObject() +GraphicsGridLayoutObject::~GraphicsGridLayoutObject() { } -void QGraphicsGridLayoutObject::addWidget(QGraphicsWidget *widget) +void GraphicsGridLayoutObject::addWidget(QGraphicsWidget *widget) { //use attached properties if (QObject *obj = attachedProperties.value(qobject_cast<QGraphicsLayoutItem*>(widget))) { @@ -85,7 +85,7 @@ void QGraphicsGridLayoutObject::addWidget(QGraphicsWidget *widget) } } -void QGraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item) +void GraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item) { //use attached properties if (GridLayoutAttached *obj = attachedProperties.value(item)) { @@ -134,7 +134,7 @@ void QGraphicsGridLayoutObject::addLayoutItem(QGraphicsLayoutItem *item) } } -void QGraphicsGridLayoutObject::removeAt(int index) +void GraphicsGridLayoutObject::removeAt(int index) { QGraphicsLayoutItem *item = itemAt(index); if (item) { @@ -145,21 +145,21 @@ void QGraphicsGridLayoutObject::removeAt(int index) QGraphicsGridLayout::removeAt(index); } -void QGraphicsGridLayoutObject::clearChildren() +void GraphicsGridLayoutObject::clearChildren() { // do not delete the removed items; they will be deleted by the QML engine while (count() > 0) removeAt(count()-1); } -qreal QGraphicsGridLayoutObject::spacing() const +qreal GraphicsGridLayoutObject::spacing() const { if (verticalSpacing() == horizontalSpacing()) return verticalSpacing(); return -1; } -qreal QGraphicsGridLayoutObject::contentsMargin() const +qreal GraphicsGridLayoutObject::contentsMargin() const { qreal a, b, c, d; getContentsMargins(&a, &b, &c, &d); @@ -168,17 +168,17 @@ qreal QGraphicsGridLayoutObject::contentsMargin() const return -1; } -void QGraphicsGridLayoutObject::setContentsMargin(qreal m) +void GraphicsGridLayoutObject::setContentsMargin(qreal m) { setContentsMargins(m, m, m, m); } -void QGraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +void GraphicsGridLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) { QGraphicsGridLayout::setAlignment(item, alignment); } -GridLayoutAttached *QGraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj) +GridLayoutAttached *GraphicsGridLayoutObject::qmlAttachedProperties(QObject *obj) { GridLayoutAttached *rv = new GridLayoutAttached(obj); if (qobject_cast<QGraphicsLayoutItem*>(obj)) diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h index cb8d9b7..ca2cedc 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/gridlayout.h @@ -47,7 +47,7 @@ #include <QGraphicsLayoutItem> class GridLayoutAttached; -class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout +class GraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout { Q_OBJECT Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) @@ -60,8 +60,8 @@ class QGraphicsGridLayoutObject : public QObject, public QGraphicsGridLayout Q_CLASSINFO("DefaultProperty", "children") public: - QGraphicsGridLayoutObject(QObject * = 0); - ~QGraphicsGridLayoutObject(); + GraphicsGridLayoutObject(QObject * = 0); + ~GraphicsGridLayoutObject(); QDeclarativeListProperty<QGraphicsLayoutItem> children() { return QDeclarativeListProperty<QGraphicsLayoutItem>(this, 0, children_append, children_count, children_at, children_clear); } @@ -84,19 +84,19 @@ private: void addLayoutItem(QGraphicsLayoutItem *); static void children_append(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, QGraphicsLayoutItem *item) { - static_cast<QGraphicsGridLayoutObject*>(prop->object)->addLayoutItem(item); + static_cast<GraphicsGridLayoutObject*>(prop->object)->addLayoutItem(item); } static void children_clear(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { - static_cast<QGraphicsGridLayoutObject*>(prop->object)->clearChildren(); + static_cast<GraphicsGridLayoutObject*>(prop->object)->clearChildren(); } static int children_count(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { - return static_cast<QGraphicsGridLayoutObject*>(prop->object)->count(); + return static_cast<GraphicsGridLayoutObject*>(prop->object)->count(); } static QGraphicsLayoutItem *children_at(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, int index) { - return static_cast<QGraphicsGridLayoutObject*>(prop->object)->itemAt(index); + return static_cast<GraphicsGridLayoutObject*>(prop->object)->itemAt(index); } static QHash<QGraphicsLayoutItem*, GridLayoutAttached*> attachedProperties; @@ -210,8 +210,8 @@ private: QML_DECLARE_INTERFACE(QGraphicsLayoutItem) QML_DECLARE_INTERFACE(QGraphicsLayout) -QML_DECLARE_TYPE(QGraphicsGridLayoutObject) -QML_DECLARE_TYPEINFO(QGraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(GraphicsGridLayoutObject) +QML_DECLARE_TYPEINFO(GraphicsGridLayoutObject, QML_HAS_ATTACHED_PROPERTIES) #endif diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp index 7585b23..6525cb3 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/main.cpp @@ -51,7 +51,7 @@ int main(int argc, char* argv[]) qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem"); qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout"); - qmlRegisterType<QGraphicsGridLayoutObject>("GridLayouts",4,7,"QGraphicsGridLayout"); + qmlRegisterType<GraphicsGridLayoutObject>("GridLayouts", 4, 7, "GraphicsGridLayout"); QDeclarativeView view; view.setSource(QUrl(":qgraphicsgridlayout.qml")); diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.qml b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.qml index 5cb011f..50026f1 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.qml +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout/qgraphicsgridlayout.qml @@ -58,39 +58,39 @@ Item { GridLayoutAttached class (also defined in gridlayout.h). */ - layout: QGraphicsGridLayout { + layout: GraphicsGridLayout { LayoutItem { - QGraphicsGridLayout.row: 0 - QGraphicsGridLayout.column: 0 + GraphicsGridLayout.row: 0 + GraphicsGridLayout.column: 0 minimumSize: "100x100" maximumSize: "300x300" preferredSize: "200x200" Rectangle { color: "red"; anchors.fill: parent } } LayoutItem { - QGraphicsGridLayout.row: 0 - QGraphicsGridLayout.column: 1 + GraphicsGridLayout.row: 0 + GraphicsGridLayout.column: 1 minimumSize: "100x100" maximumSize: "200x200" preferredSize: "200x200" Rectangle { color: "orange"; anchors.fill: parent } } LayoutItem { - QGraphicsGridLayout.row: 1 - QGraphicsGridLayout.column: 0 - QGraphicsGridLayout.columnSpan: 2 + GraphicsGridLayout.row: 1 + GraphicsGridLayout.column: 0 + GraphicsGridLayout.columnSpan: 2 minimumSize: "100x100" Rectangle { color: "yellow"; anchors.fill: parent } } LayoutItem { - QGraphicsGridLayout.row: 2 - QGraphicsGridLayout.column: 0 + GraphicsGridLayout.row: 2 + GraphicsGridLayout.column: 0 preferredSize: "200x200" Rectangle { color: "green"; anchors.fill: parent } } LayoutItem { - QGraphicsGridLayout.row: 2 - QGraphicsGridLayout.column: 1 + GraphicsGridLayout.row: 2 + GraphicsGridLayout.column: 1 preferredSize: "200x200" Rectangle { color: "blue"; anchors.fill: parent } } diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp index 080b6ce..d0e9783 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp @@ -72,12 +72,12 @@ void LinearLayoutAttached::setAlignment(Qt::Alignment a) } } -QGraphicsLinearLayoutStretchItemObject::QGraphicsLinearLayoutStretchItemObject(QObject *parent) +GraphicsLinearLayoutStretchItemObject::GraphicsLinearLayoutStretchItemObject(QObject *parent) : QObject(parent) { } -QSizeF QGraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const +QSizeF GraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { Q_UNUSED(which); Q_UNUSED(constraint); @@ -85,16 +85,16 @@ QSizeF QGraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, cons } -QGraphicsLinearLayoutObject::QGraphicsLinearLayoutObject(QObject *parent) +GraphicsLinearLayoutObject::GraphicsLinearLayoutObject(QObject *parent) : QObject(parent) { } -QGraphicsLinearLayoutObject::~QGraphicsLinearLayoutObject() +GraphicsLinearLayoutObject::~GraphicsLinearLayoutObject() { } -void QGraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutItem *item) +void GraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutItem *item) { insertItem(index, item); @@ -111,7 +111,7 @@ void QGraphicsLinearLayoutObject::insertLayoutItem(int index, QGraphicsLayoutIte } } -void QGraphicsLinearLayoutObject::removeAt(int index) +void GraphicsLinearLayoutObject::removeAt(int index) { QGraphicsLayoutItem *item = itemAt(index); if (item) { @@ -122,14 +122,14 @@ void QGraphicsLinearLayoutObject::removeAt(int index) QGraphicsLinearLayout::removeAt(index); } -void QGraphicsLinearLayoutObject::clearChildren() +void GraphicsLinearLayoutObject::clearChildren() { // do not delete the removed items; they will be deleted by the QML engine while (count() > 0) removeAt(count()-1); } -qreal QGraphicsLinearLayoutObject::contentsMargin() const +qreal GraphicsLinearLayoutObject::contentsMargin() const { qreal a, b, c, d; getContentsMargins(&a, &b, &c, &d); @@ -138,17 +138,17 @@ qreal QGraphicsLinearLayoutObject::contentsMargin() const return -1; } -void QGraphicsLinearLayoutObject::setContentsMargin(qreal m) +void GraphicsLinearLayoutObject::setContentsMargin(qreal m) { setContentsMargins(m, m, m, m); } -void QGraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch) +void GraphicsLinearLayoutObject::updateStretch(QGraphicsLayoutItem *item, int stretch) { QGraphicsLinearLayout::setStretchFactor(item, stretch); } -void QGraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing) +void GraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int spacing) { for (int i=0; i < count(); i++){ if (itemAt(i) == item) { @@ -158,13 +158,13 @@ void QGraphicsLinearLayoutObject::updateSpacing(QGraphicsLayoutItem* item, int s } } -void QGraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) +void GraphicsLinearLayoutObject::updateAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment) { QGraphicsLinearLayout::setAlignment(item, alignment); } -QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> QGraphicsLinearLayoutObject::attachedProperties; -LinearLayoutAttached *QGraphicsLinearLayoutObject::qmlAttachedProperties(QObject *obj) +QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> GraphicsLinearLayoutObject::attachedProperties; +LinearLayoutAttached *GraphicsLinearLayoutObject::qmlAttachedProperties(QObject *obj) { LinearLayoutAttached *rv = new LinearLayoutAttached(obj); if (qobject_cast<QGraphicsLayoutItem*>(obj)) diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h index e6daf4d..d9391ca 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h @@ -46,19 +46,19 @@ #include <QGraphicsLinearLayout> #include <QGraphicsLayoutItem> -class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem +class GraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem { Q_OBJECT Q_INTERFACES(QGraphicsLayoutItem) public: - QGraphicsLinearLayoutStretchItemObject(QObject *parent = 0); + GraphicsLinearLayoutStretchItemObject(QObject *parent = 0); virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; }; class LinearLayoutAttached; -class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout +class GraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout { Q_OBJECT Q_INTERFACES(QGraphicsLayout QGraphicsLayoutItem) @@ -69,8 +69,8 @@ class QGraphicsLinearLayoutObject : public QObject, public QGraphicsLinearLayout Q_PROPERTY(qreal contentsMargin READ contentsMargin WRITE setContentsMargin) Q_CLASSINFO("DefaultProperty", "children") public: - QGraphicsLinearLayoutObject(QObject * = 0); - ~QGraphicsLinearLayoutObject(); + GraphicsLinearLayoutObject(QObject * = 0); + ~GraphicsLinearLayoutObject(); QDeclarativeListProperty<QGraphicsLayoutItem> children() { return QDeclarativeListProperty<QGraphicsLayoutItem>(this, 0, children_append, children_count, children_at, children_clear); } @@ -93,19 +93,19 @@ private: void insertLayoutItem(int, QGraphicsLayoutItem *); static void children_append(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, QGraphicsLayoutItem *item) { - static_cast<QGraphicsLinearLayoutObject*>(prop->object)->insertLayoutItem(-1, item); + static_cast<GraphicsLinearLayoutObject*>(prop->object)->insertLayoutItem(-1, item); } static void children_clear(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { - static_cast<QGraphicsLinearLayoutObject*>(prop->object)->clearChildren(); + static_cast<GraphicsLinearLayoutObject*>(prop->object)->clearChildren(); } static int children_count(QDeclarativeListProperty<QGraphicsLayoutItem> *prop) { - return static_cast<QGraphicsLinearLayoutObject*>(prop->object)->count(); + return static_cast<GraphicsLinearLayoutObject*>(prop->object)->count(); } static QGraphicsLayoutItem *children_at(QDeclarativeListProperty<QGraphicsLayoutItem> *prop, int index) { - return static_cast<QGraphicsLinearLayoutObject*>(prop->object)->itemAt(index); + return static_cast<GraphicsLinearLayoutObject*>(prop->object)->itemAt(index); } static QHash<QGraphicsLayoutItem*, LinearLayoutAttached*> attachedProperties; @@ -143,9 +143,9 @@ private: QML_DECLARE_INTERFACE(QGraphicsLayoutItem) QML_DECLARE_INTERFACE(QGraphicsLayout) -QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) -QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) -QML_DECLARE_TYPEINFO(QGraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) +QML_DECLARE_TYPE(GraphicsLinearLayoutStretchItemObject) +QML_DECLARE_TYPE(GraphicsLinearLayoutObject) +QML_DECLARE_TYPEINFO(GraphicsLinearLayoutObject, QML_HAS_ATTACHED_PROPERTIES) #endif diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp index c76e403..f8d08c2 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp @@ -51,8 +51,8 @@ int main(int argc, char* argv[]) qmlRegisterInterface<QGraphicsLayoutItem>("QGraphicsLayoutItem"); qmlRegisterInterface<QGraphicsLayout>("QGraphicsLayout"); - qmlRegisterType<QGraphicsLinearLayoutStretchItemObject>("LinearLayouts",4,7,"QGraphicsLinearLayoutStretchItem"); - qmlRegisterType<QGraphicsLinearLayoutObject>("LinearLayouts",4,7,"QGraphicsLinearLayout"); + qmlRegisterType<GraphicsLinearLayoutStretchItemObject>("LinearLayouts", 4, 7, "GraphicsLinearLayoutStretchItem"); + qmlRegisterType<GraphicsLinearLayoutObject>("LinearLayouts", 4, 7, "GraphicsLinearLayout"); QDeclarativeView view; view.setSource(QUrl(":qgraphicslinearlayout.qml")); diff --git a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml index 72cdeb6..9a0bd55 100644 --- a/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml +++ b/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml @@ -59,9 +59,9 @@ Item { in linearlayout.h). */ - layout: QGraphicsLinearLayout { + layout: GraphicsLinearLayout { LayoutItem { - QGraphicsLinearLayout.spacing: 50 + GraphicsLinearLayout.spacing: 50 minimumSize: "100x100" maximumSize: "200x200" preferredSize: "100x100" |