summaryrefslogtreecommitdiffstats
path: root/examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout')
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.cpp28
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/linearlayout.h24
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/main.cpp4
-rw-r--r--examples/declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout/qgraphicslinearlayout.qml4
4 files changed, 30 insertions, 30 deletions
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"