aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-30 09:08:35 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-06-30 09:08:35 +0200
commit5112821a37ab749f758e354e84703df2d09d5471 (patch)
tree8f19ba6e7661109675b5e1e9b0ddae94b4c96d4f /src/qml/qml
parent5d2ea1d5e9d6e29a16d0e9333cfc2dc8e7c5b677 (diff)
parenta3f686cf7cc14ff481b972b1170a7ff76d0e0fd0 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/quick/items/qquickitemsmodule.cpp tools/qml/main.cpp Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp4
-rw-r--r--src/qml/qml/qqmlvaluetype.cpp39
-rw-r--r--src/qml/qml/qqmlvaluetype_p.h18
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp10
4 files changed, 65 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 425c5e507c..d46f612e40 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -246,9 +246,9 @@ V4_DEFINE_EXTENSION(QQmlComponentExtension, componentExtension);
\table
\row
\li MyItem.qml
- \li main.qml
- \row
\li \snippet qml/component/MyItem.qml 0
+ \row
+ \li main.qml
\li \snippet qml/component/main.qml 0
\endtable
*/
diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp
index cc4a9bebc5..7ebfcd64b7 100644
--- a/src/qml/qml/qqmlvaluetype.cpp
+++ b/src/qml/qml/qqmlvaluetype.cpp
@@ -388,6 +388,26 @@ void QQmlRectFValueType::setHeight(qreal h)
v.setHeight(h);
}
+qreal QQmlRectFValueType::left() const
+{
+ return v.left();
+}
+
+qreal QQmlRectFValueType::right() const
+{
+ return v.right();
+}
+
+qreal QQmlRectFValueType::top() const
+{
+ return v.top();
+}
+
+qreal QQmlRectFValueType::bottom() const
+{
+ return v.bottom();
+}
+
int QQmlRectValueType::x() const
{
return v.x();
@@ -428,6 +448,25 @@ void QQmlRectValueType::setHeight(int h)
v.setHeight(h);
}
+int QQmlRectValueType::left() const
+{
+ return v.left();
+}
+
+int QQmlRectValueType::right() const
+{
+ return v.right();
+}
+
+int QQmlRectValueType::top() const
+{
+ return v.top();
+}
+
+int QQmlRectValueType::bottom() const
+{
+ return v.bottom();
+}
QQmlEasingValueType::Type QQmlEasingValueType::type() const
{
diff --git a/src/qml/qml/qqmlvaluetype_p.h b/src/qml/qml/qqmlvaluetype_p.h
index 0dcf78c519..abd73d7f35 100644
--- a/src/qml/qml/qqmlvaluetype_p.h
+++ b/src/qml/qml/qqmlvaluetype_p.h
@@ -153,6 +153,10 @@ struct QQmlRectFValueType
Q_PROPERTY(qreal y READ y WRITE setY FINAL)
Q_PROPERTY(qreal width READ width WRITE setWidth FINAL)
Q_PROPERTY(qreal height READ height WRITE setHeight FINAL)
+ Q_PROPERTY(qreal left READ left DESIGNABLE false FINAL)
+ Q_PROPERTY(qreal right READ right DESIGNABLE false FINAL)
+ Q_PROPERTY(qreal top READ top DESIGNABLE false FINAL)
+ Q_PROPERTY(qreal bottom READ bottom DESIGNABLE false FINAL)
Q_GADGET
public:
Q_INVOKABLE QString toString() const;
@@ -165,6 +169,11 @@ public:
qreal height() const;
void setWidth(qreal);
void setHeight(qreal);
+
+ qreal left() const;
+ qreal right() const;
+ qreal top() const;
+ qreal bottom() const;
};
struct QQmlRectValueType
@@ -174,6 +183,10 @@ struct QQmlRectValueType
Q_PROPERTY(int y READ y WRITE setY FINAL)
Q_PROPERTY(int width READ width WRITE setWidth FINAL)
Q_PROPERTY(int height READ height WRITE setHeight FINAL)
+ Q_PROPERTY(int left READ left DESIGNABLE false FINAL)
+ Q_PROPERTY(int right READ right DESIGNABLE false FINAL)
+ Q_PROPERTY(int top READ top DESIGNABLE false FINAL)
+ Q_PROPERTY(int bottom READ bottom DESIGNABLE false FINAL)
Q_GADGET
public:
int x() const;
@@ -185,6 +198,11 @@ public:
int height() const;
void setWidth(int);
void setHeight(int);
+
+ int left() const;
+ int right() const;
+ int top() const;
+ int bottom() const;
};
struct QQmlEasingValueType
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index 58b6937432..b0ab85199d 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -314,10 +314,12 @@ ReturnedValue QQmlValueTypeWrapper::method_toString(CallContext *ctx)
const QMetaObject *mo = w->d()->propertyCache->metaObject();
const int propCount = mo->propertyCount();
for (int i = 0; i < propCount; ++i) {
- QVariant value = mo->property(i).readOnGadget(w->d()->gadgetPtr);
- result += value.toString();
- if (i < propCount - 1)
- result += QStringLiteral(", ");
+ if (mo->property(i).isDesignable()) {
+ QVariant value = mo->property(i).readOnGadget(w->d()->gadgetPtr);
+ if (i > 0)
+ result += QLatin1String(", ");
+ result += value.toString();
+ }
}
result += QLatin1Char(')');
}