From 39d8429b22d71786214e2b1ed7972f22d96fdfd1 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 27 Oct 2009 15:43:19 +1000 Subject: Fix remote content loading for absolute URLs (the test is pending...) --- src/declarative/qml/qmlcomponent.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 0894758..02c9b10 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -368,8 +368,9 @@ void QmlComponent::setData(const QByteArray &data, const QUrl &url) QmlCompositeTypeData *typeData = QmlEnginePrivate::get(d->engine)->typeManager.getImmediate(data, url); - if (typeData->status == QmlCompositeTypeData::Waiting) { - + if (typeData->status == QmlCompositeTypeData::Waiting + || typeData->status == QmlCompositeTypeData::WaitingResources) + { d->typeData = typeData; d->typeData->addWaiter(d); @@ -414,7 +415,9 @@ void QmlComponent::loadUrl(const QUrl &url) QmlCompositeTypeData *data = QmlEnginePrivate::get(d->engine)->typeManager.get(d->url); - if (data->status == QmlCompositeTypeData::Waiting) { + if (data->status == QmlCompositeTypeData::Waiting + || data->status == QmlCompositeTypeData::WaitingResources) + { d->typeData = data; d->typeData->addWaiter(d); d->progress = data->progress; -- cgit v0.12 From fc4dd3eab91fc1959e216a754620a96cf05932d7 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Tue, 27 Oct 2009 16:29:16 +1000 Subject: Test remote QML content (test data will appear on qt-test-server.qt-test-net shortly) --- .../declarative/qmllanguage/tst_qmllanguage.cpp | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index d51bbcc..1544312 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -7,6 +7,9 @@ #include #include "testtypes.h" +#include "../../../shared/util.h" +#include "../../network-settings.h" + /* This test case covers QML language issues. This covers everything that does involve evaluating ECMAScript expressions and bindings. @@ -69,6 +72,8 @@ private slots: void importsBuiltin(); void importsLocal_data(); void importsLocal(); + void importsRemote_data(); + void importsRemote(); void importsInstalled_data(); void importsInstalled(); void importsOrder_data(); @@ -773,6 +778,8 @@ void tst_qmllanguage::testType(const QString& qml, const QString& type) { QmlComponent component(&engine, qml.toUtf8(), TEST_FILE("empty.qml")); // just a file for relative local imports + QTRY_VERIFY(!component.isLoading()); + if (type.isEmpty()) { QVERIFY(component.isError()); } else { @@ -927,6 +934,27 @@ void tst_qmllanguage::importsLocal() testType(qml,type); } +void tst_qmllanguage::importsRemote_data() +{ + QTest::addColumn("qml"); + QTest::addColumn("type"); + + QString serverdir = "http://" + + QtNetworkSettings::serverName() + + "/qtest/declarative/qmllanguage"; + + QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QFxRect"; + QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QFxText"; + QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QFxImage"; +} + +void tst_qmllanguage::importsRemote() +{ + QFETCH(QString, qml); + QFETCH(QString, type); + testType(qml,type); +} + void tst_qmllanguage::importsInstalled_data() { QTest::addColumn("qml"); -- cgit v0.12 From 0f0a5081c671297d550fd51ccc66bb5fb8a68b86 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 10:37:25 +1000 Subject: Check values when remove() is called --- src/declarative/debugger/qmldebug.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 2537ec0..6e541a9 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -67,26 +67,30 @@ int QmlEngineDebugPrivate::getId() void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugEnginesQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->enginesQuery.remove(q->m_queryId); + if (p && q) + p->enginesQuery.remove(q->m_queryId); } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugRootContextQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->rootContextQuery.remove(q->m_queryId); + if (p && q) + p->rootContextQuery.remove(q->m_queryId); } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugObjectQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->objectQuery.remove(q->m_queryId); + if (p && q) + p->objectQuery.remove(q->m_queryId); } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugExpressionQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->expressionQuery.remove(q->m_queryId); + if (p && q) + p->expressionQuery.remove(q->m_queryId); } Q_DECLARE_METATYPE(QmlDebugObjectReference); -- cgit v0.12 From 92b7eea44ed5aa0a1b3b209b913b4039448a51db Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 10:38:10 +1000 Subject: Fix crash bug where watch is already deleted --- tools/qmldebugger/standalone/watchtable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qmldebugger/standalone/watchtable.cpp b/tools/qmldebugger/standalone/watchtable.cpp index a7fd052..19f034e 100644 --- a/tools/qmldebugger/standalone/watchtable.cpp +++ b/tools/qmldebugger/standalone/watchtable.cpp @@ -265,7 +265,8 @@ void WatchTableModel::removeAllWatches() for (int i=0; iremoveWatch(m_columns[i].watch); - delete m_columns[i].watch; + else + delete m_columns[i].watch; } m_columns.clear(); m_values.clear(); -- cgit v0.12 From eaab2a271f0d73d5a413902169efe32741208c42 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 13:59:33 +1000 Subject: Add a QmlExpression::error() method QmlExpression should not print errors itself. This is the responsibility of the caller. --- src/declarative/qml/qmlbinding.cpp | 8 +++-- src/declarative/qml/qmlboundsignal.cpp | 5 +++- src/declarative/qml/qmlcontext.cpp | 7 +++-- src/declarative/qml/qmlerror.cpp | 42 +++++++++++++++++++------- src/declarative/qml/qmlerror.h | 2 ++ src/declarative/qml/qmlexpression.cpp | 55 +++++++++++++++++++++++++++++++--- src/declarative/qml/qmlexpression.h | 5 ++++ src/declarative/qml/qmlexpression_p.h | 4 ++- 8 files changed, 107 insertions(+), 21 deletions(-) diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp index 65ff789..ab4343c 100644 --- a/src/declarative/qml/qmlbinding.cpp +++ b/src/declarative/qml/qmlbinding.cpp @@ -128,10 +128,12 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags) idx, a); } else { - bool undefined = false; - QVariant value = this->value(&undefined); + bool isUndefined = false; + QVariant value = this->value(&isUndefined); - if (!undefined && data->property.object() && !data->property.write(value, flags)) { + if (this->hasError()) { + qWarning().nospace() << qPrintable(this->error().toString()); + } else if (!isUndefined && data->property.object() && !data->property.write(value, flags)) { QString fileName = data->fileName; int line = data->line; if (fileName.isEmpty()) fileName = QLatin1String(""); diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qmlboundsignal.cpp index ce591e8..d715309 100644 --- a/src/declarative/qml/qmlboundsignal.cpp +++ b/src/declarative/qml/qmlboundsignal.cpp @@ -175,8 +175,11 @@ int QmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { if (m_params) m_params->setValues(a); - if (m_expression) + if (m_expression) { QmlExpressionPrivate::get(m_expression)->value(m_params); + if (m_expression->hasError()) + qWarning().nospace() << qPrintable(m_expression->error().toString()); + } if (m_params) m_params->clearValues(); return -1; } else { diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index 2ebdf10..5032ff4 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -77,8 +77,11 @@ void QmlContextPrivate::addScript(const QString &script, QObject *scopeObject, QScriptValue val = scriptEngine->evaluate(script, fileName, lineNumber); - if (scriptEngine->hasUncaughtException()) - QmlExpressionPrivate::printException(scriptEngine); + if (scriptEngine->hasUncaughtException()) { + QmlError error; + QmlExpressionPrivate::exceptionToError(scriptEngine, error); + qWarning().nospace() << qPrintable(error.toString()); + } scriptEngine->popContext(); diff --git a/src/declarative/qml/qmlerror.cpp b/src/declarative/qml/qmlerror.cpp index 514fe44..f4c9580 100644 --- a/src/declarative/qml/qmlerror.cpp +++ b/src/declarative/qml/qmlerror.cpp @@ -70,7 +70,7 @@ QmlErrorPrivate::QmlErrorPrivate() Create an empty error object. */ QmlError::QmlError() -: d(new QmlErrorPrivate) +: d(0) { } @@ -78,7 +78,7 @@ QmlError::QmlError() Create a copy of \a other. */ QmlError::QmlError(const QmlError &other) -: d(new QmlErrorPrivate) +: d(0) { *this = other; } @@ -88,10 +88,16 @@ QmlError::QmlError(const QmlError &other) */ QmlError &QmlError::operator=(const QmlError &other) { - d->url = other.d->url; - d->description = other.d->description; - d->line = other.d->line; - d->column = other.d->column; + if (!other.d) { + delete d; + d = 0; + } else { + if (!d) d = new QmlErrorPrivate; + d->url = other.d->url; + d->description = other.d->description; + d->line = other.d->line; + d->column = other.d->column; + } return *this; } @@ -104,11 +110,20 @@ QmlError::~QmlError() } /*! + Return true if this error is valid, otherwise false. +*/ +bool QmlError::isValid() const +{ + return d != 0; +} + +/*! Return the url for the file that caused this error. */ QUrl QmlError::url() const { - return d->url; + if (d) return d->url; + else return QUrl(); } /*! @@ -116,6 +131,7 @@ QUrl QmlError::url() const */ void QmlError::setUrl(const QUrl &url) { + if (!d) d = new QmlErrorPrivate; d->url = url; } @@ -124,7 +140,8 @@ void QmlError::setUrl(const QUrl &url) */ QString QmlError::description() const { - return d->description; + if (d) return d->description; + else return QString(); } /*! @@ -132,6 +149,7 @@ QString QmlError::description() const */ void QmlError::setDescription(const QString &description) { + if (!d) d = new QmlErrorPrivate; d->description = description; } @@ -140,7 +158,8 @@ void QmlError::setDescription(const QString &description) */ int QmlError::line() const { - return d->line; + if (d) return d->line; + else return -1; } /*! @@ -148,6 +167,7 @@ int QmlError::line() const */ void QmlError::setLine(int line) { + if (!d) d = new QmlErrorPrivate; d->line = line; } @@ -156,7 +176,8 @@ void QmlError::setLine(int line) */ int QmlError::column() const { - return d->column; + if (d) return d->column; + else return -1; } /*! @@ -164,6 +185,7 @@ int QmlError::column() const */ void QmlError::setColumn(int column) { + if (!d) d = new QmlErrorPrivate; d->column = column; } diff --git a/src/declarative/qml/qmlerror.h b/src/declarative/qml/qmlerror.h index c1a8720..ee3d7b4 100644 --- a/src/declarative/qml/qmlerror.h +++ b/src/declarative/qml/qmlerror.h @@ -61,6 +61,8 @@ public: QmlError &operator=(const QmlError &); ~QmlError(); + bool isValid() const; + QUrl url() const; void setUrl(const QUrl &); QString description() const; diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index c62756b..8231bf8 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -260,7 +260,8 @@ QVariant QmlExpressionPrivate::evalSSE() return rv; } -void QmlExpressionPrivate::printException(QScriptEngine *scriptEngine) +void QmlExpressionPrivate::exceptionToError(QScriptEngine *scriptEngine, + QmlError &error) { if (scriptEngine->hasUncaughtException() && scriptEngine->uncaughtException().isError()) { @@ -277,8 +278,12 @@ void QmlExpressionPrivate::printException(QScriptEngine *scriptEngine) fileName = QLatin1String(""); } - qWarning().nospace() << qPrintable(fileName) << ":" << lineNumber << ": " - << qPrintable(exception.toString()); + error.setUrl(QUrl(fileName)); + error.setLine(lineNumber); + error.setColumn(-1); + error.setDescription(exception.toString()); + } else { + error = QmlError(); } } @@ -321,10 +326,13 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd if (isUndefined) *isUndefined = svalue.isUndefined() || scriptEngine->hasUncaughtException(); + // Handle exception if (scriptEngine->hasUncaughtException()) { - printException(scriptEngine); + exceptionToError(scriptEngine, data->error); scriptEngine->clearExceptions(); return QVariant(); + } else { + data->error = QmlError(); } if (secondaryScope) { @@ -418,6 +426,8 @@ QVariant QmlExpressionPrivate::value(QObject *secondaryScope, bool *isUndefined) \a isUndefined is set to true if the expression resulted in an undefined value. + + \sa hasError(), error() */ QVariant QmlExpression::value(bool *isUndefined) { @@ -509,6 +519,43 @@ QObject *QmlExpression::scopeObject() const return d->data->me; } +/*! + Returns true if the last call to value() resulted in an error, + otherwise false. + + \sa error(), clearError() +*/ +bool QmlExpression::hasError() const +{ + Q_D(const QmlExpression); + return d->data->error.isValid(); +} + +/*! + Clear any expression errors. Calls to hasError() following this will + return false. + + \sa hasError(), error() +*/ +void QmlExpression::clearError() +{ + Q_D(QmlExpression); + d->data->error = QmlError(); +} + +/*! + Return any error from the last call to value(). If there was no error, + this returns an invalid QmlError instance. + + \sa hasError(), clearError() +*/ + +QmlError QmlExpression::error() const +{ + Q_D(const QmlExpression); + return d->data->error; +} + /*! \internal */ void QmlExpression::__q_notify() { diff --git a/src/declarative/qml/qmlexpression.h b/src/declarative/qml/qmlexpression.h index 96694d6..127d3f3 100644 --- a/src/declarative/qml/qmlexpression.h +++ b/src/declarative/qml/qmlexpression.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -82,6 +83,10 @@ public: QObject *scopeObject() const; + bool hasError() const; + void clearError(); + QmlError error() const; + public Q_SLOTS: QVariant value(bool *isUndefined = 0); diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h index 3ec8d1c..b453a96 100644 --- a/src/declarative/qml/qmlexpression_p.h +++ b/src/declarative/qml/qmlexpression_p.h @@ -92,6 +92,8 @@ public: bool expressionRewritten:1; QScriptValue expressionFunction; + QmlError error; + QmlBasicScript sse; QObject *me; bool trackChange; @@ -151,7 +153,7 @@ public: return static_cast(QObjectPrivate::get(expr)); } - static void printException(QScriptEngine *); + static void exceptionToError(QScriptEngine *, QmlError &); }; QT_END_NAMESPACE -- cgit v0.12 From 6be1b102d27610e7d4417222eb4b4dd80d453295 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 28 Oct 2009 14:21:53 +1000 Subject: Fix bug where repeater would add spacing for 0 sized children --- src/declarative/fx/qfxpositioners.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/declarative/fx/qfxpositioners.cpp b/src/declarative/fx/qfxpositioners.cpp index f8e7213..cc385e0 100644 --- a/src/declarative/fx/qfxpositioners.cpp +++ b/src/declarative/fx/qfxpositioners.cpp @@ -659,8 +659,10 @@ void QFxRow::doPositioning() child->setX(hoffset); setMovingItem(0); } - hoffset += child->width(); - hoffset += spacing(); + if(!child->width() || !child->height()){//don't advance for invisible children + hoffset += child->width(); + hoffset += spacing(); + } } } -- cgit v0.12 From 97fe32132f1e55fddca464404f06ab70d81c56d8 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 28 Oct 2009 14:24:19 +1000 Subject: Doc --- doc/src/declarative/globalobject.qdoc | 26 ++++++++++++++++++++++++++ src/declarative/fx/qfxitem.cpp | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index 2328c8a..afbe3db 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -56,6 +56,32 @@ Contains all the properties of the ECMAScript global object, plus: \section1 Qt Object +The Qt object contains functions for + +creating types: +\list +\o hsla +\o rgba +\o rect +\o point +\o size +\o vector3d +\endlist + +manipulating color: +\list +\o lighter +\o darker +\o tint +\endlist + +and playing sound: +\list +\o playSound +\endlist + +It also contains enum values used by some items. + \section1 Asynchronous JavaScript and XML \section1 Offline Storage API diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index e714494..7d60336 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -1199,7 +1199,7 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj) /*! \class QFxItem - \brief QFxItem is the most basic of all visual items in QML. + \brief The QFxItem class provides the most basic of all visual items in QML. All visual items in Qt Declarative inherit from QFxItem. Although QFxItem has no visual appearance, it defines all the properties that are -- cgit v0.12 From f6b063eeef71b4cb7c1cff090166201f794c9679 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 28 Oct 2009 14:52:48 +1000 Subject: make TextElideMode an enum of QFxText. --- src/declarative/fx/qfxtext.cpp | 22 +++++++++++----------- src/declarative/fx/qfxtext.h | 15 ++++++++++----- src/declarative/fx/qfxtext_p.h | 4 ++-- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index 4d02f0d..763256b 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -420,28 +420,28 @@ void QFxText::setTextFormat(TextFormat format) } /*! - \qmlproperty Qt::TextElideMode Text::elide + \qmlproperty enumeration Text::elide Set this property to elide parts of the text fit to the Text item's width. The text will only elide if an explicit width has been set. This property cannot be used with wrap enabled or with rich text. - Eliding can be ElideNone (the default), ElideLeft, ElideMiddle, or ElideRight. + Eliding can be \c ElideNone (the default), \c ElideLeft, \c ElideMiddle, or \c ElideRight. - If the text is a multi-length string, and the mode is not ElideNone, + If the text is a multi-length string, and the mode is not \c 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"). + Unicode "String Terminator" character \c U009C (write this in QML with \c{"\\x9C"}). */ -Qt::TextElideMode QFxText::elideMode() const +QFxText::TextElideMode QFxText::elideMode() const { Q_D(const QFxText); return d->elideMode; } -void QFxText::setElideMode(Qt::TextElideMode mode) +void QFxText::setElideMode(QFxText::TextElideMode mode) { Q_D(QFxText); if (mode == d->elideMode) @@ -458,7 +458,7 @@ void QFxText::geometryChanged(const QRectF &newGeometry, { Q_D(QFxText); if (newGeometry.width() != oldGeometry.width()) { - if (d->wrap || d->elideMode != Qt::ElideNone) { + if (d->wrap || d->elideMode != QFxText::ElideNone) { d->imgDirty = true; d->updateSize(); } @@ -486,8 +486,8 @@ void QFxTextPrivate::updateSize() tmp = text; tmp.replace(QLatin1Char('\n'), QChar::LineSeparator); singleline = !tmp.contains(QChar::LineSeparator); - if (singleline && elideMode != Qt::ElideNone && q->widthValid()) - tmp = fm.elidedText(tmp,elideMode,q->width()); // XXX still worth layout...? + if (singleline && elideMode != QFxText::ElideNone && q->widthValid()) + tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width()); // XXX still worth layout...? layout.clearLayout(); layout.setFont(font); layout.setText(tmp); @@ -586,7 +586,7 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout) qreal lineWidth = 0; //set manual width - if ((wrap || elideMode != Qt::ElideNone) && q->widthValid()) + if ((wrap || elideMode != QFxText::ElideNone) && q->widthValid()) lineWidth = q->width(); layout->beginLayout(); @@ -596,7 +596,7 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout) if (!line.isValid()) break; - if ((wrap || elideMode != Qt::ElideNone) && q->widthValid()) + if ((wrap || elideMode != QFxText::ElideNone) && q->widthValid()) line.setLineWidth(lineWidth); } layout->endLayout(); diff --git a/src/declarative/fx/qfxtext.h b/src/declarative/fx/qfxtext.h index 763e2aa..cdb8025 100644 --- a/src/declarative/fx/qfxtext.h +++ b/src/declarative/fx/qfxtext.h @@ -57,6 +57,7 @@ class Q_DECLARATIVE_EXPORT QFxText : public QFxItem Q_ENUMS(VAlignment) Q_ENUMS(TextStyle) Q_ENUMS(TextFormat) + Q_ENUMS(TextElideMode) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QFont font READ font WRITE setFont) @@ -67,7 +68,7 @@ class Q_DECLARATIVE_EXPORT QFxText : public QFxItem Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign) Q_PROPERTY(bool wrap READ wrap WRITE setWrap) //### there are several wrap modes in Qt Q_PROPERTY(TextFormat textFormat READ textFormat WRITE setTextFormat) - Q_PROPERTY(Qt::TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode? + Q_PROPERTY(TextElideMode elide READ elideMode WRITE setElideMode) //### elideMode? public: QFxText(QFxItem *parent=0); @@ -84,8 +85,12 @@ public: Raised, Sunken }; enum TextFormat { PlainText = Qt::PlainText, - RichText = Qt::RichText, - AutoText = Qt::AutoText }; + RichText = Qt::RichText, + AutoText = Qt::AutoText }; + enum TextElideMode { ElideLeft = Qt::ElideLeft, + ElideRight = Qt::ElideRight, + ElideMiddle = Qt::ElideMiddle, + ElideNone = Qt::ElideNone }; QString text() const; void setText(const QString &); @@ -114,8 +119,8 @@ public: TextFormat textFormat() const; void setTextFormat(TextFormat format); - Qt::TextElideMode elideMode() const; - void setElideMode(Qt::TextElideMode); + TextElideMode elideMode() const; + void setElideMode(TextElideMode); void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); diff --git a/src/declarative/fx/qfxtext_p.h b/src/declarative/fx/qfxtext_p.h index 8b24c66..a10cdfa 100644 --- a/src/declarative/fx/qfxtext_p.h +++ b/src/declarative/fx/qfxtext_p.h @@ -70,7 +70,7 @@ class QFxTextPrivate : public QFxItemPrivate public: QFxTextPrivate() : color((QRgb)0), style(QFxText::Normal), imgDirty(true), - hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), elideMode(Qt::ElideNone), + hAlign(QFxText::AlignLeft), vAlign(QFxText::AlignTop), elideMode(QFxText::ElideNone), dirty(true), wrap(false), richText(false), singleline(false), control(0), doc(0), format(QFxText::AutoText) { @@ -97,7 +97,7 @@ public: QPixmap imgStyleCache; QFxText::HAlignment hAlign; QFxText::VAlignment vAlign; - Qt::TextElideMode elideMode; + QFxText::TextElideMode elideMode; bool dirty; bool wrap; bool richText; -- cgit v0.12 From d42846123ec17641d1e8a8082fab0d04ce93e8a1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 14:57:16 +1000 Subject: Do not display transient binding errors During QML startup, it is common to have "errors" in bindings as the apps state stabilizes. These are not real errors, but just a consequence of implementing a declarative UI in an imperative world. Now during startup, the display of errors is delayed until the startup completes, and then only bindings that are still in an error state are displayed. QT-2373 --- src/declarative/qml/qmlbinding.cpp | 62 +++++++++++++++++++++++++++++++---- src/declarative/qml/qmlbinding_p.h | 6 ++++ src/declarative/qml/qmlcomponent.cpp | 17 ++++++++++ src/declarative/qml/qmlengine.cpp | 5 +-- src/declarative/qml/qmlengine_p.h | 5 +++ src/declarative/qml/qmlexpression.cpp | 1 + src/declarative/qml/qmlexpression_p.h | 2 +- 7 files changed, 88 insertions(+), 10 deletions(-) diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp index ab4343c..317a4b3 100644 --- a/src/declarative/qml/qmlbinding.cpp +++ b/src/declarative/qml/qmlbinding.cpp @@ -58,10 +58,46 @@ QT_BEGIN_NAMESPACE QML_DEFINE_NOCREATE_TYPE(QmlBinding); QmlBindingData::QmlBindingData() -: updating(false), enabled(false) +: updating(false), enabled(false), nextError(0), prevError(0) { } +QmlBindingData::~QmlBindingData() +{ + removeError(); +} + +void QmlBindingData::removeError() +{ + if (!prevError) return; + + if (nextError) nextError->prevError = prevError; + *prevError = nextError; + nextError = 0; + prevError = 0; +} + +bool QmlBindingData::addError() +{ + if (prevError) return false; + + QmlContext *c = context(); + if (!c) return false; + QmlEngine *e = c->engine(); + if (!e) return false; + + QmlEnginePrivate *p = QmlEnginePrivate::get(e); + + if (p->inProgressCreations == 0) return false; // Not in construction + + prevError = &p->erroredBindings; + nextError = p->erroredBindings; + p->erroredBindings = this; + if (nextError) nextError->prevError = &nextError; + + return true; +} + QmlBindingPrivate::QmlBindingPrivate() : QmlExpressionPrivate(new QmlBindingData) { @@ -131,9 +167,9 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags) bool isUndefined = false; QVariant value = this->value(&isUndefined); - if (this->hasError()) { - qWarning().nospace() << qPrintable(this->error().toString()); - } else if (!isUndefined && data->property.object() && !data->property.write(value, flags)) { + if (!isUndefined && data->property.object() && + !data->property.write(value, flags)) { + QString fileName = data->fileName; int line = data->line; if (fileName.isEmpty()) fileName = QLatin1String(""); @@ -141,9 +177,21 @@ void QmlBinding::update(QmlMetaProperty::WriteFlags flags) const char *valueType = 0; if (value.userType() == QVariant::Invalid) valueType = "null"; else valueType = QMetaType::typeName(value.userType()); - qWarning().nospace() << qPrintable(fileName) << ":" << line - << " Unable to assign " << valueType << " to " - << QMetaType::typeName(data->property.propertyType()); + + data->error.setUrl(fileName); + data->error.setLine(line); + data->error.setColumn(-1); + data->error.setDescription(QLatin1String("Unable to assign ") + + QLatin1String(valueType) + + QLatin1String(" to ") + + QLatin1String(QMetaType::typeName(data->property.propertyType()))); + } + + if (data->error.isValid()) { + if (!data->addError()) + qWarning().nospace() << qPrintable(this->error().toString()); + } else { + data->removeError(); } } diff --git a/src/declarative/qml/qmlbinding_p.h b/src/declarative/qml/qmlbinding_p.h index 2c0c6b9..c9378cb 100644 --- a/src/declarative/qml/qmlbinding_p.h +++ b/src/declarative/qml/qmlbinding_p.h @@ -63,11 +63,17 @@ class QmlBindingData : public QmlExpressionData { public: QmlBindingData(); + virtual ~QmlBindingData(); bool updating:1; bool enabled:1; QmlMetaProperty property; + + void removeError(); + bool addError(); + QmlBindingData *nextError; + QmlBindingData **prevError; }; class QmlBindingPrivate : public QmlExpressionPrivate diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 0894758..3767695 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -55,6 +55,7 @@ #include "qmlbinding.h" #include #include +#include #include "qmlscriptparser_p.h" @@ -197,6 +198,12 @@ QmlComponent::QmlComponent(QObject *parent) QmlComponent::~QmlComponent() { Q_D(QmlComponent); + + if (d->completePending) { + qWarning("QmlComponent: Component destroyed while completion pending"); + d->completeCreate(); + } + if (d->typeData) { d->typeData->remWaiter(d); d->typeData->release(); @@ -574,8 +581,10 @@ QmlComponentPrivate::beginCreate(QmlContext *context, const QBitField &bindings) ep->bindValues.clear(); ep->parserStatus.clear(); completePending = true; + QmlEnginePrivate::get(engine)->inProgressCreations++; } + if (rv) { QFx_setParent_noEvent(ctxt, rv); } else { @@ -643,6 +652,14 @@ void QmlComponentPrivate::completeCreate() bindValues.clear(); parserStatus.clear(); completePending = false; + QmlEnginePrivate *p = QmlEnginePrivate::get(engine); + p->inProgressCreations--; + if (0 == p->inProgressCreations) { + while (p->erroredBindings) { + qWarning().nospace() << qPrintable(p->erroredBindings->error.toString()); + p->erroredBindings->removeError(); + } + } } } diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 0e239ce..3da8aa9 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -126,8 +126,9 @@ static QString userLocalDataPath(const QString& app) QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) : rootContext(0), currentExpression(0), isDebugging(false), contextClass(0), objectClass(0), valueTypeClass(0), globalClass(0), - nodeListClass(0), namedNodeMapClass(0), sqlQueryClass(0), cleanup(0), scriptEngine(this), - componentAttacheds(0), rootComponent(0), networkAccessManager(0), typeManager(e), uniqueId(1) + nodeListClass(0), namedNodeMapClass(0), sqlQueryClass(0), cleanup(0), erroredBindings(0), + inProgressCreations(0), scriptEngine(this), componentAttacheds(0), rootComponent(0), + networkAccessManager(0), typeManager(e), uniqueId(1) { QScriptValue qtObject = scriptEngine.newQMetaObject(StaticQtMetaObject::get()); diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h index 69b121e..efd26bf 100644 --- a/src/declarative/qml/qmlengine_p.h +++ b/src/declarative/qml/qmlengine_p.h @@ -98,6 +98,7 @@ class QmlTypeNameCache; class QmlComponentAttached; class QmlListScriptClass; class QmlCleanup; +class QmlBindingData; class QmlEnginePrivate : public QObjectPrivate { @@ -143,6 +144,10 @@ public: // Registered cleanup handlers QmlCleanup *cleanup; + // Bindings that have had errors during startup + QmlBindingData *erroredBindings; + int inProgressCreations; + struct QmlScriptEngine : public QScriptEngine { QmlScriptEngine(QmlEnginePrivate *priv) diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index 8231bf8..e5e5cf9 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -293,6 +293,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd QFxPerfTimer perfqt; #endif + QmlExpressionData *data = this->data; QmlContextPrivate *ctxtPriv = data->context()->d_func(); QmlEngine *engine = data->context()->engine(); QmlEnginePrivate *ep = QmlEnginePrivate::get(engine); diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h index b453a96..4e13de3 100644 --- a/src/declarative/qml/qmlexpression_p.h +++ b/src/declarative/qml/qmlexpression_p.h @@ -83,7 +83,7 @@ class QmlExpressionData : public QmlAbstractExpression, public QmlRefCount { public: QmlExpressionData(); - ~QmlExpressionData(); + virtual ~QmlExpressionData(); QmlExpressionPrivate *q; -- cgit v0.12 From cbc205d5b1fada56e2de82fa7c971ac7cefdf3fe Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 28 Oct 2009 15:13:31 +1000 Subject: Test visibility. Add refs back to JIRA items. --- .../data/lib/com/nokia/installedtest/PrivateType.qml | 2 ++ tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/PrivateType.qml diff --git a/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/PrivateType.qml b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/PrivateType.qml new file mode 100644 index 0000000..93c7630 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/lib/com/nokia/installedtest/PrivateType.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Image {} diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 78c66ad..6494c40 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -831,8 +831,12 @@ QML_DEFINE_TYPE(com.nokia.Test, 1, 8, 9, Test, TestType2) QML_DEFINE_TYPE(com.nokia.Test, 1, 12, 13, Test, TestType2) QML_DEFINE_TYPE(com.nokia.Test, 1, 9, 11, OldTest, TestType) +// Import tests (QT-558) + void tst_qmllanguage::importsBuiltin_data() { + // QT-610 + QTest::addColumn("qml"); QTest::addColumn("type"); @@ -849,7 +853,7 @@ void tst_qmllanguage::importsBuiltin_data() "Test {}" << "TestType"; QTest::newRow("qualified wrong") - << "import com.nokia.Test 1.0 as T\n" + << "import com.nokia.Test 1.0 as T\n" // QT-610 "Test {}" << ""; QTest::newRow("qualified right") @@ -941,7 +945,7 @@ void tst_qmllanguage::importsLocal_data() // import locals QTest::newRow("local import") - << "import \"subdir\"\n" + << "import \"subdir\"\n" // QT-613 "Test {}" << "QFxRect"; QTest::newRow("local import as") @@ -989,18 +993,24 @@ void tst_qmllanguage::importsRemote() void tst_qmllanguage::importsInstalled_data() { + // QT-610 + QTest::addColumn("qml"); QTest::addColumn("type"); // import installed - QTest::newRow("installed import") + QTest::newRow("installed import 1") << "import com.nokia.installedtest 1.0\n" "InstalledTest {}" << "QFxRect"; - QTest::newRow("installed import") + QTest::newRow("installed import 2") << "import com.nokia.installedtest 1.4\n" "InstalledTest {}" << "QFxText"; + QTest::newRow("installed import visibility") // QT-614 + << "import com.nokia.installedtest 1.4\n" + "PrivateType {}" + << ""; } void tst_qmllanguage::importsInstalled() -- cgit v0.12 From 1e7318348848ff7f51446ae90021051a494e3cb8 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 28 Oct 2009 15:19:34 +1000 Subject: cleanup --- examples/declarative/fillmode/fillmode.qml | 14 ++-- examples/declarative/velocity/Day.qml | 108 ++++++++++------------------- examples/declarative/velocity/velocity.qml | 77 ++++++++++---------- 3 files changed, 79 insertions(+), 120 deletions(-) diff --git a/examples/declarative/fillmode/fillmode.qml b/examples/declarative/fillmode/fillmode.qml index 0fdacbf..d3a28e2 100644 --- a/examples/declarative/fillmode/fillmode.qml +++ b/examples/declarative/fillmode/fillmode.qml @@ -7,22 +7,22 @@ Image { fillMode: SequentialAnimation { running: true repeat: true - PropertyAction { value: "Stretch" } + PropertyAction { value: Image.Stretch } PropertyAction { target: label; property: "text"; value: "Stretch" } PauseAnimation { duration: 1000 } - PropertyAction { value: "PreserveAspectFit" } + PropertyAction { value: Image.PreserveAspectFit } PropertyAction { target: label; property: "text"; value: "PreserveAspectFit" } PauseAnimation { duration: 1000 } - PropertyAction { value: "PreserveAspectCrop" } + PropertyAction { value: Image.PreserveAspectCrop } PropertyAction { target: label; property: "text"; value: "PreserveAspectCrop" } PauseAnimation { duration: 1000 } - PropertyAction { value: "Tile" } + PropertyAction { value: Image.Tile } PropertyAction { target: label; property: "text"; value: "Tile" } PauseAnimation { duration: 1000 } - PropertyAction { value: "TileHorizontally" } + PropertyAction { value: Image.TileHorizontally } PropertyAction { target: label; property: "text"; value: "TileHorizontally" } PauseAnimation { duration: 1000 } - PropertyAction { value: "TileVertically" } + PropertyAction { value: Image.TileVertically } PropertyAction { target: label; property: "text"; value: "TileVertically" } PauseAnimation { duration: 1000 } } @@ -30,7 +30,7 @@ Image { id: label font.pointSize: 24 color: "blue" - style: "Outline" + style: Text.Outline styleColor: "white" anchors { centerIn: parent } } diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml index b0d4dd9..030fa13 100644 --- a/examples/declarative/velocity/Day.qml +++ b/examples/declarative/velocity/Day.qml @@ -1,65 +1,48 @@ import Qt 4.6 Rectangle { - property string day + property alias day: dayText.text property var stickies - width: 400 - height: 500 - radius: 7 - border.color: "black" id: page - Image { - x: 10 - y: 10 - source: "cork.jpg" - } + width: 400; height: 500; radius: 7 + border.color: "black" + + Image { x: 10; y: 10; source: "cork.jpg" } + Text { - x: 20 - y: 20 - height: 40 - font.pointSize: 14 - font.bold: true - width: 370 - text: day - style: "Outline" - styleColor: "#dedede" + id: dayText; x: 20; y: 20 + height: 40; width: 370 + font.pointSize: 14; font.bold: true + style: Text.Outline; styleColor: "#dedede" } + Repeater { model: page.stickies + Item { + id: stickyPage x: Math.random() * 200 + 100 y: Math.random() * 300 + 50 - id: stickyPage rotation: SpringFollow { source: -flickable.horizontalVelocity / 100 - spring: 2.0 - damping: 0.1 + spring: 2.0; damping: 0.1 } + Item { id: sticky scale: 0.5 Image { - id: stickyImage - source: "sticky.png" - smooth: true - y: -20 - x: 8 + -width * 0.6 / 2 - scale: 0.6 + id: stickyImage; source: "sticky.png" + smooth: true; y: -20; x: 8 + -width * 0.6 / 2; scale: 0.6 } + TextEdit { - id: myText - smooth: true - font.pointSize: 28 - readOnly: false - x: -104 - y: 36 - wrap: true - rotation: -8 - text: noteText - width: 195 - height: 172 + id: myText; smooth: true; font.pointSize: 28 + readOnly: false; x: -104; y: 36; wrap: true + rotation: -8; text: noteText; width: 195; height: 172 } + Item { y: -20 x: stickyImage.x @@ -69,44 +52,27 @@ Rectangle { id: mouse onClicked: { myText.focus = true } anchors.fill: parent - drag.target: stickyPage - drag.axis: "XandYAxis" - drag.minimumY: 0 - drag.maximumY: 500 - drag.minimumX: 0 - drag.maximumX: 400 + drag.target: stickyPage; drag.axis: "XandYAxis"; drag.minimumY: 0; drag.maximumY: 500 + drag.minimumX: 0; drag.maximumX: 400 } } } + Image { source: "tack.png" - x: -width / 2 - y: -height * 0.7 / 2 - scale: 0.7 + x: -width / 2; y: -height * 0.7 / 2; scale: 0.7 + } + + states: State { + name: "pressed" + when: mouse.pressed + PropertyChanges { target: sticky; rotation: 8; scale: 1 } + PropertyChanges { target: page; z: 8 } + } + + transitions: Transition { + NumberAnimation { properties: "rotation,scale"; duration: 200 } } - states: [ - State { - name: "pressed" - when: mouse.pressed - PropertyChanges { - target: sticky - rotation: 8 - scale: 1 - } - PropertyChanges { - target: page - z: 8 - } - } - ] - transitions: [ - Transition { - NumberAnimation { - properties: "rotation,scale" - duration: 200 - } - } - ] } } } diff --git a/examples/declarative/velocity/velocity.qml b/examples/declarative/velocity/velocity.qml index b132965..50d69d8 100644 --- a/examples/declarative/velocity/velocity.qml +++ b/examples/declarative/velocity/velocity.qml @@ -2,8 +2,8 @@ import Qt 4.6 Rectangle { color: "lightSteelBlue" - width: 800 - height: 600 + width: 800; height: 600 + ListModel { id: list ListElement { @@ -12,10 +12,10 @@ Rectangle { notes: [ ListElement { noteText: "Lunch" - }, - ListElement { - noteText: "Party" - } + }, + ListElement { + noteText: "Party" + } ] } ListElement { @@ -24,13 +24,13 @@ Rectangle { notes: [ ListElement { noteText: "Pickup kids" - }, - ListElement { - noteText: "Checkout kinetic" - }, - ListElement { - noteText: "Read email" - } + }, + ListElement { + noteText: "Checkout kinetic" + }, + ListElement { + noteText: "Read email" + } ] } ListElement { @@ -39,10 +39,10 @@ Rectangle { notes: [ ListElement { noteText: "Walk dog" - }, - ListElement { - noteText: "Buy newspaper" - } + }, + ListElement { + noteText: "Buy newspaper" + } ] } ListElement { @@ -51,10 +51,10 @@ Rectangle { notes: [ ListElement { noteText: "Cook dinner" - }, - ListElement { - noteText: "Eat dinner" - } + }, + ListElement { + noteText: "Eat dinner" + } ] } ListElement { @@ -63,10 +63,10 @@ Rectangle { notes: [ ListElement { noteText: "5:30pm Meeting" - }, - ListElement { - noteText: "Weed garden" - } + }, + ListElement { + noteText: "Weed garden" + } ] } ListElement { @@ -75,10 +75,10 @@ Rectangle { notes: [ ListElement { noteText: "Still work" - }, - ListElement { - noteText: "Drink" - } + }, + ListElement { + noteText: "Drink" + } ] } ListElement { @@ -87,28 +87,21 @@ Rectangle { notes: [ ListElement { noteText: "Drink" - }, - ListElement { - noteText: "Drink" - } + }, + ListElement { + noteText: "Drink" + } ] } } Flickable { id: flickable - anchors.fill: parent - viewportWidth: lay.width + anchors.fill: parent; viewportWidth: lay.width Row { id: lay Repeater { model: list - Component { - Day { - day: name - color: dayColor - stickies: notes - } - } + Component { Day { day: name; color: dayColor; stickies: notes } } } } } -- cgit v0.12 From 57d2291b2e0533d23bd52e9814faf6a5727a4e96 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 15:21:36 +1000 Subject: Test for QT-2373 Ensure that transient binding errors are not displayed. --- .../data/NestedTypeTransientErrors.qml | 11 +++++++++++ .../qmlecmascript/data/transientErrors.qml | 10 ++++++++++ .../qmlecmascript/tst_qmlecmascript.cpp | 23 ++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 tests/auto/declarative/qmlecmascript/data/NestedTypeTransientErrors.qml create mode 100644 tests/auto/declarative/qmlecmascript/data/transientErrors.qml diff --git a/tests/auto/declarative/qmlecmascript/data/NestedTypeTransientErrors.qml b/tests/auto/declarative/qmlecmascript/data/NestedTypeTransientErrors.qml new file mode 100644 index 0000000..e19bf24 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/NestedTypeTransientErrors.qml @@ -0,0 +1,11 @@ +import Qt 4.6 + +Object { + property int b: obj.prop.a + + property var prop; + prop: Object { + property int a: 10 + } +} + diff --git a/tests/auto/declarative/qmlecmascript/data/transientErrors.qml b/tests/auto/declarative/qmlecmascript/data/transientErrors.qml new file mode 100644 index 0000000..4e123c6 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/transientErrors.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +Object { + property var obj: nested + + property var obj2 + obj2: NestedTypeTransientErrors { + id: nested + } +} diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 67a98b1..48c2249 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -66,6 +66,7 @@ private slots: void signalTriggeredBindings(); void listProperties(); void exceptionClearsOnReeval(); + void transientErrors(); private: QmlEngine engine; @@ -847,6 +848,28 @@ void tst_qmlecmascript::exceptionClearsOnReeval() QCOMPARE(object->property("test").toBool(), true); } +static int transientErrorsMsgCount = 0; +static void transientErrorsMsgHandler(QtMsgType, const char *) +{ + ++transientErrorsMsgCount; +} + +// Check that transient binding errors are not displayed +void tst_qmlecmascript::transientErrors() +{ + QmlComponent component(&engine, TEST_FILE("transientErrors.qml")); + + transientErrorsMsgCount = 0; + QtMsgHandler old = qInstallMsgHandler(transientErrorsMsgHandler); + + QObject *object = component.create(); + QVERIFY(object != 0); + + qInstallMsgHandler(old); + + QCOMPARE(transientErrorsMsgCount, 0); +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" -- cgit v0.12 From a8f312c84d2c21f8f1c21a99f3dd3428fd16b2fa Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 28 Oct 2009 15:27:42 +1000 Subject: cleanup --- examples/declarative/aspectratio/scale_and_crop_simple.qml | 2 +- examples/declarative/aspectratio/scale_to_fit_simple.qml | 2 +- examples/declarative/fonts/fonts.qml | 10 +++++----- examples/declarative/loader/Browser.qml | 4 ++-- examples/declarative/snow/ImageBatch.qml | 2 +- examples/declarative/tutorials/samegame/samegame1/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame2/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame3/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame4/samegame.qml | 2 +- examples/declarative/webview/content/FieldText.qml | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/declarative/aspectratio/scale_and_crop_simple.qml b/examples/declarative/aspectratio/scale_and_crop_simple.qml index 9cc9c19..434e98e 100644 --- a/examples/declarative/aspectratio/scale_and_crop_simple.qml +++ b/examples/declarative/aspectratio/scale_and_crop_simple.qml @@ -13,7 +13,7 @@ Rectangle { Image { id: face source: "pics/face.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop anchors.fill: parent } } diff --git a/examples/declarative/aspectratio/scale_to_fit_simple.qml b/examples/declarative/aspectratio/scale_to_fit_simple.qml index f7fcd8b..83909ef 100644 --- a/examples/declarative/aspectratio/scale_to_fit_simple.qml +++ b/examples/declarative/aspectratio/scale_to_fit_simple.qml @@ -13,7 +13,7 @@ Rectangle { Image { id: face source: "pics/face.png" - fillMode: "PreserveAspectFit" + fillMode: Image.PreserveAspectFit anchors.fill: parent } } diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml index 4029f8b..e68bdb6 100644 --- a/examples/declarative/fonts/fonts.qml +++ b/examples/declarative/fonts/fonts.qml @@ -22,21 +22,21 @@ Rectangle { Text { text: myText color: palette.windowText - width: parent.width; elide: "ElideRight" + width: parent.width; elide: Text.ElideRight font.family: "Times" font.pointSize: 32 } Text { text: myText color: palette.windowText - width: parent.width; elide: "ElideRight" + width: parent.width; elide: Text.ElideRight font.family: fixedFont.name font.pointSize: 32 } Text { text: myText color: palette.windowText - width: parent.width; elide: "ElideRight" + width: parent.width; elide: Text.ElideRight font.family: localFont.name font.pointSize: 32 } @@ -47,7 +47,7 @@ Rectangle { else if (webFont.status == 3) "Error loading font" } color: palette.windowText - width: parent.width; elide: "ElideRight" + width: parent.width; elide: Text.ElideRight font.family: webFont.name font.pointSize: 32 } @@ -58,7 +58,7 @@ Rectangle { else if (webFont2.status == 3) "Error loading font" } color: palette.windowText - width: parent.width; elide: "ElideRight" + width: parent.width; elide: Text.ElideRight font.family: webFont2.name font.pointSize: 32 } diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml index 9e54758..f2cbd3d 100644 --- a/examples/declarative/loader/Browser.qml +++ b/examples/declarative/loader/Browser.qml @@ -81,7 +81,7 @@ Rectangle { } Text { id: nameText - anchors.fill: parent; verticalAlignment: "AlignVCenter" + anchors.fill: parent; verticalAlignment: Text.AlignVCenter text: fileName; anchors.leftMargin: 48 font.pixelSize: 32 color: wrapper.isCurrentItem ? palette.highlightedText : palette.text @@ -225,7 +225,7 @@ Rectangle { anchors.left: upButton.right; anchors.right: parent.right; height: parent.height anchors.leftMargin: 4; anchors.rightMargin: 4 text: folders.folder; color: "white" - elide: "ElideLeft"; horizontalAlignment: "AlignRight"; verticalAlignment: "AlignVCenter" + elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter font.pixelSize: 32 } } diff --git a/examples/declarative/snow/ImageBatch.qml b/examples/declarative/snow/ImageBatch.qml index dfe2a46..95b9b97 100644 --- a/examples/declarative/snow/ImageBatch.qml +++ b/examples/declarative/snow/ImageBatch.qml @@ -41,7 +41,7 @@ GridView { transformOrigin: Item.Center width: grid.imageWidth; height: grid.imageHeight; - Image { id: flickrImage; source: url; fillMode: "PreserveAspectFit"; smooth: true; anchors.fill: parent; + Image { id: flickrImage; source: url; fillMode: Image.PreserveAspectFit; smooth: true; anchors.fill: parent; opacity: (status == Image.Ready)?1:0; opacity: Behavior { NumberAnimation { properties: "opacity" } } } Loading { anchors.centerIn: parent; visible: flickrImage.status!=1 } diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml index 8b32cae..b5546d0 100644 --- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml @@ -13,7 +13,7 @@ Rectangle { Image { id: background anchors.fill: parent; source: "pics/background.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop } } diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml index 63431b1..257e0de 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml @@ -15,7 +15,7 @@ Rectangle { Image { id: background anchors.fill: parent; source: "pics/background.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop } } diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml index 5b98f48..0a7ec0f 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml @@ -14,7 +14,7 @@ Rectangle { Image { id: background anchors.fill: parent; source: "pics/background.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop } //![1] diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index ede4362..e519912 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -15,7 +15,7 @@ Rectangle { Image { id: background anchors.fill: parent; source: "content/pics/background.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop } Item { diff --git a/examples/declarative/webview/content/FieldText.qml b/examples/declarative/webview/content/FieldText.qml index 2adfbbf..b1c1938 100644 --- a/examples/declarative/webview/content/FieldText.qml +++ b/examples/declarative/webview/content/FieldText.qml @@ -79,7 +79,7 @@ Item { x: 5 width: parent.width-10 anchors.verticalCenter: parent.verticalCenter - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter color: fieldText.state == "editing" ? "#505050" : "#AAAAAA" font.italic: true font.bold: true -- cgit v0.12 From e7dbe2d99da7ed29246ac27e11db92980b5aa986 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 15:30:47 +1000 Subject: "Compile" --- demos/declarative/minehunt/minehunt.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index 72431af..67d2813 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -96,7 +96,7 @@ Item { properties: "angle" } ScriptAction{ - script: "if(modelData.hasMine && modelData.flipped){expl.explode = true;}" + script: if(modelData.hasMine && modelData.flipped){expl.explode = true;} } } } -- cgit v0.12 From f79e9b1f959d44f7efd0186d7f99612480d1bec9 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 15:36:56 +1000 Subject: Use a nicer face image --- examples/declarative/aspectratio/face_fit.qml | 1 + .../declarative/aspectratio/face_fit_animated.qml | 1 + examples/declarative/aspectratio/pics/face.png | Bin 905 -> 15408 bytes examples/declarative/aspectratio/scale_and_crop.qml | 1 + .../declarative/aspectratio/scale_and_crop_simple.qml | 1 + .../declarative/aspectratio/scale_and_sidecrop.qml | 1 + examples/declarative/aspectratio/scale_to_fit.qml | 1 + .../declarative/aspectratio/scale_to_fit_simple.qml | 1 + 8 files changed, 7 insertions(+) diff --git a/examples/declarative/aspectratio/face_fit.qml b/examples/declarative/aspectratio/face_fit.qml index 3d1451c..482d1b7 100644 --- a/examples/declarative/aspectratio/face_fit.qml +++ b/examples/declarative/aspectratio/face_fit.qml @@ -15,6 +15,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/face_fit_animated.qml b/examples/declarative/aspectratio/face_fit_animated.qml index f004a6c..80a762b 100644 --- a/examples/declarative/aspectratio/face_fit_animated.qml +++ b/examples/declarative/aspectratio/face_fit_animated.qml @@ -13,6 +13,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/pics/face.png b/examples/declarative/aspectratio/pics/face.png index 9623b1a..3d66d72 100644 Binary files a/examples/declarative/aspectratio/pics/face.png and b/examples/declarative/aspectratio/pics/face.png differ diff --git a/examples/declarative/aspectratio/scale_and_crop.qml b/examples/declarative/aspectratio/scale_and_crop.qml index 2c9477e..283e24b 100644 --- a/examples/declarative/aspectratio/scale_and_crop.qml +++ b/examples/declarative/aspectratio/scale_and_crop.qml @@ -11,6 +11,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_and_crop_simple.qml b/examples/declarative/aspectratio/scale_and_crop_simple.qml index 434e98e..e720ce7 100644 --- a/examples/declarative/aspectratio/scale_and_crop_simple.qml +++ b/examples/declarative/aspectratio/scale_and_crop_simple.qml @@ -12,6 +12,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" fillMode: Image.PreserveAspectCrop anchors.fill: parent diff --git a/examples/declarative/aspectratio/scale_and_sidecrop.qml b/examples/declarative/aspectratio/scale_and_sidecrop.qml index 67c7e29..c3ef859 100644 --- a/examples/declarative/aspectratio/scale_and_sidecrop.qml +++ b/examples/declarative/aspectratio/scale_and_sidecrop.qml @@ -12,6 +12,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_to_fit.qml b/examples/declarative/aspectratio/scale_to_fit.qml index c4efc29..961ac04 100644 --- a/examples/declarative/aspectratio/scale_to_fit.qml +++ b/examples/declarative/aspectratio/scale_to_fit.qml @@ -12,6 +12,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" x: (parent.width-width*scale)/2 y: (parent.height-height*scale)/2 diff --git a/examples/declarative/aspectratio/scale_to_fit_simple.qml b/examples/declarative/aspectratio/scale_to_fit_simple.qml index 83909ef..7389581 100644 --- a/examples/declarative/aspectratio/scale_to_fit_simple.qml +++ b/examples/declarative/aspectratio/scale_to_fit_simple.qml @@ -12,6 +12,7 @@ Rectangle { Image { id: face + smooth: true source: "pics/face.png" fillMode: Image.PreserveAspectFit anchors.fill: parent -- cgit v0.12 From 37314eb9ff900780b8bb952c8fa87f278a634f3a Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 15:39:04 +1000 Subject: Auto-select first tree item after reload. --- tools/qmldebugger/standalone/objecttree.cpp | 1 + tools/qmldebugger/standalone/objecttree.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/qmldebugger/standalone/objecttree.cpp b/tools/qmldebugger/standalone/objecttree.cpp index 4059e77..6c132b6 100644 --- a/tools/qmldebugger/standalone/objecttree.cpp +++ b/tools/qmldebugger/standalone/objecttree.cpp @@ -61,6 +61,7 @@ void ObjectTree::objectFetched() { dump(m_query->object(), 0); buildTree(m_query->object(), 0); + setCurrentItem(topLevelItem(0)); delete m_query; m_query = 0; diff --git a/tools/qmldebugger/standalone/objecttree.h b/tools/qmldebugger/standalone/objecttree.h index 95820f3..ba2e78f 100644 --- a/tools/qmldebugger/standalone/objecttree.h +++ b/tools/qmldebugger/standalone/objecttree.h @@ -27,8 +27,8 @@ signals: void expressionWatchRequested(const QmlDebugObjectReference &, const QString &); public slots: - void reload(int objectDebugId); - void setCurrentObject(int debugId); + void reload(int objectDebugId); // set the root object + void setCurrentObject(int debugId); // select an object in the tree protected: virtual void mousePressEvent(QMouseEvent *); -- cgit v0.12 From 3e6732dd364b139485888df053a23f40a4bdee79 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 15:42:38 +1000 Subject: Ensure all tests appear in pro file --- tests/auto/declarative/declarative.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index b51e285..5d355f6 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -1,7 +1,10 @@ TEMPLATE = subdirs SUBDIRS += anchors \ + animatedimage \ animations \ + behaviors \ datetimeformatter \ + examples \ layouts \ listview \ numberformatter \ -- cgit v0.12 From e78a0d8f7449b81c971284310e6fb255d4a9d4eb Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 15:43:48 +1000 Subject: Whoops --- tests/auto/declarative/declarative.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 5d355f6..8b1c9cd 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -9,7 +9,6 @@ SUBDIRS += anchors \ listview \ numberformatter \ pathview \ - qbindablemap \ qfxloader \ qfxpixmapcache \ qfxtext \ -- cgit v0.12 From dbba440da0677b8174d087d498d3d0dbd465548a Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 28 Oct 2009 15:44:26 +1000 Subject: Fix dynamic example Includes adding a comment to the positioners to alert others that you shouldn't use anchors as well. --- examples/declarative/dynamic/dynamic.qml | 2 -- src/declarative/fx/qfxpositioners.cpp | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index e083a5b..885e037 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -68,14 +68,12 @@ Item { Text{ text: "Drag an item into the scene." } Row{ id: toolRow spacing: 8; - height: childrenRect.height//TODO: Put bug in JIRA when it comes back up PaletteItem{ anchors.verticalCenter: parent.verticalCenter file: "Sun.qml"; image: "images/sun.png" } PaletteItem{ - anchors.verticalCenter: parent.verticalCenter file: "GenericItem.qml" image: "images/moon.png" } diff --git a/src/declarative/fx/qfxpositioners.cpp b/src/declarative/fx/qfxpositioners.cpp index cc385e0..86a069d 100644 --- a/src/declarative/fx/qfxpositioners.cpp +++ b/src/declarative/fx/qfxpositioners.cpp @@ -375,6 +375,10 @@ Column { \endqml \endtable + Note that the positioner assumes that the x and y positions of its children + will not change. If you manually change the x or y properties in script, bind + the x or y properties, or use anchors on a child of a positioner, then the + positioner may exhibit strange behaviour. */ /*! @@ -539,6 +543,11 @@ Row { \endqml \image horizontalpositioner_example.png + Note that the positioner assumes that the x and y positions of its children + will not change. If you manually change the x or y properties in script, bind + the x or y properties, or use anchors on a child of a positioner, then the + positioner may exhibit strange behaviour. + */ /*! \qmlproperty Transition Row::remove @@ -659,7 +668,7 @@ void QFxRow::doPositioning() child->setX(hoffset); setMovingItem(0); } - if(!child->width() || !child->height()){//don't advance for invisible children + if(child->width() && child->height()){//don't advance for invisible children hoffset += child->width(); hoffset += spacing(); } @@ -707,6 +716,11 @@ Grid { } \endqml \endtable + + Note that the positioner assumes that the x and y positions of its children + will not change. If you manually change the x or y properties in script, bind + the x or y properties, or use anchors on a child of a positioner, then the + positioner may exhibit strange behaviour. */ /*! \qmlproperty Transition Grid::remove -- cgit v0.12 From 25f87fede4b5fd367242be80f314310e7be6e0a5 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 15:50:11 +1000 Subject: Show contents of list properties within the debugger (like the Creator debugger). Also add Mode arg to ExpressionQueryWidget constructor. --- src/declarative/debugger/qmldebug.cpp | 5 +- src/declarative/qml/qmlenginedebug.cpp | 67 +++++++++---------- src/declarative/qml/qmlenginedebug_p.h | 4 +- src/declarative/qml/qmlwatcher.cpp | 2 +- src/declarative/qml/qmlwatcher_p.h | 3 +- tools/qmldebugger/standalone/engine.cpp | 2 +- .../standalone/expressionquerywidget.cpp | 34 ++++++---- .../qmldebugger/standalone/expressionquerywidget.h | 10 +-- .../standalone/objectpropertiesview.cpp | 76 ++++++++++++++++------ .../qmldebugger/standalone/objectpropertiesview.h | 2 + 10 files changed, 129 insertions(+), 76 deletions(-) diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 6e541a9..5a8cda0 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -122,9 +122,10 @@ void QmlEngineDebugPrivate::decode(QDataStream &ds, QmlDebugObjectReference &o, prop.m_binding = data.binding; prop.m_hasNotifySignal = data.hasNotifySignal; prop.m_valueTypeName = data.valueTypeName; - if (data.type == QmlEngineDebugServer::QmlObjectProperty::Basic) + if (data.type == QmlEngineDebugServer::QmlObjectProperty::Basic + || data.type == QmlEngineDebugServer::QmlObjectProperty::List) { prop.m_value = data.value; - else if (data.type == QmlEngineDebugServer::QmlObjectProperty::Object) { + } else if (data.type == QmlEngineDebugServer::QmlObjectProperty::Object) { QmlDebugObjectReference obj; obj.m_debugId = prop.m_value.toInt(); prop.m_value = qVariantFromValue(obj); diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 664ca3f..63be6b0 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -57,8 +57,8 @@ QmlEngineDebugServer::QmlEngineDebugServer(QObject *parent) : QmlDebugService(QLatin1String("QmlEngine"), parent), m_watch(new QmlWatcher(this)) { - QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QByteArray,QVariant)), - this, SLOT(propertyChanged(int,int,QByteArray,QVariant))); + QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)), + this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant))); } QDataStream &operator<<(QDataStream &ds, @@ -110,9 +110,11 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) if (binding) rv.binding = binding->expression(); + QVariant value = prop.read(obj); + rv.value = valueContents(value); + if (prop.type() < QVariant::UserType) { rv.type = QmlObjectProperty::Basic; - rv.value = prop.read(obj); } else if (QmlMetaType::isObject(prop.userType())) { rv.type = QmlObjectProperty::Object; } else if (QmlMetaType::isList(prop.userType()) || @@ -123,6 +125,32 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) return rv; } +QVariant QmlEngineDebugServer::valueContents(const QVariant &value) const +{ + if (value.type() < QVariant::UserType) + return value; + + int userType = value.userType(); + + if (QmlMetaType::isList(userType) || QmlMetaType::isQmlList(userType)) { + int count = QmlMetaType::listCount(value); + QVariantList contents; + for (int i=0; iobjectName(); + if (name.isEmpty()) + name = QLatin1String(""); + return name; + } + } + + return QLatin1String(""); +} + void QmlEngineDebugServer::buildObjectDump(QDataStream &message, QObject *object, bool recur) { @@ -188,32 +216,6 @@ void QmlEngineDebugServer::buildObjectList(QDataStream &message, } } -QVariant QmlEngineDebugServer::serializableVariant(const QVariant &value) -{ - if (value.type() < QVariant::UserType) - return value; - - if (!value.toString().isEmpty()) - return value.toString(); - - QVariant v; - if (value.type() == QVariant::UserType || QmlMetaType::isObject(value.userType())) { - QObject *o = QmlMetaType::toQObject(value); - if (o) { - QString objectName = o->objectName(); - if (objectName.isEmpty()) - objectName = QLatin1String(""); - v = QString::fromUtf8(o->metaObject()->className()) + - QLatin1String(": ") + objectName; - } - } - - if (v.isNull()) - v = QString::fromUtf8(value.typeName()); - - return v; -} - QmlEngineDebugServer::QmlObjectData QmlEngineDebugServer::objectData(QObject *object) { @@ -357,7 +359,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) if (undefined) result = QLatin1String(""); else - result = serializableVariant(value); + result = valueContents(value); delete exprObj; } else { result = QLatin1String(""); @@ -371,13 +373,12 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) } } -void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value) +void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) { QByteArray reply; - QVariant v = serializableVariant(value); QDataStream rs(&reply, QIODevice::WriteOnly); - rs << QByteArray("UPDATE_WATCH") << id << objectId << property << v; + rs << QByteArray("UPDATE_WATCH") << id << objectId << QString::fromUtf8(property.name()) << valueContents(value); sendMessage(reply); } diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qmlenginedebug_p.h index 075a711..a8572eb 100644 --- a/src/declarative/qml/qmlenginedebug_p.h +++ b/src/declarative/qml/qmlenginedebug_p.h @@ -97,14 +97,14 @@ protected: virtual void messageReceived(const QByteArray &); private Q_SLOTS: - void propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value); + void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value); private: void buildObjectList(QDataStream &, QmlContext *); void buildObjectDump(QDataStream &, QObject *, bool); QmlObjectData objectData(QObject *); QmlObjectProperty propertyData(QObject *, int); - QVariant serializableVariant(const QVariant &value); + QVariant valueContents(const QVariant &defaultValue) const; static QList m_engines; QmlWatcher *m_watch; diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qmlwatcher.cpp index ca99472..8cd51e0 100644 --- a/src/declarative/qml/qmlwatcher.cpp +++ b/src/declarative/qml/qmlwatcher.cpp @@ -112,7 +112,7 @@ void QmlWatchProxy::notifyValueChanged() else v = m_property.read(m_object); - emit m_watch->propertyChanged(m_id, m_debugId, QByteArray(m_property.name()), v); + emit m_watch->propertyChanged(m_id, m_debugId, m_property, v); } diff --git a/src/declarative/qml/qmlwatcher_p.h b/src/declarative/qml/qmlwatcher_p.h index 99cae88..0bfcd71 100644 --- a/src/declarative/qml/qmlwatcher_p.h +++ b/src/declarative/qml/qmlwatcher_p.h @@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE class QmlWatchProxy; class QmlExpression; class QmlContext; +class QMetaProperty; class QmlWatcher : public QObject { @@ -79,7 +80,7 @@ public: void removeWatch(int id); Q_SIGNALS: - void propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value); + void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value); private: friend class QmlWatchProxy; diff --git a/tools/qmldebugger/standalone/engine.cpp b/tools/qmldebugger/standalone/engine.cpp index a1fd009..f1eada8 100644 --- a/tools/qmldebugger/standalone/engine.cpp +++ b/tools/qmldebugger/standalone/engine.cpp @@ -86,7 +86,7 @@ EnginePane::EnginePane(QmlDebugConnection *conn, QWidget *parent) connect(m_watchTableView, SIGNAL(objectActivated(int)), m_objTree, SLOT(setCurrentObject(int))); - m_exprQueryWidget = new ExpressionQueryWidget(m_client); + m_exprQueryWidget = new ExpressionQueryWidget(ExpressionQueryWidget::SeparateEntryMode, m_client); connect(m_objTree, SIGNAL(currentObjectChanged(QmlDebugObjectReference)), m_exprQueryWidget, SLOT(setCurrentObject(QmlDebugObjectReference))); diff --git a/tools/qmldebugger/standalone/expressionquerywidget.cpp b/tools/qmldebugger/standalone/expressionquerywidget.cpp index f8f5aef..3c4296d 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.cpp +++ b/tools/qmldebugger/standalone/expressionquerywidget.cpp @@ -11,9 +11,9 @@ #include "expressionquerywidget.h" -ExpressionQueryWidget::ExpressionQueryWidget(QmlEngineDebug *client, QWidget *parent) +ExpressionQueryWidget::ExpressionQueryWidget(Mode mode, QmlEngineDebug *client, QWidget *parent) : QWidget(parent), - m_style(Compact), + m_mode(mode), m_client(client), m_query(0), m_textEdit(new QTextEdit), @@ -28,7 +28,7 @@ ExpressionQueryWidget::ExpressionQueryWidget(QmlEngineDebug *client, QWidget *pa updateTitle(); - if (m_style == Compact) { + if (m_mode == SeparateEntryMode) { m_lineEdit = new QLineEdit; connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(executeExpression())); QHBoxLayout *hbox = new QHBoxLayout; @@ -53,7 +53,8 @@ void ExpressionQueryWidget::setEngineDebug(QmlEngineDebug *client) void ExpressionQueryWidget::clear() { m_textEdit->clear(); - m_lineEdit->clear(); + if (m_lineEdit) + m_lineEdit->clear(); } void ExpressionQueryWidget::updateTitle() @@ -73,7 +74,7 @@ void ExpressionQueryWidget::appendPrompt() { m_textEdit->moveCursor(QTextCursor::End); - if (m_style == Compact) { + if (m_mode == SeparateEntryMode) { m_textEdit->insertPlainText("\n"); } else { m_textEdit->setTextColor(Qt::gray); @@ -111,7 +112,7 @@ void ExpressionQueryWidget::executeExpression() if (!m_client) return; - if (m_style == Compact) + if (m_mode == SeparateEntryMode) m_expr = m_lineEdit->text().trimmed(); else m_expr = m_expr.trimmed(); @@ -136,20 +137,31 @@ void ExpressionQueryWidget::showResult() { if (m_query) { m_textEdit->moveCursor(QTextCursor::End); + QVariant value = m_query->result(); QString result; - if (m_query->result().isNull()) + + if (value.isNull()) { result = QLatin1String(""); - else - result = m_query->result().toString(); + } else { + if (value.canConvert(QVariant::String)) { + result = value.toString(); + } else { + QDebug debug(&result); + debug << value; + } + } - if (m_style == Compact) { + if (m_mode == SeparateEntryMode) { m_textEdit->setTextColor(Qt::black); m_textEdit->setFontWeight(QFont::Bold); m_textEdit->insertPlainText(m_expr + " : "); m_textEdit->setFontWeight(QFont::Normal); m_textEdit->insertPlainText(result); } else { - m_textEdit->append(result); + m_textEdit->setTextColor(Qt::darkGreen); + m_textEdit->insertPlainText(" => "); + m_textEdit->setTextColor(Qt::black); + m_textEdit->insertPlainText(result); } appendPrompt(); m_expr.clear(); diff --git a/tools/qmldebugger/standalone/expressionquerywidget.h b/tools/qmldebugger/standalone/expressionquerywidget.h index 6fab059..3fe0295 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.h +++ b/tools/qmldebugger/standalone/expressionquerywidget.h @@ -16,12 +16,12 @@ class ExpressionQueryWidget : public QWidget { Q_OBJECT public: - enum Style { - Compact, - Shell + enum Mode { + SeparateEntryMode, + ShellMode }; - ExpressionQueryWidget(QmlEngineDebug *client = 0, QWidget *parent = 0); + ExpressionQueryWidget(Mode mode = SeparateEntryMode, QmlEngineDebug *client = 0, QWidget *parent = 0); void setEngineDebug(QmlEngineDebug *client); void clear(); @@ -42,7 +42,7 @@ private: void showCurrentContext(); void updateTitle(); - Style m_style; + Mode m_mode; QmlEngineDebug *m_client; QmlDebugExpressionQuery *m_query; diff --git a/tools/qmldebugger/standalone/objectpropertiesview.cpp b/tools/qmldebugger/standalone/objectpropertiesview.cpp index f86a69e..d6fefa0 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.cpp +++ b/tools/qmldebugger/standalone/objectpropertiesview.cpp @@ -16,19 +16,25 @@ class PropertiesViewItem : public QObject, public QTreeWidgetItem { Q_OBJECT public: - PropertiesViewItem(QTreeWidget *widget); - PropertiesViewItem(QTreeWidgetItem *parent); + enum Type { + BindingType, + OtherType + }; + + PropertiesViewItem(QTreeWidget *widget, Type type = OtherType); + PropertiesViewItem(QTreeWidgetItem *parent, Type type = OtherType); QmlDebugPropertyReference property; + Type type; }; -PropertiesViewItem::PropertiesViewItem(QTreeWidget *widget) - : QTreeWidgetItem(widget) +PropertiesViewItem::PropertiesViewItem(QTreeWidget *widget, Type type) + : QTreeWidgetItem(widget), type(type) { } -PropertiesViewItem::PropertiesViewItem(QTreeWidgetItem *parent) - : QTreeWidgetItem(parent) +PropertiesViewItem::PropertiesViewItem(QTreeWidgetItem *parent, Type type) + : QTreeWidgetItem(parent), type(type) { } @@ -109,6 +115,42 @@ void ObjectPropertiesView::queryFinished() setObject(obj); } +void ObjectPropertiesView::setPropertyValue(PropertiesViewItem *item, const QVariant &value, bool makeGray) +{ + if (value.type() == QVariant::List || value.type() == QVariant::StringList) { + PropertiesViewItem *bindingItem = static_cast(item->takeChild(item->childCount() - 1)); + if (bindingItem && bindingItem->type != PropertiesViewItem::BindingType) { + delete bindingItem; + bindingItem = 0; + } + + qDeleteAll(item->takeChildren()); + + QVariantList variants = value.toList(); + item->setText(1, tr("<%1 items>", "%1 = number of items").arg(variants.count())); + item->setText(2, QString::fromUtf8(value.typeName())); + + PropertiesViewItem *child; + for (int i=0; iaddChild(bindingItem); + + item->setExpanded(false); + } else { + item->setText(1, (value.isNull() ? QLatin1String("") : value.toString())); + item->setExpanded(true); + } + + if (makeGray) { + for (int i=0; icolumnCount(); i++) + item->setForeground(i, Qt::gray); + } +} + void ObjectPropertiesView::setObject(const QmlDebugObjectReference &object) { m_object = object; @@ -123,20 +165,17 @@ void ObjectPropertiesView::setObject(const QmlDebugObjectReference &object) item->setText(0, p.name()); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - if (!p.hasNotifySignal()) { - item->setForeground(0, Qt::gray); - item->setForeground(1, Qt::gray); - } + + setPropertyValue(item, p.value(), !p.hasNotifySignal()); + item->setText(2, p.valueTypeName()); + // binding is set after property value to ensure it is added to the end of the + // list, if the value is a list if (!p.binding().isEmpty()) { - PropertiesViewItem *binding = new PropertiesViewItem(item); + PropertiesViewItem *binding = new PropertiesViewItem(item, PropertiesViewItem::BindingType); binding->setText(1, p.binding()); binding->setForeground(1, Qt::darkGreen); } - - item->setText(2, p.valueTypeName()); - - item->setExpanded(true); } } @@ -177,11 +216,8 @@ void ObjectPropertiesView::valueChanged(const QByteArray &name, const QVariant & for (int i=0; itopLevelItemCount(); i++) { PropertiesViewItem *item = static_cast(m_tree->topLevelItem(i)); if (item->property.name() == name) { - if (value.isNull()) { - item->setText(1, QLatin1String("")); - } else { - item->setText(1, value.toString()); - } + setPropertyValue(item, value, !item->property.hasNotifySignal()); + return; } } } diff --git a/tools/qmldebugger/standalone/objectpropertiesview.h b/tools/qmldebugger/standalone/objectpropertiesview.h index 6a1fc03..306e5b9 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.h +++ b/tools/qmldebugger/standalone/objectpropertiesview.h @@ -10,6 +10,7 @@ QT_BEGIN_NAMESPACE class QTreeWidget; class QTreeWidgetItem; class QmlDebugConnection; +class PropertiesViewItem; class ObjectPropertiesView : public QWidget { @@ -36,6 +37,7 @@ private slots: private: void setObject(const QmlDebugObjectReference &object); void setWatched(const QString &property, bool watched); + void setPropertyValue(PropertiesViewItem *item, const QVariant &value, bool makeGray); QmlEngineDebug *m_client; QmlDebugObjectQuery *m_query; -- cgit v0.12 From f0f2941d6dccd4bd402861c01797bb210c516962 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 15:51:54 +1000 Subject: Must delete query objects once disconnected. --- tools/qmldebugger/creatorplugin/qmlinspectormode.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp index aec661c..a90ca2c 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp @@ -168,10 +168,17 @@ void QmlInspectorMode::connectionStateChanged() switch (m_conn->state()) { default: case QAbstractSocket::UnconnectedState: + { emit statusMessage(tr("[Inspector] disconnected.\n\n")); m_addressEdit->setEnabled(true); m_portSpinBox->setEnabled(true); + + delete m_engineQuery; + m_engineQuery = 0; + delete m_contextQuery; + m_contextQuery = 0; break; + } case QAbstractSocket::HostLookupState: emit statusMessage(tr("[Inspector] resolving host...")); break; @@ -378,7 +385,7 @@ void QmlInspectorMode::initWidgets() m_propertiesWidget = new ObjectPropertiesView; m_watchTableView = new WatchTableView(m_watchTableModel); m_frameRateWidget = new CanvasFrameRate; - m_expressionWidget = new ExpressionQueryWidget; + m_expressionWidget = new ExpressionQueryWidget(ExpressionQueryWidget::SeparateEntryMode); // FancyMainWindow uses widgets' window titles for tab labels m_objectTreeWidget->setWindowTitle(tr("Object Tree")); -- cgit v0.12 From 47af5a1e8ad73de2b18137c0414b794e9fc7001c Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 15:59:19 +1000 Subject: Make more mac friendly --- tests/auto/declarative/anchors/anchors.pro | 1 + tests/auto/declarative/animatedimage/animatedimage.pro | 1 + tests/auto/declarative/animations/animations.pro | 1 + tests/auto/declarative/behaviors/behaviors.pro | 1 + tests/auto/declarative/datetimeformatter/datetimeformatter.pro | 2 ++ tests/auto/declarative/declarative.pro | 1 + tests/auto/declarative/examples/examples.pro | 3 ++- tests/auto/declarative/layouts/layouts.pro | 1 + tests/auto/declarative/listview/listview.pro | 2 ++ tests/auto/declarative/numberformatter/numberformatter.pro | 2 ++ tests/auto/declarative/pathview/pathview.pro | 2 ++ tests/auto/declarative/qfxloader/qfxloader.pro | 2 ++ tests/auto/declarative/qfxpixmapcache/qfxpixmapcache.pro | 4 ++-- tests/auto/declarative/qfxtext/qfxtext.pro | 2 ++ tests/auto/declarative/qfxtextedit/qfxtextedit.pro | 2 ++ tests/auto/declarative/qfxtextinput/qfxtextinput.pro | 2 ++ tests/auto/declarative/qfxwebview/qfxwebview.pro | 2 ++ tests/auto/declarative/qmldom/qmldom.pro | 2 ++ tests/auto/declarative/qmlecmascript/qmlecmascript.pro | 1 + tests/auto/declarative/qmllanguage/qmllanguage.pro | 3 ++- tests/auto/declarative/qmllist/qmllist.pro | 2 ++ tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro | 2 ++ tests/auto/declarative/qmlmetaproperty/qmlmetaproperty.pro | 2 ++ tests/auto/declarative/qmlpropertymap/qmlpropertymap.pro | 2 ++ tests/auto/declarative/qmltimer/qmltimer.pro | 2 ++ tests/auto/declarative/repeater/repeater.pro | 3 ++- tests/auto/declarative/sql/sql.pro | 2 ++ tests/auto/declarative/states/states.pro | 2 ++ tests/auto/declarative/visual/visual.pro | 3 ++- 29 files changed, 51 insertions(+), 6 deletions(-) diff --git a/tests/auto/declarative/anchors/anchors.pro b/tests/auto/declarative/anchors/anchors.pro index 7b22cfb..1e25a90 100644 --- a/tests/auto/declarative/anchors/anchors.pro +++ b/tests/auto/declarative/anchors/anchors.pro @@ -1,5 +1,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative SOURCES += tst_anchors.cpp +macx:CONFIG -= app_bundle DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/animatedimage/animatedimage.pro b/tests/auto/declarative/animatedimage/animatedimage.pro index 8a92863..4ff9db4 100644 --- a/tests/auto/declarative/animatedimage/animatedimage.pro +++ b/tests/auto/declarative/animatedimage/animatedimage.pro @@ -1,5 +1,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative SOURCES += tst_animatedimage.cpp +macx:CONFIG -= app_bundle DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/animations/animations.pro b/tests/auto/declarative/animations/animations.pro index 419da4e..e13ecb9 100644 --- a/tests/auto/declarative/animations/animations.pro +++ b/tests/auto/declarative/animations/animations.pro @@ -1,5 +1,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative SOURCES += tst_animations.cpp +macx:CONFIG -= app_bundle DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/behaviors/behaviors.pro b/tests/auto/declarative/behaviors/behaviors.pro index c96d2c0..8886b0c 100644 --- a/tests/auto/declarative/behaviors/behaviors.pro +++ b/tests/auto/declarative/behaviors/behaviors.pro @@ -1,5 +1,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative SOURCES += tst_behaviors.cpp +macx:CONFIG -= app_bundle DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/datetimeformatter/datetimeformatter.pro b/tests/auto/declarative/datetimeformatter/datetimeformatter.pro index e3d6cd0..62eb303 100644 --- a/tests/auto/declarative/datetimeformatter/datetimeformatter.pro +++ b/tests/auto/declarative/datetimeformatter/datetimeformatter.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_datetimeformatter.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 8b1c9cd..b9ab3ca 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -21,6 +21,7 @@ SUBDIRS += anchors \ qmllist \ qmllistaccessor \ qmlmetaproperty \ + qmlpropertymap \ qmltimer \ repeater \ sql \ diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro index c50018e..b9bcd28 100644 --- a/tests/auto/declarative/examples/examples.pro +++ b/tests/auto/declarative/examples/examples.pro @@ -1,4 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_examples.cpp macx:CONFIG -= app_bundle + +SOURCES += tst_examples.cpp diff --git a/tests/auto/declarative/layouts/layouts.pro b/tests/auto/declarative/layouts/layouts.pro index f7e7622..f38e155 100644 --- a/tests/auto/declarative/layouts/layouts.pro +++ b/tests/auto/declarative/layouts/layouts.pro @@ -1,6 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative SOURCES += tst_layouts.cpp +macx:CONFIG -= app_bundle # Define SRCDIR equal to test's source directory DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/listview/listview.pro b/tests/auto/declarative/listview/listview.pro index bf68268..23b0706 100644 --- a/tests/auto/declarative/listview/listview.pro +++ b/tests/auto/declarative/listview/listview.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_listview.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/numberformatter/numberformatter.pro b/tests/auto/declarative/numberformatter/numberformatter.pro index ba391ed..ed7ef22 100644 --- a/tests/auto/declarative/numberformatter/numberformatter.pro +++ b/tests/auto/declarative/numberformatter/numberformatter.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_numberformatter.cpp diff --git a/tests/auto/declarative/pathview/pathview.pro b/tests/auto/declarative/pathview/pathview.pro index 28bbe49..bddd1e6 100644 --- a/tests/auto/declarative/pathview/pathview.pro +++ b/tests/auto/declarative/pathview/pathview.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_pathview.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/qfxloader/qfxloader.pro b/tests/auto/declarative/qfxloader/qfxloader.pro index 643c18c..aee52cc 100644 --- a/tests/auto/declarative/qfxloader/qfxloader.pro +++ b/tests/auto/declarative/qfxloader/qfxloader.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + SOURCES += tst_qfxloader.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxpixmapcache/qfxpixmapcache.pro b/tests/auto/declarative/qfxpixmapcache/qfxpixmapcache.pro index e9b0417..218eeff 100644 --- a/tests/auto/declarative/qfxpixmapcache/qfxpixmapcache.pro +++ b/tests/auto/declarative/qfxpixmapcache/qfxpixmapcache.pro @@ -1,9 +1,9 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative QT += network -SOURCES += tst_qfxpixmapcache.cpp -HEADERS = macx:CONFIG -= app_bundle +SOURCES += tst_qfxpixmapcache.cpp + # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage # LIBS += -lgcov diff --git a/tests/auto/declarative/qfxtext/qfxtext.pro b/tests/auto/declarative/qfxtext/qfxtext.pro index f705334..1f3fe37 100644 --- a/tests/auto/declarative/qfxtext/qfxtext.pro +++ b/tests/auto/declarative/qfxtext/qfxtext.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + SOURCES += tst_qfxtext.cpp diff --git a/tests/auto/declarative/qfxtextedit/qfxtextedit.pro b/tests/auto/declarative/qfxtextedit/qfxtextedit.pro index 90546a4..b5e0464 100644 --- a/tests/auto/declarative/qfxtextedit/qfxtextedit.pro +++ b/tests/auto/declarative/qfxtextedit/qfxtextedit.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + SOURCES += tst_qfxtextedit.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/qfxtextinput/qfxtextinput.pro b/tests/auto/declarative/qfxtextinput/qfxtextinput.pro index 396e66d..fe2e3e3 100644 --- a/tests/auto/declarative/qfxtextinput/qfxtextinput.pro +++ b/tests/auto/declarative/qfxtextinput/qfxtextinput.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + SOURCES += tst_qfxtextinput.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/qfxwebview/qfxwebview.pro b/tests/auto/declarative/qfxwebview/qfxwebview.pro index ee78950..b75e057 100644 --- a/tests/auto/declarative/qfxwebview/qfxwebview.pro +++ b/tests/auto/declarative/qfxwebview/qfxwebview.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qfxwebview.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/qmldom/qmldom.pro b/tests/auto/declarative/qmldom/qmldom.pro index d566354..7ff317d 100644 --- a/tests/auto/declarative/qmldom/qmldom.pro +++ b/tests/auto/declarative/qmldom/qmldom.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qmldom.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlecmascript/qmlecmascript.pro b/tests/auto/declarative/qmlecmascript/qmlecmascript.pro index ff4d20f..46ae045 100644 --- a/tests/auto/declarative/qmlecmascript/qmlecmascript.pro +++ b/tests/auto/declarative/qmlecmascript/qmlecmascript.pro @@ -1,6 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative macx:CONFIG -= app_bundle + SOURCES += tst_qmlecmascript.cpp \ testtypes.cpp HEADERS += testtypes.h diff --git a/tests/auto/declarative/qmllanguage/qmllanguage.pro b/tests/auto/declarative/qmllanguage/qmllanguage.pro index 4e4be9c..80228a9 100644 --- a/tests/auto/declarative/qmllanguage/qmllanguage.pro +++ b/tests/auto/declarative/qmllanguage/qmllanguage.pro @@ -1,9 +1,10 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qmllanguage.cpp \ testtypes.cpp HEADERS += testtypes.h -macx:CONFIG -= app_bundle # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage # LIBS += -lgcov diff --git a/tests/auto/declarative/qmllist/qmllist.pro b/tests/auto/declarative/qmllist/qmllist.pro index e5558f1..b2145ed 100644 --- a/tests/auto/declarative/qmllist/qmllist.pro +++ b/tests/auto/declarative/qmllist/qmllist.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qmllist.cpp diff --git a/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro b/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro index 4aa0450..ce2915e 100644 --- a/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro +++ b/tests/auto/declarative/qmllistaccessor/qmllistaccessor.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qmllistaccessor.cpp diff --git a/tests/auto/declarative/qmlmetaproperty/qmlmetaproperty.pro b/tests/auto/declarative/qmlmetaproperty/qmlmetaproperty.pro index af67373..542c14e 100644 --- a/tests/auto/declarative/qmlmetaproperty/qmlmetaproperty.pro +++ b/tests/auto/declarative/qmlmetaproperty/qmlmetaproperty.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qmlmetaproperty.cpp diff --git a/tests/auto/declarative/qmlpropertymap/qmlpropertymap.pro b/tests/auto/declarative/qmlpropertymap/qmlpropertymap.pro index 94f138f..967ab76 100644 --- a/tests/auto/declarative/qmlpropertymap/qmlpropertymap.pro +++ b/tests/auto/declarative/qmlpropertymap/qmlpropertymap.pro @@ -1,3 +1,5 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_qmlpropertymap.cpp diff --git a/tests/auto/declarative/qmltimer/qmltimer.pro b/tests/auto/declarative/qmltimer/qmltimer.pro index e7edd96..2b244ed 100644 --- a/tests/auto/declarative/qmltimer/qmltimer.pro +++ b/tests/auto/declarative/qmltimer/qmltimer.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + SOURCES += tst_qmltimer.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/repeater/repeater.pro b/tests/auto/declarative/repeater/repeater.pro index 1d30b7b..968904b 100644 --- a/tests/auto/declarative/repeater/repeater.pro +++ b/tests/auto/declarative/repeater/repeater.pro @@ -1,7 +1,8 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_repeater.cpp macx:CONFIG -= app_bundle +SOURCES += tst_repeater.cpp + # Define SRCDIR equal to test's source directory DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/sql/sql.pro b/tests/auto/declarative/sql/sql.pro index 36a867f..48e06a2 100644 --- a/tests/auto/declarative/sql/sql.pro +++ b/tests/auto/declarative/sql/sql.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_sql.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/states/states.pro b/tests/auto/declarative/states/states.pro index 0474ea5..a1f3b02 100644 --- a/tests/auto/declarative/states/states.pro +++ b/tests/auto/declarative/states/states.pro @@ -1,5 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + SOURCES += tst_states.cpp # Define SRCDIR equal to test's source directory diff --git a/tests/auto/declarative/visual/visual.pro b/tests/auto/declarative/visual/visual.pro index a06fa21..7ae2bed 100644 --- a/tests/auto/declarative/visual/visual.pro +++ b/tests/auto/declarative/visual/visual.pro @@ -1,6 +1,7 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative -SOURCES += tst_visual.cpp macx:CONFIG -= app_bundle +SOURCES += tst_visual.cpp + DEFINES += QT_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\" -- cgit v0.12 From 06ea501e617ec04b786906ca1bc15db452d03d0a Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 28 Oct 2009 16:05:29 +1000 Subject: cleanup --- demos/declarative/contacts/FieldText.qml | 2 +- demos/declarative/contacts/RemoveButton.qml | 2 +- demos/declarative/flickr/common/ImageDetails.qml | 4 ++-- demos/declarative/flickr/flickr-desktop.qml | 2 +- demos/declarative/flickr/flickr-mobile.qml | 2 +- demos/declarative/flickr/mobile/Button.qml | 2 +- demos/declarative/flickr/mobile/ImageDetails.qml | 14 +++++++------- demos/declarative/flickr/mobile/ListDelegate.qml | 6 +++--- demos/declarative/flickr/mobile/TitleBar.qml | 4 ++-- demos/declarative/minehunt/minehunt.qml | 2 +- demos/declarative/samegame/samegame.qml | 2 +- demos/declarative/twitter/content/AuthView.qml | 4 ++-- demos/declarative/twitter/content/FatDelegate.qml | 2 +- demos/declarative/twitter/content/HomeTitleBar.qml | 6 +++--- demos/declarative/twitter/twitter.qml | 4 ++-- demos/declarative/webbrowser/fieldtext/FieldText.qml | 2 +- demos/declarative/webbrowser/webbrowser.qml | 6 +++--- src/declarative/fx/qfximage.cpp | 8 ++++---- src/declarative/fx/qfxmouseregion.cpp | 4 ++-- src/declarative/fx/qfxtext.cpp | 6 +++--- 20 files changed, 42 insertions(+), 42 deletions(-) diff --git a/demos/declarative/contacts/FieldText.qml b/demos/declarative/contacts/FieldText.qml index 2e8b60d..1e89793 100644 --- a/demos/declarative/contacts/FieldText.qml +++ b/demos/declarative/contacts/FieldText.qml @@ -69,7 +69,7 @@ Rectangle { x: 5 width: parent.width-10 anchors.verticalCenter: parent.verticalCenter - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter color: contactDetails.state == "editing" ? "#505050" : "#AAAAAA" font.italic: true font.bold: true diff --git a/demos/declarative/contacts/RemoveButton.qml b/demos/declarative/contacts/RemoveButton.qml index 2c3cc9e..0cb013e 100644 --- a/demos/declarative/contacts/RemoveButton.qml +++ b/demos/declarative/contacts/RemoveButton.qml @@ -73,7 +73,7 @@ Rectangle { anchors.rightMargin: 4 font.bold: true color: "white" - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter text: "Remove" opacity: 0 } diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml index cc00773..19cad06 100644 --- a/demos/declarative/flickr/common/ImageDetails.qml +++ b/demos/declarative/flickr/common/ImageDetails.qml @@ -44,7 +44,7 @@ Flipable { onClicked: { container.state='Back' } } - Text { id: titleText; style: "Raised"; styleColor: "black"; color: "white"; elide: "ElideRight" + Text { id: titleText; style: Text.Raised; styleColor: "black"; color: "white"; elide: Text.ElideRight x: 220; y: 30; width: parent.width - 240; text: container.photoTitle; font.pointSize: 22 } LikeOMeter { x: 40; y: 250; rating: container.rating } @@ -69,7 +69,7 @@ Flipable { text: container.photoTags == "" ? "" : "Tags: " } Text { id: tags; color: "white"; width: parent.width-x-20; anchors.left: tagsLabel.right; anchors.top: date.bottom; - elide: "ElideRight"; text: container.photoTags } + elide: Text.ElideRight; text: container.photoTags } ScrollBar { id: scrollBar; x: 720; y: flickable.y; width: 7; height: flickable.height; opacity: 0; flickableArea: flickable; clip: true } diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml index d1ad6e1..337f77c 100644 --- a/demos/declarative/flickr/flickr-desktop.qml +++ b/demos/declarative/flickr/flickr-desktop.qml @@ -187,6 +187,6 @@ Item { id: categoryText; anchors.horizontalCenter: parent.horizontalCenter; y: 15; text: "Flickr - " + (rssModel.tags=="" ? "Uploads from everyone" : "Recent Uploads tagged " + rssModel.tags) - font.pointSize: 20; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" + font.pointSize: 20; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" } } diff --git a/demos/declarative/flickr/flickr-mobile.qml b/demos/declarative/flickr/flickr-mobile.qml index 48fe7df..0a89c4f 100644 --- a/demos/declarative/flickr/flickr-mobile.qml +++ b/demos/declarative/flickr/flickr-mobile.qml @@ -10,7 +10,7 @@ Item { id: background anchors.fill: parent; color: "#343434"; - Image { source: "mobile/images/stripes.png"; fillMode: "Tile"; anchors.fill: parent; opacity: 0.3 } + Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } Common.RssModel { id: rssModel } Common.Loading { anchors.centerIn: parent; visible: rssModel.status == 2 } diff --git a/demos/declarative/flickr/mobile/Button.qml b/demos/declarative/flickr/mobile/Button.qml index a4a96d4..770330c 100644 --- a/demos/declarative/flickr/mobile/Button.qml +++ b/demos/declarative/flickr/mobile/Button.qml @@ -26,7 +26,7 @@ Item { Text { color: "white" anchors.centerIn: buttonImage; font.bold: true - text: container.text; style: "Raised"; styleColor: "black" + text: container.text; style: Text.Raised; styleColor: "black" } states: [ State { diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 26052b9..1963bf5 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -39,13 +39,13 @@ Flipable { right: parent.right; rightMargin: 20 top: parent.top; topMargin: 180 } - Text { font.bold: true; color: "white"; elide: "ElideRight"; text: container.photoTitle } - Text { color: "white"; elide: "ElideRight"; text: "Size: " + container.photoWidth + 'x' + container.photoHeight } - Text { color: "white"; elide: "ElideRight"; text: "Type: " + container.photoType } - Text { color: "white"; elide: "ElideRight"; text: "Author: " + container.photoAuthor } - Text { color: "white"; elide: "ElideRight"; text: "Published: " + container.photoDate } - Text { color: "white"; elide: "ElideRight"; text: container.photoTags == "" ? "" : "Tags: " } - Text { color: "white"; elide: "ElideRight"; elide: "ElideRight"; text: container.photoTags } + Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle } + Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight } + Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType } + Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor } + Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate } + Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: " } + Text { color: "white"; elide: Text.ElideRight; elide: Text.ElideRight; text: container.photoTags } } } diff --git a/demos/declarative/flickr/mobile/ListDelegate.qml b/demos/declarative/flickr/mobile/ListDelegate.qml index 090e91a..75c4572 100644 --- a/demos/declarative/flickr/mobile/ListDelegate.qml +++ b/demos/declarative/flickr/mobile/ListDelegate.qml @@ -14,9 +14,9 @@ Component { } Column { x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2 - Text { text: title; color: "white"; width: parent.width; font.bold: true; elide: "ElideRight"; style: "Raised"; styleColor: "black" } - Text { text: photoAuthor; color: "white"; width: parent.width; elide: "ElideLeft"; color: "#cccccc"; style: "Raised"; styleColor: "black" } - Text { text: photoDate; color: "white"; width: parent.width; elide: "ElideRight"; color: "#cccccc"; style: "Raised"; styleColor: "black" } + Text { text: title; color: "white"; width: parent.width; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" } + Text { text: photoAuthor; color: "white"; width: parent.width; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" } + Text { text: photoDate; color: "white"; width: parent.width; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" } } } } diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index 108faf7..07b9762 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -25,9 +25,9 @@ Item { left: parent.left; right: tagButton.left; leftMargin: 10; rightMargin: 10 verticalCenter: parent.verticalCenter } - elide: "ElideLeft" + elide: Text.ElideLeft text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags) - font.bold: true; color: "White"; style: "Raised"; styleColor: "Black" + font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black" } Button { diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index 72431af..f1b7df0 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -121,7 +121,7 @@ Item { ] Image { source: "pics/No-Ones-Laughing-3.jpg" - fillMode: "Tile" + fillMode: Image.Tile } Description { text: "Use the 'minehunt' executable to run this demo!" diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index ea7c14c..38a781a 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -13,7 +13,7 @@ Rectangle { Image { id: background anchors.fill: parent; source: "content/pics/background.png" - fillMode: "PreserveAspectCrop" + fillMode: Image.PreserveAspectCrop } Item { diff --git a/demos/declarative/twitter/content/AuthView.qml b/demos/declarative/twitter/content/AuthView.qml index 73ce308..320eef6 100644 --- a/demos/declarative/twitter/content/AuthView.qml +++ b/demos/declarative/twitter/content/AuthView.qml @@ -12,7 +12,7 @@ Item { Text { width: 100 text: "Screen name:" - font.pointSize: 10; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" + font.pointSize: 10; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Qt.AlignRight } @@ -42,7 +42,7 @@ Item { Text { width: 100 text: "Password:" - font.pointSize: 10; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" + font.pointSize: 10; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Qt.AlignRight } diff --git a/demos/declarative/twitter/content/FatDelegate.qml b/demos/declarative/twitter/content/FatDelegate.qml index 32a921e..194ffb3 100644 --- a/demos/declarative/twitter/content/FatDelegate.qml +++ b/demos/declarative/twitter/content/FatDelegate.qml @@ -38,7 +38,7 @@ Component { + ''+userScreenName + " from " +source + "
" + addTags(statusText) + ""; textFormat: Qt.RichText - color: "white"; color: "#cccccc"; style: "Raised"; styleColor: "black"; wrap: true + color: "white"; color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrap: true anchors.left: whiteRect.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6 onLinkActivated: handleLink(link) } diff --git a/demos/declarative/twitter/content/HomeTitleBar.qml b/demos/declarative/twitter/content/HomeTitleBar.qml index 3108a9b..b0995f3 100644 --- a/demos/declarative/twitter/content/HomeTitleBar.qml +++ b/demos/declarative/twitter/content/HomeTitleBar.qml @@ -52,9 +52,9 @@ Item { anchors.left: parent.left; anchors.right: tagButton.left anchors.leftMargin: 58; anchors.rightMargin: 10 anchors.verticalCenter: parent.verticalCenter - elide: "ElideLeft" + elide: Text.ElideLeft text: "Timeline for " + rssModel.authName - font.pointSize: 10; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" + font.pointSize: 10; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" } Button { @@ -67,7 +67,7 @@ Item { id: charsLeftText; anchors.horizontalCenter: tagButton.horizontalCenter; anchors.top: tagButton.bottom; anchors.topMargin: 2 text: {140 - editor.text.length;} visible: titleBar.state == "Posting" - font.pointSize: 10; font.bold: true; color: "white"; style: "Raised"; styleColor: "black" + font.pointSize: 10; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" } Item { id: txtEdit; diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index e9752ff..fdeb839 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -29,14 +29,14 @@ Item { id: background anchors.fill: parent; color: "#343434"; - Image { source: "mobile/images/stripes.png"; fillMode: "Tile"; anchors.fill: parent; opacity: 0.3 } + Image { source: "mobile/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } Twitter.RssModel { id: rssModel } Common.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'} Text { width: 180 text: "Could not access twitter using this screen name and password pair."; - color: "white"; color: "#cccccc"; style: "Raised"; styleColor: "black"; wrap: true + color: "white"; color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrap: true visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent } diff --git a/demos/declarative/webbrowser/fieldtext/FieldText.qml b/demos/declarative/webbrowser/fieldtext/FieldText.qml index 2adfbbf..b1c1938 100644 --- a/demos/declarative/webbrowser/fieldtext/FieldText.qml +++ b/demos/declarative/webbrowser/fieldtext/FieldText.qml @@ -79,7 +79,7 @@ Item { x: 5 width: parent.width-10 anchors.verticalCenter: parent.verticalCenter - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter color: fieldText.state == "editing" ? "#505050" : "#AAAAAA" font.italic: true font.bold: true diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index 53ac214..3b1ea57 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -65,11 +65,11 @@ Item { id: headerText text: webView.title!='' || webView.progress == 1.0 ? webView.title : 'Loading...' - elide: "ElideRight" + elide: Text.ElideRight color: "white" styleColor: "black" - style: "Raised" + style: Text.Raised font.family: "Helvetica" font.pointSize: 10 @@ -81,7 +81,7 @@ Item { anchors.rightMargin: 4 anchors.top: header.top anchors.topMargin: 4 - horizontalAlignment: "AlignHCenter" + horizontalAlignment: Text.AlignHCenter } Item { width: parent.width diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 860af66..45a481c 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -82,7 +82,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Image,QFxImage) \o fillMode: Tile \qml Image { - fillMode: "Tile" + fillMode: Image.Tile width: 160; height: 160 source: "pics/qtlogo.png" } @@ -92,7 +92,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Image,QFxImage) \o fillMode: TileVertically \qml Image { - fillMode: "TileVertically" + fillMode: Image.TileVertically width: 160; height: 160 source: "pics/qtlogo.png" } @@ -102,7 +102,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Image,QFxImage) \o fillMode: TileHorizontally \qml Image { - fillMode: "TileHorizontally" + fillMode: Image.TileHorizontally width: 160; height: 160 source: "pics/qtlogo.png" } @@ -161,7 +161,7 @@ void QFxImage::setPixmap(const QPixmap &pix) } /*! - \qmlproperty FillMode Image::fillMode + \qmlproperty enumeration Image::fillMode Set this property to define what happens when the image set for the item is smaller than the size of the item. diff --git a/src/declarative/fx/qfxmouseregion.cpp b/src/declarative/fx/qfxmouseregion.cpp index 4b31fd4..315a273 100644 --- a/src/declarative/fx/qfxmouseregion.cpp +++ b/src/declarative/fx/qfxmouseregion.cpp @@ -319,8 +319,8 @@ void QFxMouseRegion::setEnabled(bool a) \code Text { text: mr.pressedButtons & Qt.RightButton ? "right" : "" - horizontalAlignment: "AlignHCenter" - verticalAlignment: "AlignVCenter" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter MouseRegion { id: mr acceptedButtons: Qt.LeftButton | Qt.RightButton diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index 763256b..4a01cbd 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -231,9 +231,9 @@ QColor QFxText::color() const \qml Row { Text { font.pointSize: 24; text: "Normal" } - Text { font.pointSize: 24; text: "Raised"; style: "Raised"; styleColor: "#AAAAAA" } - Text { font.pointSize: 24; text: "Outline"; style: "Outline"; styleColor: "red" } - Text { font.pointSize: 24; text: "Sunken"; style: "Sunken"; styleColor: "#AAAAAA" } + Text { font.pointSize: 24; text: "Raised"; style: Text.Raised; styleColor: "#AAAAAA" } + Text { font.pointSize: 24; text: "Outline"; style: Text.Outline; styleColor: "red" } + Text { font.pointSize: 24; text: "Sunken"; style: Text.Sunken; styleColor: "#AAAAAA" } } \endqml -- cgit v0.12 From 753f8a4f263fd44ec22c7f6b0835df1466d01f82 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 28 Oct 2009 16:06:09 +1000 Subject: Doc. --- doc/src/declarative/elements.qdoc | 2 +- doc/src/declarative/extending.qdoc | 2 +- doc/src/declarative/qmlmodels.qdoc | 2 +- doc/src/declarative/qmlreference.qdoc | 9 ++++++--- doc/src/declarative/qmlstates.qdoc | 1 + doc/src/declarative/qtbinding.qdoc | 1 - doc/src/declarative/qtprogrammers.qdoc | 2 +- src/declarative/extra/qmlxmllistmodel.cpp | 5 +++++ src/declarative/fx/qfxitem.cpp | 27 ++++++++++++++++++++------- src/declarative/qml/qmlcompiler.cpp | 4 ++++ src/declarative/qml/qmlcomponent.cpp | 16 +++++++++++++++- src/declarative/util/qmllistmodel.cpp | 6 ++++++ src/declarative/util/qmlstate.cpp | 2 +- src/declarative/util/qmltransition.cpp | 2 +- src/declarative/util/qmlview.cpp | 2 +- 15 files changed, 64 insertions(+), 19 deletions(-) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 4fa4ec5..3ea5989 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -85,7 +85,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \list \o \l Binding -\o \l ListModel +\o \l ListModel, \l ListElement \o \l VisualItemModel \o \l XmlListModel and XmlRole \o \l SqlQuery, \l SqlConnection, and \l SqlBind diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index b872632..7a4e51c 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -604,7 +604,7 @@ public: \title Extending types from QML Many of the elements available for use in QML are implemented in -\l {QML for C++ Programmers}{C++}. These types are know as "core types". QML +\l {Extending QML}{C++}. These types are know as "core types". QML allows programmers to build new, fully functional elements without using C++. Existing core types can be extended, and new types defined entirely in the QML language. diff --git a/doc/src/declarative/qmlmodels.qdoc b/doc/src/declarative/qmlmodels.qdoc index 45df29b..a14345b 100644 --- a/doc/src/declarative/qmlmodels.qdoc +++ b/doc/src/declarative/qmlmodels.qdoc @@ -51,7 +51,7 @@ have items modified, inserted, removed or moved dynamically. Data is provided to the delegate via named data roles which the delegate may bind to. The roles are exposed as properties of the -\model property, though this property is set as a default property +\e model property, though this property is set as a default property of the delegate so, unless there is a naming clash with a property in the delegate, the roles are usually accessed unqualified. diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc index 6a874b6..a56813c 100644 --- a/doc/src/declarative/qmlreference.qdoc +++ b/doc/src/declarative/qmlreference.qdoc @@ -60,9 +60,8 @@ \list \o \l {Introduction to the QML language} \o \l {tutorial}{Tutorial: 'Hello World'} - \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'} \o \l {advtutorial.html}{Advanced Tutorial: 'Same Game'} - \o \l {qmlexamples}{Examples} + \o \l {QML Examples and Walkthroughs} \endlist \section1 Core QML Features: @@ -82,7 +81,11 @@ QML Reference: \list - \o \l {QML Format Reference} \o \l {elements}{QML Elements} \endlist + + \section1 Deprecated + \list + \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'} + \endlist */ diff --git a/doc/src/declarative/qmlstates.qdoc b/doc/src/declarative/qmlstates.qdoc index 078b718..261e3f5 100644 --- a/doc/src/declarative/qmlstates.qdoc +++ b/doc/src/declarative/qmlstates.qdoc @@ -55,5 +55,6 @@ Other things you can do in a state change: \o change an item's parent with ParentChange \o change an item's anchors with AnchorChanges \o run some script with StateChangeScript +\endlist */ diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index 18685ac..61520f7 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -211,7 +211,6 @@ Rectangle { } } \endcode -\endtable To detect when a C++ property value - in this case the \c CustomPalette's \c text property - changes, the property must have a corresponding NOTIFY signal. The NOTIFY signal specifies a signal diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc index ea27d7e..4c28255 100644 --- a/doc/src/declarative/qtprogrammers.qdoc +++ b/doc/src/declarative/qtprogrammers.qdoc @@ -109,7 +109,7 @@ just as QTextEdit, QWebView, and QListView are built upon those same UI-agnostic components. The encapsulation of the look and feel that QWidgets gives is important, and for this -the QML concept of \l components serves the same purpose. If you are building a complete +the QML concept of \l {qmldocuments.html}{components} serves the same purpose. If you are building a complete suite of applications which should have a consistent look and feel, you should build a set of reusable components with the look and feel you desire. diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index df89f56..a3c96fd 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -406,6 +406,11 @@ void QmlXmlRoleList::insert(int i, QmlXmlListModelRole *role) } /*! + \class QmlXmlListModel + \internal +*/ + +/*! \qmlclass XmlListModel \brief The XmlListModel element allows you to specify a model using XPath expressions. diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 7d60336..ed07696 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -79,6 +79,19 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rotation,QGraphicsRotation) #include "qfxeffects.cpp" /*! + \qmlclass Transform + \brief The Transform elements provide a way of building advanced transformations on Items. + + The Transform elements let you create and control advanced transformations that can be configured + independently using specialized properties. + + You can assign any number of Transform elements to an Item. Each Transform is applied in order, + one at a time, to the Item it's assigned to. + + \sa Rotation, Scale +*/ + +/*! \qmlclass Scale \brief The Scale object provides a way to scale an Item. @@ -1295,7 +1308,7 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj) This signal is emitted when the \a state of the item changes. - \sa states-transitions + \sa {qmlstates}{States} */ /*! @@ -2315,14 +2328,14 @@ QmlList *QFxItem::resources() } \endqml - \sa {states-transitions}{States and Transitions} + \sa {qmlstate}{States} */ /*! \property QFxItem::states This property holds a list of states defined by the item. - \sa {states-transitions}{States and Transitions} + \sa {qmlstate}{States} */ QmlList* QFxItem::states() { @@ -2344,14 +2357,14 @@ QmlList* QFxItem::states() } \endqml - \sa {states-transitions}{States and Transitions} + \sa {state-transitions}{Transitions} */ /*! \property QFxItem::transitions This property holds a list of transitions defined by the item. - \sa {states-transitions}{States and Transitions} + \sa {state-transitions}{Transitions} */ QmlList* QFxItem::transitions() { @@ -2423,7 +2436,7 @@ QmlList* QFxItem::transitions() set), \c state will be a blank string. Likewise, you can return an item to its base state by setting its current state to \c ''. - \sa {states-transitions}{States and Transitions} + \sa {qmlstates}{States} */ /*! @@ -2449,7 +2462,7 @@ QmlList* QFxItem::transitions() set), \c state will be a blank string. Likewise, you can return an item to its base state by setting its current state to \c ''. - \sa {states-transitions}{States and Transitions} + \sa {qmlstates}{States} */ QString QFxItem::state() const { diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index ad74446..7a417bb 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -150,6 +150,8 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name) } /*! + \macro COMPILE_EXCEPTION + \internal Inserts an error into the QmlCompiler error list, and returns false (failure). @@ -175,6 +177,8 @@ bool QmlCompiler::isSignalPropertyName(const QByteArray &name) } /*! + \macro COMPILE_CHECK + \internal Returns false if \a is false, otherwise does nothing. */ #define COMPILE_CHECK(a) \ diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 0894758..1e3a082 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -74,7 +74,7 @@ int statusId = qRegisterMetaType("QmlComponent::Status"); \brief The Component element encapsulates a QML component description. Components are reusable, encapsulated Qml element with a well-defined interface. - They are often defined in \l {components}{Component Files}. + They are often defined in \l {qmldocuments.html}{Component Files}. The \e Component element allows defining components within a QML file. This can be useful for reusing a small component within a single QML @@ -267,6 +267,10 @@ bool QmlComponent::isLoading() const return status() == Loading; } +/*! + Returns he progress of loading the component, from 0.0 (nothing loaded) + to 1.0 (finished). +*/ qreal QmlComponent::progress() const { Q_D(const QmlComponent); @@ -274,6 +278,13 @@ qreal QmlComponent::progress() const } /*! + \fn void QmlComponent::progressChanged(qreal progress) + + Emitted whenever the component's loading progress changes. \a progress will be the + current progress between 0.0 (nothing loaded) and 1.0 (finished). +*/ + +/*! \fn void QmlComponent::statusChanged(QmlComponent::Status status) Emitted whenever the component's status changes. \a status will be the @@ -659,6 +670,9 @@ QmlComponentAttached::~QmlComponentAttached() next = 0; } +/*! + \internal +*/ QmlComponentAttached *QmlComponent::qmlAttachedProperties(QObject *obj) { QmlComponentAttached *a = new QmlComponentAttached(obj); diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 7ccccec..9c9fa6a 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -809,6 +809,12 @@ void QmlListModelParser::setCustomData(QObject *obj, const QByteArray &d) QML_DEFINE_CUSTOM_TYPE(Qt, 4,6, (QT_VERSION&0x00ff00)>>8, ListModel, QmlListModel, QmlListModelParser) +/*! + \qmlclass ListElement + \brief The ListElement element defines a data item in a ListModel. + + \sa ListModel +*/ // ### FIXME class QmlListElement : public QObject { diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 7e4e992..425480c 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -134,7 +134,7 @@ QmlStateOperation::QmlStateOperation(QObjectPrivate &dd, QObject *parent) inadvisible. Not only would this have the same effect as going directly to the second state it may cause the program to crash. - \sa {states-transitions}{States and Transitions} + \sa {qmlstates}{States}, {state-transitions}{Transitions} */ /*! diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp index 66275d9..97a3b74 100644 --- a/src/declarative/util/qmltransition.cpp +++ b/src/declarative/util/qmltransition.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE \qmlclass Transition QmlTransition \brief The Transition element defines animated transitions that occur on state changes. - \sa {states-transitions}{States and Transitions} + \sa {qmlstates}{States}, {state-transitions}{Transitions} */ /*! diff --git a/src/declarative/util/qmlview.cpp b/src/declarative/util/qmlview.cpp index f91d0db..329a9b2 100644 --- a/src/declarative/util/qmlview.cpp +++ b/src/declarative/util/qmlview.cpp @@ -386,7 +386,7 @@ void QmlView::continueExecute() */ /*! \fn void QmlView::initialSize(QSize size) - This signal is emitted when the initial size of the root item is known. + This signal is emitted when the initial \a size of the root item is known. */ /*! \fn void QmlView::errors(const QList &errors) -- cgit v0.12 From 67eaebdf15471e47529a6496c0de1963fe7cd8ec Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 28 Oct 2009 16:26:16 +1000 Subject: Make test more robust --- .../auto/declarative/animations/tst_animations.cpp | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 336f0d3..a6f67b8 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -21,6 +21,15 @@ private slots: void mixedTypes(); }; +#define QTIMED_COMPARE(lhs, rhs) do { \ + for (int ii = 0; ii < 5; ++ii) { \ + if (lhs == rhs) \ + break; \ + QTest::qWait(50); \ + } \ + QCOMPARE(lhs, rhs); \ +} while (false) + void tst_animations::simpleNumber() { QFxRect rect; @@ -29,8 +38,8 @@ void tst_animations::simpleNumber() animation.setProperty("x"); animation.setTo(200); animation.start(); - QTest::qWait(animation.duration() + 50); - QCOMPARE(rect.x(), qreal(200)); + QTest::qWait(animation.duration()); + QTIMED_COMPARE(rect.x(), qreal(200)); rect.setX(0); animation.start(); @@ -47,8 +56,8 @@ void tst_animations::simpleColor() animation.setProperty("color"); animation.setTo(QColor("red")); animation.start(); - QTest::qWait(animation.duration() + 50); - QCOMPARE(rect.color(), QColor("red")); + QTest::qWait(animation.duration()); + QTIMED_COMPARE(rect.color(), QColor("red")); rect.setColor(QColor("blue")); animation.start(); @@ -71,8 +80,8 @@ void tst_animations::alwaysRunToEnd() QTest::qWait(1500); animation.stop(); QVERIFY(rect.x() != qreal(200)); - QTest::qWait(500 + 50); - QCOMPARE(rect.x(), qreal(200)); + QTest::qWait(500); + QTIMED_COMPARE(rect.x(), qreal(200)); } void tst_animations::dotProperty() @@ -83,8 +92,8 @@ void tst_animations::dotProperty() animation.setProperty("border.width"); animation.setTo(10); animation.start(); - QTest::qWait(animation.duration() + 50); - QCOMPARE(rect.border()->width(), 10); + QTest::qWait(animation.duration()); + QTIMED_COMPARE(rect.border()->width(), 10); rect.border()->setWidth(0); animation.start(); -- cgit v0.12 From 6aacf78c1e22597553a2b237fb595a37e4fb8d00 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 28 Oct 2009 16:31:10 +1000 Subject: Incorporate latest optical theory. --- examples/declarative/dynamic/PerspectiveItem.qml | 12 ++++++++++++ examples/declarative/dynamic/dynamic.qml | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 examples/declarative/dynamic/PerspectiveItem.qml diff --git a/examples/declarative/dynamic/PerspectiveItem.qml b/examples/declarative/dynamic/PerspectiveItem.qml new file mode 100644 index 0000000..9e09dd2 --- /dev/null +++ b/examples/declarative/dynamic/PerspectiveItem.qml @@ -0,0 +1,12 @@ +import Qt 4.6 + +Image { + id: tree + property bool created: false + opacity: y+height > window.height/2 ? 1 : 0.25 + onCreatedChanged: if (created && y+height<=window.height/2) { tree.destroy() } + scale: y+height > window.height/2 ? (y+height-250)*0.01 : 1 + transformOrigin: "Center" + source: image; + z: y +} diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index 885e037..ea4e0cd 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -79,17 +79,17 @@ Item { } PaletteItem{ anchors.verticalCenter: parent.verticalCenter - file: "GenericItem.qml" + file: "PerspectiveItem.qml" image: "images/tree_s.png" } PaletteItem{ anchors.verticalCenter: parent.verticalCenter - file: "GenericItem.qml" + file: "PerspectiveItem.qml" image: "images/rabbit_brown.png" } PaletteItem{ anchors.verticalCenter: parent.verticalCenter - file: "GenericItem.qml" + file: "PerspectiveItem.qml" image: "images/rabbit_bw.png" } } -- cgit v0.12 From 9acfff1792cf9aa13d6dc213369ac620a203c22a Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 28 Oct 2009 16:45:26 +1000 Subject: Use ShellMode for creator plugin expression widget. --- tools/qmldebugger/creatorplugin/qmlinspectormode.cpp | 2 +- tools/qmldebugger/standalone/expressionquerywidget.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp index a90ca2c..5881cd1 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp @@ -385,7 +385,7 @@ void QmlInspectorMode::initWidgets() m_propertiesWidget = new ObjectPropertiesView; m_watchTableView = new WatchTableView(m_watchTableModel); m_frameRateWidget = new CanvasFrameRate; - m_expressionWidget = new ExpressionQueryWidget(ExpressionQueryWidget::SeparateEntryMode); + m_expressionWidget = new ExpressionQueryWidget(ExpressionQueryWidget::ShellMode); // FancyMainWindow uses widgets' window titles for tab labels m_objectTreeWidget->setWindowTitle(tr("Object Tree")); diff --git a/tools/qmldebugger/standalone/expressionquerywidget.cpp b/tools/qmldebugger/standalone/expressionquerywidget.cpp index 3c4296d..e064189 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.cpp +++ b/tools/qmldebugger/standalone/expressionquerywidget.cpp @@ -42,6 +42,7 @@ ExpressionQueryWidget::ExpressionQueryWidget(Mode mode, QmlEngineDebug *client, m_lineEdit->installEventFilter(this); } else { m_textEdit->installEventFilter(this); + appendPrompt(); } } @@ -55,6 +56,8 @@ void ExpressionQueryWidget::clear() m_textEdit->clear(); if (m_lineEdit) m_lineEdit->clear(); + if (m_mode == ShellMode) + appendPrompt(); } void ExpressionQueryWidget::updateTitle() @@ -99,6 +102,12 @@ void ExpressionQueryWidget::checkCurrentContext() void ExpressionQueryWidget::showCurrentContext() { + if (m_mode == ShellMode) { + // clear the initial prompt + if (m_textEdit->document()->lineCount() == 1) + m_textEdit->clear(); + } + m_textEdit->moveCursor(QTextCursor::End); m_textEdit->setTextColor(Qt::darkGreen); m_textEdit->append(m_currObject.className() -- cgit v0.12 From 1f68fba91cf60103dd118dbd0d78342526bac593 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 28 Oct 2009 17:07:18 +1000 Subject: Mac-safe sanity check. QT-2398 fix --- tests/auto/declarative/sql/tst_sql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/sql/tst_sql.cpp b/tests/auto/declarative/sql/tst_sql.cpp index 22e9ba4..0ebdccd 100644 --- a/tests/auto/declarative/sql/tst_sql.cpp +++ b/tests/auto/declarative/sql/tst_sql.cpp @@ -86,7 +86,7 @@ QString tst_sql::dbDir() const void tst_sql::checkDatabasePath() { // Check default storage path (we can't use it since we don't want to mess with user's data) - QVERIFY(engine->offlineStoragePath().contains("Nokia")); + QVERIFY(engine->offlineStoragePath().contains("tst_sql")); QVERIFY(engine->offlineStoragePath().contains("OfflineStorage")); } -- cgit v0.12 From 5746e2ec47f1186e928830b58833756ac25156f4 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 28 Oct 2009 17:45:31 +1000 Subject: missing commit --- .../auto/declarative/sql/data/4-iteration-index.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/auto/declarative/sql/data/4-iteration-index.js diff --git a/tests/auto/declarative/sql/data/4-iteration-index.js b/tests/auto/declarative/sql/data/4-iteration-index.js new file mode 100644 index 0000000..298737d --- /dev/null +++ b/tests/auto/declarative/sql/data/4-iteration-index.js @@ -0,0 +1,27 @@ +var db = openDatabase("QmlTestDB", "", "Test database from Qt autotests", 1000000); +var r=0; + +db.transaction( + function(tx) { + tx.executeSql('SELECT * FROM Greeting', [], + function(tx, rs) { + var r1="" + for(var i = 0; i < rs.rows.length; i++) { + r1 += rs.rows[i].salutation + ", " + rs.rows[i].salutee + ";" + } + if (r1 != "hello, world;hello, world;hello, world;hello, world;") + r = "SELECTED DATA WRONG: "+r1; + }, + function(tx, error) { if (r==0) r="SELECT FAILED: "+error.message } + ); + }, + function(tx, error) { if (r==0) r="TRANSACTION FAILED: "+error.message }, + function(tx, result) { if (r==0) r="passed" } +); + + +function test() +{ + if (r == 0) r = "transaction_not_finished"; + return r; +} -- cgit v0.12 From c25bface8e20b472d1e50a82fdd85f7cda001f7e Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 28 Oct 2009 18:03:16 +1000 Subject: Add missing file Task-number: QT-2401 --- tests/auto/declarative/qfxtextinput/data/cursorTest.qml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/auto/declarative/qfxtextinput/data/cursorTest.qml diff --git a/tests/auto/declarative/qfxtextinput/data/cursorTest.qml b/tests/auto/declarative/qfxtextinput/data/cursorTest.qml new file mode 100644 index 0000000..ddc98cc --- /dev/null +++ b/tests/auto/declarative/qfxtextinput/data/cursorTest.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Rectangle { width: 300; height: 300; color: "white" + TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject" + resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance";} } ] + cursorDelegate: cursor + } +} -- cgit v0.12