summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-02-03 22:52:18 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-02-03 22:52:18 (GMT)
commitbd3d16fcebdeaf1948e33af9fbf54871aadc5fc5 (patch)
treede8277a0de1bdd74a0ed240596fe1bde735c8f10 /src/corelib
parenta6c9422dc2103ee439696b24932149c5b08f2db8 (diff)
parentd87e2627cbc3f818e23c9c80b03cc665e5f3d444 (diff)
downloadQt-bd3d16fcebdeaf1948e33af9fbf54871aadc5fc5.zip
Qt-bd3d16fcebdeaf1948e33af9fbf54871aadc5fc5.tar.gz
Qt-bd3d16fcebdeaf1948e33af9fbf54871aadc5fc5.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (172 commits) Don't accept input methods when a TextEdit or TextInput is read only. Correct error message On windows xp using a higher port makes the declarativedebug* tests work Correct assert Update QDeclarative DEF files for Symbian Export QDeclarativeRefCount so that symbian compiles. Make Flickable's wheel handling more like QAbstractScrollArea. Changing header or footer failed to delete the previous. Avoid index-out-of bounds related crash in Grid Move Qt.application docs into Qt global object page Add initial size to ListView in FolderListModel example update What's New for QtQuick 1.1 and AnimatedImage docs Improve docs on Item::visible and Item::opacity Make sure we update Loader size if item size changes after creation. Froze two more symbols and fixed compilation error (QtQuick11). PinchArea sometimes failed. Froze Symbian def files for QtQuick11. Clarify that IntValidator performs locale specific validation. Add a mouseSelectionMode property to TextEdit and TextInput. Add missing versioning tests for new QtQuick 1.1 properties/methods. ...
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp48
-rw-r--r--src/corelib/kernel/qmetaobject.h3
-rw-r--r--src/corelib/kernel/qmetaobject_p.h6
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
4 files changed, 57 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index f888c2a..d07b7cb 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1369,6 +1369,25 @@ int QMetaMethod::methodIndex() const
}
/*!
+ \internal
+
+ Returns the method revision if one was
+ specified by Q_REVISION, otherwise returns 0.
+ */
+int QMetaMethod::revision() const
+{
+ if (!mobj)
+ return 0;
+ if ((QMetaMethod::Access)(mobj->d.data[handle + 4] & MethodRevisioned)) {
+ int offset = priv(mobj->d.data)->methodData
+ + priv(mobj->d.data)->methodCount * 5
+ + (handle - priv(mobj->d.data)->methodData) / 5;
+ return mobj->d.data[offset];
+ }
+ return 0;
+}
+
+/*!
Returns the access specification of this method (private,
protected, or public).
@@ -2389,6 +2408,35 @@ int QMetaProperty::notifySignalIndex() const
}
/*!
+ \internal
+
+ Returns the property revision if one was
+ specified by REVISION, otherwise returns 0.
+ */
+int QMetaProperty::revision() const
+{
+ if (!mobj)
+ return 0;
+ int flags = mobj->d.data[handle + 2];
+ if (flags & Revisioned) {
+ int offset = priv(mobj->d.data)->propertyData +
+ priv(mobj->d.data)->propertyCount * 3 + idx;
+ // Revision data is placed after NOTIFY data, if present.
+ // Iterate through properties to discover whether we have NOTIFY signals.
+ for (int i = 0; i < priv(mobj->d.data)->propertyCount; ++i) {
+ int handle = priv(mobj->d.data)->propertyData + 3*i;
+ if (mobj->d.data[handle + 2] & Notify) {
+ offset += priv(mobj->d.data)->propertyCount;
+ break;
+ }
+ }
+ return mobj->d.data[offset];
+ } else {
+ return 0;
+ }
+}
+
+/*!
Returns true if this property is writable; otherwise returns
false.
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 382dae8..7b2e938 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -70,6 +70,7 @@ public:
enum Attributes { Compatibility = 0x1, Cloned = 0x2, Scriptable = 0x4 };
int attributes() const;
int methodIndex() const;
+ int revision() const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
@@ -200,6 +201,8 @@ public:
QMetaMethod notifySignal() const;
int notifySignalIndex() const;
+ int revision() const;
+
QVariant read(const QObject *obj) const;
bool write(QObject *obj, const QVariant &value) const;
bool reset(QObject *obj) const;
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index 466e8d7..1d97cb7 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -78,7 +78,8 @@ enum PropertyFlags {
ResolveEditable = 0x00080000,
User = 0x00100000,
ResolveUser = 0x00200000,
- Notify = 0x00400000
+ Notify = 0x00400000,
+ Revisioned = 0x00800000
};
enum MethodFlags {
@@ -95,7 +96,8 @@ enum MethodFlags {
MethodCompatibility = 0x10,
MethodCloned = 0x20,
- MethodScriptable = 0x40
+ MethodScriptable = 0x40,
+ MethodRevisioned = 0x80
};
enum MetaObjectFlags {
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 778dcb8..b727187 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -79,6 +79,7 @@ class QString;
#define Q_INTERFACES(x)
#define Q_PROPERTY(text)
#define Q_PRIVATE_PROPERTY(d, text)
+#define Q_REVISION(v)
#define Q_OVERRIDE(text)
#define Q_ENUMS(x)
#define Q_FLAGS(x)
@@ -180,6 +181,7 @@ private:
#define Q_INTERFACES(x) Q_INTERFACES(x)
#define Q_PROPERTY(text) Q_PROPERTY(text)
#define Q_PRIVATE_PROPERTY(d, text) Q_PRIVATE_PROPERTY(d, text)
+#define Q_REVISION(v) Q_REVISION(v)
#define Q_OVERRIDE(text) Q_OVERRIDE(text)
#define Q_ENUMS(x) Q_ENUMS(x)
#define Q_FLAGS(x) Q_FLAGS(x)