diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-31 19:18:11 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-31 19:18:11 (GMT) |
commit | 6750d0dcbf5a2e88fab2e127dc3e057f0d68bf71 (patch) | |
tree | e79c09594e34f23c0769948bd53d1e0b72563921 /src/declarative/qml | |
parent | afef0789d8dd3ac2611f0c136e026d7d9cfa68f6 (diff) | |
parent | 1537036175c0cfedf013e5b47a801a4dc6983a00 (diff) | |
download | Qt-6750d0dcbf5a2e88fab2e127dc3e057f0d68bf71.zip Qt-6750d0dcbf5a2e88fab2e127dc3e057f0d68bf71.tar.gz Qt-6750d0dcbf5a2e88fab2e127dc3e057f0d68bf71.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (21 commits)
Doc: Fixed an off-by-one error in an example.
Fix QT_NO_TEXTHTMLPARSER
Fix QT_NO_DOM
Fix QT_NO_TEXTSTREAM compilation errors.
Fix QT_NO_VALIDATOR compilation.
Doc: Removed a misleading sentence about a class constructor.
Doc: correcting docs in QDrag::exec
Doc: Adding note about QDrag::exec()
Revert behavior of QTextLayout::boundingRect() when line width is set
Fix unreasonably large width of QTextLayout::boundingRect()
Doc: replacing old image
Fix compilation with stricts compilers.
Fix QT_NO_DIRMODEL build error in QtDeclarative.
Revert "Added native key support to QSharedMemory API."
Revert "Improved documentation for QSharedMemory's key/setKey functions."
Fix a simple mistake in QXmlStreamReader::atEnd() docs.
Improved documentation for QSharedMemory's key/setKey functions.
Added native key support to QSharedMemory API.
Make test work with shadow builds again.
Doc: Corrected the documentation about the compression threshold.
...
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativecompiler.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine_p.h | 3 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeinfo.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeinstruction.cpp | 5 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativestringconverters.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativestringconverters_p.h | 2 |
7 files changed, 23 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index d27aced..80a1093 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -240,6 +240,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop, if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: color expected")); } break; +#ifndef QT_NO_TEXTDATE case QVariant::Date: { bool ok; @@ -261,6 +262,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop, if (!ok) COMPILE_EXCEPTION(v, tr("Invalid property assignment: datetime expected")); } break; +#endif // QT_NO_TEXTDATE case QVariant::Point: case QVariant::PointF: { @@ -414,6 +416,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop, instr.storeColor.value = c.rgba(); } break; +#ifndef QT_NO_TEXTDATE case QVariant::Date: { QDate d = QDeclarativeStringConverters::dateFromString(string); @@ -447,6 +450,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop, instr.storeDateTime.valueIndex = index; } break; +#endif // QT_NO_TEXTDATE case QVariant::Point: case QVariant::PointF: { diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 8679e76..2f2ee08 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -284,10 +284,12 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr qtObject.setProperty(QLatin1String("tint"), newFunction(QDeclarativeEnginePrivate::tint, 2)); } +#ifndef QT_NO_TEXTDATE //date/time formatting qtObject.setProperty(QLatin1String("formatDate"),newFunction(QDeclarativeEnginePrivate::formatDate, 2)); qtObject.setProperty(QLatin1String("formatTime"),newFunction(QDeclarativeEnginePrivate::formatTime, 2)); qtObject.setProperty(QLatin1String("formatDateTime"),newFunction(QDeclarativeEnginePrivate::formatDateTime, 2)); +#endif //misc methods qtObject.setProperty(QLatin1String("openUrlExternally"),newFunction(QDeclarativeEnginePrivate::desktopOpenUrl, 1)); @@ -1219,6 +1221,7 @@ QScriptValue QDeclarativeEnginePrivate::vector3d(QScriptContext *ctxt, QScriptEn \qmlmethod string Qt::formatDate(datetime date, variant format) Returns the string representation of \c date, formatted according to \c format. */ +#ifndef QT_NO_TEXTDATE QScriptValue QDeclarativeEnginePrivate::formatDate(QScriptContext*ctxt, QScriptEngine*engine) { int argCount = ctxt->argumentCount(); @@ -1356,6 +1359,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr } return engine->newVariant(qVariantFromValue(date.toString(enumFormat))); } +#endif // QT_NO_TEXTDATE /*! \qmlmethod color Qt::rgba(real red, real green, real blue, real alpha) diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h index 804476c..3269e98 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/declarative/qml/qdeclarativeengine_p.h @@ -302,10 +302,11 @@ public: static QScriptValue consoleLog(QScriptContext*, QScriptEngine*); static QScriptValue quit(QScriptContext*, QScriptEngine*); +#ifndef QT_NO_TEXTDATE static QScriptValue formatDate(QScriptContext*, QScriptEngine*); static QScriptValue formatTime(QScriptContext*, QScriptEngine*); static QScriptValue formatDateTime(QScriptContext*, QScriptEngine*); - +#endif static QScriptEngine *getScriptEngine(QDeclarativeEngine *e) { return &e->d_func()->scriptEngine; } static QDeclarativeEngine *getEngine(QScriptEngine *e) { return static_cast<QDeclarativeScriptEngine*>(e)->p->q_func(); } static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e) { return e->d_func(); } diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h index 2ac28f4..b41abd8 100644 --- a/src/declarative/qml/qdeclarativeinfo.h +++ b/src/declarative/qml/qdeclarativeinfo.h @@ -81,7 +81,9 @@ public: inline QDeclarativeInfo &operator<<(const void * t) { QDebug::operator<<(t); return *this; } inline QDeclarativeInfo &operator<<(QTextStreamFunction f) { QDebug::operator<<(f); return *this; } inline QDeclarativeInfo &operator<<(QTextStreamManipulator m) { QDebug::operator<<(m); return *this; } +#ifndef QT_NO_DEBUG_STREAM inline QDeclarativeInfo &operator<<(const QUrl &t) { static_cast<QDebug &>(*this) << t; return *this; } +#endif private: friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp index b86d082..0f7b09d 100644 --- a/src/declarative/qml/qdeclarativeinstruction.cpp +++ b/src/declarative/qml/qdeclarativeinstruction.cpp @@ -49,6 +49,10 @@ QT_BEGIN_NAMESPACE void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) { +#ifdef QT_NO_DEBUG_STREAM + Q_UNUSED(instr) + Q_UNUSED(idx) +#else QByteArray lineNumber = QByteArray::number(instr->line); if (instr->line == (unsigned short)-1) lineNumber = "NA"; @@ -217,6 +221,7 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) qWarning().nospace() << idx << "\t\t" << line << "\t" << "XXX UNKOWN INSTRUCTION" << "\t" << instr->type; break; } +#endif // QT_NO_DEBUG_STREAM } QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp index bbcc00b..8bd2cf1 100644 --- a/src/declarative/qml/qdeclarativestringconverters.cpp +++ b/src/declarative/qml/qdeclarativestringconverters.cpp @@ -106,12 +106,14 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int p return QVariant(uint(qRound(s.toDouble(ok)))); case QMetaType::QColor: return QVariant::fromValue(colorFromString(s, ok)); +#ifndef QT_NO_TEXTDATE case QMetaType::QDate: return QVariant::fromValue(dateFromString(s, ok)); case QMetaType::QTime: return QVariant::fromValue(timeFromString(s, ok)); case QMetaType::QDateTime: return QVariant::fromValue(dateTimeFromString(s, ok)); +#endif // QT_NO_TEXTDATE case QMetaType::QPointF: return QVariant::fromValue(pointFFromString(s, ok)); case QMetaType::QPoint: @@ -150,6 +152,7 @@ QColor QDeclarativeStringConverters::colorFromString(const QString &s, bool *ok) } } +#ifndef QT_NO_TEXTDATE QDate QDeclarativeStringConverters::dateFromString(const QString &s, bool *ok) { QDate d = QDate::fromString(s, Qt::ISODate); @@ -170,6 +173,7 @@ QDateTime QDeclarativeStringConverters::dateTimeFromString(const QString &s, boo if (ok) *ok = d.isValid(); return d; } +#endif // QT_NO_TEXTDATE //expects input of "x,y" QPointF QDeclarativeStringConverters::pointFFromString(const QString &s, bool *ok) diff --git a/src/declarative/qml/qdeclarativestringconverters_p.h b/src/declarative/qml/qdeclarativestringconverters_p.h index 97f72fc..842d1b3 100644 --- a/src/declarative/qml/qdeclarativestringconverters_p.h +++ b/src/declarative/qml/qdeclarativestringconverters_p.h @@ -73,9 +73,11 @@ namespace QDeclarativeStringConverters QVariant Q_DECLARATIVE_EXPORT variantFromString(const QString &, int preferredType, bool *ok = 0); QColor Q_DECLARATIVE_EXPORT colorFromString(const QString &, bool *ok = 0); +#ifndef QT_NO_TEXTDATE QDate Q_DECLARATIVE_EXPORT dateFromString(const QString &, bool *ok = 0); QTime Q_DECLARATIVE_EXPORT timeFromString(const QString &, bool *ok = 0); QDateTime Q_DECLARATIVE_EXPORT dateTimeFromString(const QString &, bool *ok = 0); +#endif QPointF Q_DECLARATIVE_EXPORT pointFFromString(const QString &, bool *ok = 0); QSizeF Q_DECLARATIVE_EXPORT sizeFFromString(const QString &, bool *ok = 0); QRectF Q_DECLARATIVE_EXPORT rectFFromString(const QString &, bool *ok = 0); |