summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-10-15 07:26:28 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-10-15 07:26:28 (GMT)
commit9182a60aabaedf7d0b7278544920c546cb89e461 (patch)
tree2bd0626f3fe804cc37778808aab7027a2f0fc58b /src
parent0f97a4fbcab5972f47a8a6cc3b501446df94bedb (diff)
parentf9a0533d2711d3efca48a80f6ff65098039d7b33 (diff)
downloadQt-9182a60aabaedf7d0b7278544920c546cb89e461.zip
Qt-9182a60aabaedf7d0b7278544920c546cb89e461.tar.gz
Qt-9182a60aabaedf7d0b7278544920c546cb89e461.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r--src/declarative/debugger/qmldebugclient.cpp2
-rw-r--r--src/declarative/extra/qmlfolderlistmodel.cpp9
-rw-r--r--src/declarative/extra/qmlfolderlistmodel.h3
-rw-r--r--src/declarative/fx/qfxlistview.cpp2
-rw-r--r--src/declarative/fx/qfxtext.cpp8
-rw-r--r--src/declarative/fx/qfxtextinput_p.h2
-rw-r--r--src/declarative/qml/qml.h20
-rw-r--r--src/declarative/qml/qmlcompiler.cpp4
-rw-r--r--src/declarative/qml/qmlcustomparser_p.h8
-rw-r--r--src/declarative/qml/qmlengine.cpp2
10 files changed, 51 insertions, 9 deletions
diff --git a/src/declarative/debugger/qmldebugclient.cpp b/src/declarative/debugger/qmldebugclient.cpp
index d13de57..3171808 100644
--- a/src/declarative/debugger/qmldebugclient.cpp
+++ b/src/declarative/debugger/qmldebugclient.cpp
@@ -104,7 +104,7 @@ bool QmlDebugConnection::isConnected() const
class QmlDebugClientPrivate : public QObjectPrivate
{
- Q_DECLARE_PUBLIC(QmlDebugClient);
+ Q_DECLARE_PUBLIC(QmlDebugClient)
public:
QmlDebugClientPrivate();
diff --git a/src/declarative/extra/qmlfolderlistmodel.cpp b/src/declarative/extra/qmlfolderlistmodel.cpp
index bdea03f..4a7c2f1 100644
--- a/src/declarative/extra/qmlfolderlistmodel.cpp
+++ b/src/declarative/extra/qmlfolderlistmodel.cpp
@@ -195,6 +195,15 @@ void QmlFolderListModel::setFolder(const QString &folder)
}
}
+QString QmlFolderListModel::parentFolder() const
+{
+ Q_D(const QmlFolderListModel);
+ int pos = d->folder.lastIndexOf('/');
+ if (pos == -1)
+ return QString();
+ return d->folder.left(pos);
+}
+
/*!
\qmlproperty list<string> FolderListModel::nameFilters
diff --git a/src/declarative/extra/qmlfolderlistmodel.h b/src/declarative/extra/qmlfolderlistmodel.h
index 24a3ac6..6bb1c4b 100644
--- a/src/declarative/extra/qmlfolderlistmodel.h
+++ b/src/declarative/extra/qmlfolderlistmodel.h
@@ -61,6 +61,7 @@ class Q_DECLARATIVE_EXPORT QmlFolderListModel : public QListModelInterface, publ
Q_INTERFACES(QmlParserStatus)
Q_PROPERTY(QString folder READ folder WRITE setFolder NOTIFY folderChanged)
+ Q_PROPERTY(QString parentFolder READ parentFolder NOTIFY folderChanged)
Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters)
Q_PROPERTY(SortField sortField READ sortField WRITE setSortField)
Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed)
@@ -77,6 +78,8 @@ public:
QString folder() const;
void setFolder(const QString &folder);
+ QString parentFolder() const;
+
QStringList nameFilters() const;
void setNameFilters(const QStringList &filters);
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 604d16b..4fb0ec1 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -166,7 +166,7 @@ public:
class QFxListViewPrivate : public QFxFlickablePrivate
{
- Q_DECLARE_PUBLIC(QFxListView);
+ Q_DECLARE_PUBLIC(QFxListView)
public:
QFxListViewPrivate()
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index c26ed2c..4d02f0d 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -427,9 +427,13 @@ void QFxText::setTextFormat(TextFormat format)
This property cannot be used with wrap enabled or with rich text.
- Eliding can be ElideNone, ElideLeft, ElideMiddle, or ElideRight.
+ Eliding can be ElideNone (the default), ElideLeft, ElideMiddle, or ElideRight.
- ElideNone is the default.
+ If the text is a multi-length string, and the mode is not ElideNone,
+ the first string that fits will be used, otherwise the last will be elided.
+
+ Multi-length strings are ordered from longest to shortest, separated by the
+ Unicode "String Terminator" character U009C (write this in QML with "\\x9C").
*/
Qt::TextElideMode QFxText::elideMode() const
{
diff --git a/src/declarative/fx/qfxtextinput_p.h b/src/declarative/fx/qfxtextinput_p.h
index a2b45bb..3978be4 100644
--- a/src/declarative/fx/qfxtextinput_p.h
+++ b/src/declarative/fx/qfxtextinput_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
class QFxTextInputPrivate : public QFxPaintedItemPrivate
{
- Q_DECLARE_PUBLIC(QFxTextInput);
+ Q_DECLARE_PUBLIC(QFxTextInput)
public:
QFxTextInputPrivate() : control(new QLineControl(QString())),
color((QRgb)0), style(QFxText::Normal),
diff --git a/src/declarative/qml/qml.h b/src/declarative/qml/qml.h
index 23f2f1e..c437ef1 100644
--- a/src/declarative/qml/qml.h
+++ b/src/declarative/qml/qml.h
@@ -74,6 +74,24 @@ QT_MODULE(Declarative)
QT_BEGIN_NAMESPACE
+#if defined(Q_OS_SYMBIAN)
+#define QML_DEFINE_INTERFACE(INTERFACE) \
+ static int defineInterface##INTERFACE = qmlRegisterInterface<INTERFACE>(#INTERFACE);
+
+#define QML_DEFINE_EXTENDED_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, NAME, TYPE, EXTENSION) \
+ static int registerExtended##TYPE = qmlRegisterExtendedType<TYPE,EXTENSION>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, #NAME, #TYPE);
+
+#define QML_DEFINE_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, NAME, TYPE) \
+ static int defineType##TYPE = qmlRegisterType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, #NAME, #TYPE);
+
+#define QML_DEFINE_EXTENDED_NOCREATE_TYPE(TYPE, EXTENSION) \
+ static int registerExtendedNoCreate##TYPE = qmlRegisterExtendedType<TYPE,EXTENSION>(#TYPE);
+
+#define QML_DEFINE_NOCREATE_TYPE(TYPE) \
+ static int registerNoCreate##TYPE = qmlRegisterType<TYPE>(#TYPE);
+
+#else
+
#define QML_DEFINE_INTERFACE(INTERFACE) \
template<> QmlPrivate::InstanceType QmlPrivate::Define<INTERFACE *,0,0,0>::instance(qmlRegisterInterface<INTERFACE>(#INTERFACE));
@@ -89,6 +107,8 @@ QT_BEGIN_NAMESPACE
#define QML_DEFINE_NOCREATE_TYPE(TYPE) \
template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *,0,0,0>::instance(qmlRegisterType<TYPE>(#TYPE));
+#endif
+
class QmlContext;
class QmlEngine;
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *);
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index c744509..e2fd7cb 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -2039,7 +2039,7 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj)
return true;
}
-static QAtomicInt classIndexCounter;
+Q_GLOBAL_STATIC(QAtomicInt, classIndexCounter)
bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
{
@@ -2058,7 +2058,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
QByteArray newClassName = obj->metatype->className();
newClassName.append("_QML_");
- int idx = classIndexCounter.fetchAndAddRelaxed(1);
+ int idx = classIndexCounter()->fetchAndAddRelaxed(1);
newClassName.append(QByteArray::number(idx));
QMetaObjectBuilder builder;
diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qmlcustomparser_p.h
index 5be0680..eb3e579 100644
--- a/src/declarative/qml/qmlcustomparser_p.h
+++ b/src/declarative/qml/qmlcustomparser_p.h
@@ -127,8 +127,14 @@ protected:
private:
QList<QmlError> exceptions;
};
-#define QML_DEFINE_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, NAME, TYPE, CUSTOMTYPE) \
+
+#if defined(Q_OS_SYMBIAN)
+# define QML_DEFINE_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, NAME, TYPE, CUSTOMTYPE) \
+ static int defineCustomType##NAME = qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, #NAME, #TYPE, new CUSTOMTYPE);
+#else
+# define QML_DEFINE_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, NAME, TYPE, CUSTOMTYPE) \
template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *,(VERSION_MAJ), (VERSION_MIN_FROM), (VERSION_MAJ_TO)>::instance(qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, #NAME, #TYPE, new CUSTOMTYPE));
+#endif
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index f0ecf1d..528e8c9 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -1099,7 +1099,7 @@ public:
int slash = type.indexOf('/');
if (slash >= 0) {
while (!s) {
- s = set.value(QString::fromLatin1(type.left(slash)));
+ s = set.value(QString::fromUtf8(type.left(slash)));
int nslash = type.indexOf('/',slash+1);
if (nslash > 0)
slash = nslash;