From 2f54be99778efb46bb4440598f28004374800975 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 19 Aug 2009 12:20:22 +1000 Subject: More import autotests --- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 122 ++++++++++++++++++--- 1 file changed, 107 insertions(+), 15 deletions(-) diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 92c23d4..258eaa1 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -512,32 +512,124 @@ void tst_qmlparser::imports_data() QTest::addColumn("qml"); QTest::addColumn("type"); - QTest::newRow("missing import") << "Test {}" << ""; - QTest::newRow("not in version 0.0") << "import com.nokia.Test 0.0\nTest {}" << ""; - QTest::newRow("in version 1.0") << "import com.nokia.Test 1.0\nTest {}" << "TestType"; - QTest::newRow("in version 1.1") << "import com.nokia.Test 1.1\nTest {}" << "TestType"; - QTest::newRow("in version 1.3") << "import com.nokia.Test 1.3\nTest {}" << "TestType"; - QTest::newRow("not in version 1.4") << "import com.nokia.Test 1.4\nTest {}" << ""; - QTest::newRow("in version 1.5") << "import com.nokia.Test 1.5\nTest {}" << "TestType"; - QTest::newRow("changed in version 1.8") << "import com.nokia.Test 1.8\nTest {}" << "TestType2"; - QTest::newRow("not in version 1.10") << "import com.nokia.Test 1.10\nTest {}" << ""; - QTest::newRow("back in version 1.12") << "import com.nokia.Test 1.12\nTest {}" << "TestType2"; - QTest::newRow("old in version 1.9") << "import com.nokia.Test 1.9\nOldTest {}" << "TestType"; - QTest::newRow("old in version 1.11") << "import com.nokia.Test 1.11\nOldTest {}" << "TestType"; - QTest::newRow("no old in version 1.12") << "import com.nokia.Test 1.12\nOldTest {}" << ""; + QTest::newRow("missing import") + << "Test {}" + << ""; + QTest::newRow("not in version 0.0") + << "import com.nokia.Test 0.0\n" + "Test {}" + << ""; + QTest::newRow("in version 1.0") + << "import com.nokia.Test 1.0\n" + "Test {}" + << "TestType"; + QTest::newRow("qualified wrong") + << "import com.nokia.Test 1.0 as T\n" + "Test {}" + << ""; + QTest::newRow("qualified right") + << "import com.nokia.Test 1.0 as T\n" + "T.Test {}" + << "TestType"; + QTest::newRow("qualified right but not in version 0.0") + << "import com.nokia.Test 0.0 as T\n" + "T.Test {}" + << ""; + QTest::newRow("in version 1.1") + << "import com.nokia.Test 1.1\n" + "Test {}" + << "TestType"; + QTest::newRow("in version 1.3") + << "import com.nokia.Test 1.3\n" + "Test {}" + << "TestType"; + QTest::newRow("not in version 1.4") + << "import com.nokia.Test 1.4\n" + "Test {}" + << ""; + QTest::newRow("in version 1.5") + << "import com.nokia.Test 1.5\n" + "Test {}" + << "TestType"; + QTest::newRow("changed in version 1.8") + << "import com.nokia.Test 1.8\n" + "Test {}" + << "TestType2"; + QTest::newRow("not in version 1.10") + << "import com.nokia.Test 1.10\n" + "Test {}" + << ""; + QTest::newRow("back in version 1.12") + << "import com.nokia.Test 1.12\n" + "Test {}" + << "TestType2"; + QTest::newRow("old in version 1.9") + << "import com.nokia.Test 1.9\n" + "OldTest {}" + << "TestType"; + QTest::newRow("old in version 1.11") + << "import com.nokia.Test 1.11\n" + "OldTest {}" + << "TestType"; + QTest::newRow("no old in version 1.12") + << "import com.nokia.Test 1.12\n" + "OldTest {}" + << ""; + QTest::newRow("multiversion 1") + << "import com.nokia.Test 1.11\n" + "import com.nokia.Test 1.12\n" + "Test {}" + << "TestType2"; + QTest::newRow("multiversion 2") + << "import com.nokia.Test 1.11\n" + "import com.nokia.Test 1.12\n" + "OldTest {}" + << "TestType"; + QTest::newRow("qualified multiversion 3") + << "import com.nokia.Test 1.0 as T0\n" + "import com.nokia.Test 1.8 as T8\n" + "T0.Test {}" + << "TestType"; + QTest::newRow("qualified multiversion 4") + << "import com.nokia.Test 1.0 as T0\n" + "import com.nokia.Test 1.8 as T8\n" + "T8.Test {}" + << "TestType2"; + QTest::newRow("qualified multiversion 5") + << "import com.nokia.Test 1.0 as T0\n" + "import com.nokia.Test 1.10 as T10\n" + "T10.Test {}" + << ""; + QTest::newRow("local import") + << "import \"subdir\"\n" + "Test {}" + << "QFxRect"; + QTest::newRow("local import as") + << "import \"subdir\" as T\n" + "T.Test {}" + << "QFxRect"; + QTest::newRow("wrong local import as") + << "import \"subdir\" as T\n" + "Test {}" + << ""; + QTest::newRow("library precedence over local import") + << "import \"subdir\"\n" + "import com.nokia.Test 1.0\n" + "Test {}" + << "TestType"; } -// Tests the registration of custom variant string converters void tst_qmlparser::imports() { QFETCH(QString, qml); QFETCH(QString, type); - QmlComponent component(&engine, qml.toUtf8(), TEST_FILE("empty.txt")); + QmlComponent component(&engine, qml.toUtf8(), TEST_FILE("empty.txt")); // just a file for relative local imports if (type.isEmpty()) { QVERIFY(component.isError()); } else { + VERIFY_ERRORS(0); QObject *object = component.create(); QVERIFY(object != 0); QCOMPARE(QString(object->metaObject()->className()), type); -- cgit v0.12 From 78b1aa100d0a853ce1fe7df03a170887f461ede3 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 19 Aug 2009 14:39:03 +1000 Subject: update --- examples/declarative/modules/builtin-version.qml | 2 -- examples/declarative/modules/lib/com/nokia/Foo/Bar.qml | 5 +++++ examples/declarative/modules/lib/com/nokia/Foo/Bar17.qml | 5 +++++ examples/declarative/modules/lib/com/nokia/Foo/Baz.qml | 5 +++++ examples/declarative/modules/lib/com/nokia/Foo/qmldir | 6 ++++++ 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 examples/declarative/modules/lib/com/nokia/Foo/Bar.qml create mode 100644 examples/declarative/modules/lib/com/nokia/Foo/Bar17.qml create mode 100644 examples/declarative/modules/lib/com/nokia/Foo/Baz.qml create mode 100644 examples/declarative/modules/lib/com/nokia/Foo/qmldir diff --git a/examples/declarative/modules/builtin-version.qml b/examples/declarative/modules/builtin-version.qml index 82055b4..69f64ed 100644 --- a/examples/declarative/modules/builtin-version.qml +++ b/examples/declarative/modules/builtin-version.qml @@ -1,5 +1,3 @@ import Qt 4.6 -import com.nokia.Qt 4.7 Rect {} -// and later... SuperRect{} diff --git a/examples/declarative/modules/lib/com/nokia/Foo/Bar.qml b/examples/declarative/modules/lib/com/nokia/Foo/Bar.qml new file mode 100644 index 0000000..270cd46 --- /dev/null +++ b/examples/declarative/modules/lib/com/nokia/Foo/Bar.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +Text { + text: "lib/com/nokia/Foo/Bar.qml" + color: "green" +} diff --git a/examples/declarative/modules/lib/com/nokia/Foo/Bar17.qml b/examples/declarative/modules/lib/com/nokia/Foo/Bar17.qml new file mode 100644 index 0000000..f93fc62 --- /dev/null +++ b/examples/declarative/modules/lib/com/nokia/Foo/Bar17.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +Text { + text: "lib/com/nokia/Foo/Bar17.qml" + color: "white" +} diff --git a/examples/declarative/modules/lib/com/nokia/Foo/Baz.qml b/examples/declarative/modules/lib/com/nokia/Foo/Baz.qml new file mode 100644 index 0000000..4daa37f --- /dev/null +++ b/examples/declarative/modules/lib/com/nokia/Foo/Baz.qml @@ -0,0 +1,5 @@ +import Qt 4.6 +Text { + text: "lib/com/nokia/Foo/Baz.qml" + color: "red" +} diff --git a/examples/declarative/modules/lib/com/nokia/Foo/qmldir b/examples/declarative/modules/lib/com/nokia/Foo/qmldir new file mode 100644 index 0000000..b8111cb --- /dev/null +++ b/examples/declarative/modules/lib/com/nokia/Foo/qmldir @@ -0,0 +1,6 @@ +# Baz was introduced in Foo 1.6 +# Bar 1.5 and 1.6 are the same, but in 1.7 it is reimplemented. +Bar 1.5 Bar.qml +Bar 1.6 Bar.qml +Bar 1.7 Bar17.qml +Baz 1.6 Baz.qml -- cgit v0.12 From 9a954d44aa20e0eb21bdf2820941bd7a1908096d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 19 Aug 2009 15:13:09 +1000 Subject: Various doc fixes. Make QML docs fit in with the new Qt style. Fix numerous qdoc errors. --- doc/src/declarative/effects.qdoc | 29 ------------ doc/src/declarative/elements.qdoc | 8 ++-- doc/src/declarative/qmlreference.qdoc | 1 - doc/src/declarative/qtdeclarative.qdoc | 1 - .../extending/properties/birthdayparty.cpp | 25 ++++++++++ .../extending/properties/birthdayparty.h | 35 ++++++++++++++ src/declarative/3rdparty/qlistmodelinterface.cpp | 1 + src/declarative/fx/qfxgridview.cpp | 21 --------- src/declarative/fx/qfxitem.cpp | 55 +++++++--------------- src/declarative/fx/qfxlistview.cpp | 12 ----- src/declarative/fx/qfxloader.cpp | 7 --- src/declarative/fx/qfxmouseregion.cpp | 2 +- src/declarative/fx/qfxtextinput.cpp | 38 +++++++-------- src/declarative/qml/qmlcontext.cpp | 9 ++-- src/declarative/qml/qmlengine.cpp | 9 ---- src/declarative/qml/qmlengine.h | 1 - src/declarative/qml/qmlmetaproperty.cpp | 4 +- src/declarative/util/qfxview.cpp | 4 +- src/declarative/util/qfxview.h | 3 +- tools/qdoc3/test/classic.css | 39 ++++----------- 20 files changed, 121 insertions(+), 183 deletions(-) delete mode 100644 doc/src/declarative/effects.qdoc create mode 100644 examples/declarative/extending/properties/birthdayparty.cpp create mode 100644 examples/declarative/extending/properties/birthdayparty.h diff --git a/doc/src/declarative/effects.qdoc b/doc/src/declarative/effects.qdoc deleted file mode 100644 index 7879260..0000000 --- a/doc/src/declarative/effects.qdoc +++ /dev/null @@ -1,29 +0,0 @@ -/*! -\page effects.html -\target qmleffects -\title Visual Effects - -\section1 Basic Effects - -\list -\o Scaling (\l Item \bold scale property) -\o Opacity (\l Item \bold opacity property) -\o Rotation (\l Item \bold rotation property) -\o Affine Transforms (\l Squish) -\endlist - -\section1 Advanced Effects - -These effects are currently only supported by the OpenGL canvas -backend. Support for other backends may be added if the performance -can be made acceptable. - -\list -\o \l Shadow -\o \l Blur -\o \l Reflection -\o \l Highlight -\o \l Particles -\endlist - -*/ diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 3f74ff5..7c05ca1 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -102,7 +102,7 @@ The following table lists the Qml elements provided by the Qt Declarative module \header \o \bold {Views} -\o \bold {Layouts} +\o \bold {Positioners} \o \bold {Transforms} \o \bold {Effects} @@ -128,9 +128,9 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \list -\o \l VerticalLayout -\o \l HorizontalLayout -\o \l GridLayout +\o \l VerticalPositioner +\o \l HorizontalPositioner +\o \l GridPositioner \endlist \o diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc index cbd086c..da955dc 100644 --- a/doc/src/declarative/qmlreference.qdoc +++ b/doc/src/declarative/qmlreference.qdoc @@ -29,7 +29,6 @@ \o \l {binding}{Data Binding} \o \l {anchor-layout}{Layout Anchors} \o \l {qmlanimation}{Animation} - \o \l {qmleffects}{Visual Effects} \o \l {components}{Components} \o \l {qmlmodules}{Modules} \o \l {qmlfocus}{Keyboard Focus} diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc index c5d32fe..ccfe4a6 100644 --- a/doc/src/declarative/qtdeclarative.qdoc +++ b/doc/src/declarative/qtdeclarative.qdoc @@ -73,7 +73,6 @@ \o \l {binding}{Data Binding} \o \l {anchor-layout}{Layout Anchors} \o \l {qmlanimation}{Animation} - \o \l {qmleffects}{Visual Effects} \o \l {qmlmodules}{Modules} \o \l {qmlfocus}{Keyboard Focus} \o \l {Extending types from QML} diff --git a/examples/declarative/extending/properties/birthdayparty.cpp b/examples/declarative/extending/properties/birthdayparty.cpp new file mode 100644 index 0000000..92bc3ba --- /dev/null +++ b/examples/declarative/extending/properties/birthdayparty.cpp @@ -0,0 +1,25 @@ +#include "birthdayparty.h" + +BirthdayParty::BirthdayParty(QObject *parent) +: QObject(parent), m_celebrant(0) +{ +} + +// ![0] +Person *BirthdayParty::celebrant() const +{ + return m_celebrant; +} + +void BirthdayParty::setCelebrant(Person *c) +{ + m_celebrant = c; +} + +QmlList *BirthdayParty::guests() +{ + return &m_guests; +} +// ![0] + +QML_DEFINE_TYPE(People, 1, 0, 0, BirthdayParty, BirthdayParty); diff --git a/examples/declarative/extending/properties/birthdayparty.h b/examples/declarative/extending/properties/birthdayparty.h new file mode 100644 index 0000000..1804980 --- /dev/null +++ b/examples/declarative/extending/properties/birthdayparty.h @@ -0,0 +1,35 @@ +#ifndef BIRTHDAYPARTY_H +#define BIRTHDAYPARTY_H + +#include +#include +#include "person.h" + +// ![0] +class BirthdayParty : public QObject +{ +Q_OBJECT +// ![0] +// ![1] +Q_PROPERTY(Person *celebrant READ celebrant WRITE setCelebrant) +// ![1] +// ![2] +Q_PROPERTY(QmlList *guests READ guests) +// ![2] +// ![3] +public: + BirthdayParty(QObject *parent = 0); + + Person *celebrant() const; + void setCelebrant(Person *); + + QmlList *guests(); + +private: + Person *m_celebrant; + QmlConcreteList m_guests; +}; +QML_DECLARE_TYPE(BirthdayParty); +// ![3] + +#endif // BIRTHDAYPARTY_H diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp index 75960a1..4213ff2 100644 --- a/src/declarative/3rdparty/qlistmodelinterface.cpp +++ b/src/declarative/3rdparty/qlistmodelinterface.cpp @@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE /*! + \internal \class QListModelInterface \brief The QListModelInterface class can be subclassed to provide C++ models to QFx Views diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index 6c5a712..28f2219 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -1028,18 +1028,12 @@ void QFxGridView::sizeChange() } } -/*! - \reimp -*/ void QFxGridView::viewportMoved() { QFxFlickable::viewportMoved(); refill(); } -/*! - \reimp -*/ qreal QFxGridView::minYExtent() const { Q_D(const QFxGridView); @@ -1048,9 +1042,6 @@ qreal QFxGridView::minYExtent() const return -d->startPosition(); } -/*! - \reimp -*/ qreal QFxGridView::maxYExtent() const { Q_D(const QFxGridView); @@ -1059,9 +1050,6 @@ qreal QFxGridView::maxYExtent() const return -(d->endPosition() - height()); } -/*! - \reimp -*/ qreal QFxGridView::minXExtent() const { Q_D(const QFxGridView); @@ -1070,9 +1058,6 @@ qreal QFxGridView::minXExtent() const return -d->startPosition(); } -/*! - \reimp -*/ qreal QFxGridView::maxXExtent() const { Q_D(const QFxGridView); @@ -1081,9 +1066,6 @@ qreal QFxGridView::maxXExtent() const return -(d->endPosition() - height()); } -/*! - \reimp -*/ void QFxGridView::keyPressEvent(QKeyEvent *event) { Q_D(QFxGridView); @@ -1131,9 +1113,6 @@ void QFxGridView::keyPressEvent(QKeyEvent *event) QFxFlickable::keyPressEvent(event); } -/*! - \reimp -*/ void QFxGridView::componentComplete() { Q_D(QFxGridView); diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 572fcc7..1ab252c 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -893,18 +893,6 @@ QFxKeysAttached *QFxKeysAttached::qmlAttachedProperties(QObject *obj) */ /*! - \fn void QFxItem::hcenterChanged() - - This signal is emitted when the horizontal center coordinate of the item changes. -*/ - -/*! - \fn void QFxItem::vcenterChanged() - - This signal is emitted when the vertical center coordinate of the item changes. -*/ - -/*! \fn void QFxItem::stateChanged(const QString &state) This signal is emitted when the \a state of the item changes. @@ -1334,27 +1322,6 @@ void QFxItem::setClip(bool c) */ /*! - \property QFxItem::x - - The x coordinate of the item relative to its parent. -*/ - -/*! - \property QFxItem::y - - The y coordinate of the item relative to its parent. -*/ - -/*! - \property QFxItem::z - - The z coordinate of the item relative to its parent. - - A negative z coordinate means the item will be painted below its parent. -*/ - - -/*! \qmlproperty real Item::z Sets the stacking order of the item. By default the stacking order is 0. @@ -1977,12 +1944,7 @@ QmlList* QFxItem::transitions() return d->states()->transitionsProperty(); } -/*! - \internal - \property QFxItem::filter -*/ - -/*! +/* \qmlproperty list Item::filter This property holds a list of graphical filters to be applied to the item. @@ -2205,11 +2167,17 @@ QPointF QFxItemPrivate::computeTransformOrigin() const } } +/*! + \reimp +*/ bool QFxItem::sceneEvent(QEvent *event) { return QGraphicsItem::sceneEvent(event); } +/*! + \reimp +*/ QVariant QFxItem::itemChange(GraphicsItemChange change, const QVariant &value) { @@ -2220,6 +2188,9 @@ QVariant QFxItem::itemChange(GraphicsItemChange change, return QGraphicsItem::itemChange(change, value); } +/*! + \reimp +*/ QRectF QFxItem::boundingRect() const { Q_D(const QFxItem); @@ -2441,10 +2412,16 @@ bool QFxItem::hasActiveFocus() const return QGraphicsItem::hasFocus(); } +/*! + \reimp +*/ void QFxItem::paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) { } +/*! + \reimp +*/ bool QFxItem::event(QEvent *ev) { return QGraphicsObject::event(ev); diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 0232717..b6301f6 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -1260,9 +1260,6 @@ void QFxListView::viewportMoved() } } -/*! - \reimp -*/ qreal QFxListView::minYExtent() const { Q_D(const QFxListView); @@ -1275,9 +1272,6 @@ qreal QFxListView::minYExtent() const return extent; } -/*! - \reimp -*/ qreal QFxListView::maxYExtent() const { Q_D(const QFxListView); @@ -1294,9 +1288,6 @@ qreal QFxListView::maxYExtent() const return extent; } -/*! - \reimp -*/ qreal QFxListView::minXExtent() const { Q_D(const QFxListView); @@ -1309,9 +1300,6 @@ qreal QFxListView::minXExtent() const return extent; } -/*! - \reimp -*/ qreal QFxListView::maxXExtent() const { Q_D(const QFxListView); diff --git a/src/declarative/fx/qfxloader.cpp b/src/declarative/fx/qfxloader.cpp index 6d06ee9..95ddae3 100644 --- a/src/declarative/fx/qfxloader.cpp +++ b/src/declarative/fx/qfxloader.cpp @@ -85,13 +85,6 @@ QFxLoader::~QFxLoader() } /*! - \internal - \fn void QFxItem::sourceChanged() - This signal is emitted whenever the item's dynamic QML - source url changes. - */ - -/*! \qmlproperty url Loader::source This property holds the dynamic URL of the QML for the item. diff --git a/src/declarative/fx/qfxmouseregion.cpp b/src/declarative/fx/qfxmouseregion.cpp index 514701d..dc0f6b8 100644 --- a/src/declarative/fx/qfxmouseregion.cpp +++ b/src/declarative/fx/qfxmouseregion.cpp @@ -138,7 +138,7 @@ void QFxDrag::setYmax(qreal m) example extended so as to give a different color when you right click. \snippet doc/src/snippets/declarative/mouseregion.qml 1 - For basic key handling, see \l KeyActions. + For basic key handling, see \l Keys. MouseRegion is an invisible item: it is never painted. diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp index 1407a78..a2e2a11 100644 --- a/src/declarative/fx/qfxtextinput.cpp +++ b/src/declarative/fx/qfxtextinput.cpp @@ -53,8 +53,8 @@ QML_DEFINE_NOCREATE_TYPE(QValidator); QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QIntValidator,QIntValidator); /*! - \qmlclass LineEdit - The LineEdit item allows you to add an editable line of text to a scene. + \qmlclass TextInput + The TextInput item allows you to add an editable line of text to a scene. */ QFxTextInput::QFxTextInput(QFxItem* parent) : QFxPaintedItem(*(new QFxTextInputPrivate), parent) @@ -78,9 +78,9 @@ QFxTextInput::~QFxTextInput() } /*! - \qmlproperty string LineEdit::text + \qmlproperty string TextInput::text - The text in the LineEdit. + The text in the TextInput. */ QString QFxTextInput::text() const @@ -99,9 +99,9 @@ void QFxTextInput::setText(const QString &s) } /*! - \qmlproperty font LineEdit::font + \qmlproperty font TextInput::font - Set the LineEdit's font attributes. \c font.size sets the font's point size. + Set the TextInput's font attributes. \c font.size sets the font's point size. */ QFont QFxTextInput::font() const { @@ -125,7 +125,7 @@ void QFxTextInput::setFont(const QFont &font) } /*! - \qmlproperty color LineEdit::color + \qmlproperty color TextInput::color The text color. */ @@ -143,7 +143,7 @@ void QFxTextInput::setColor(const QColor &c) /*! - \qmlproperty color LineEdit::highlightColor + \qmlproperty color TextInput::highlightColor The text highlight color, used behind selections. */ @@ -164,7 +164,7 @@ void QFxTextInput::setHighlightColor(const QColor &color) } /*! - \qmlproperty color LineEdit::highlightedTextColor + \qmlproperty color TextInput::highlightedTextColor The highlighted text color, used in selections. */ @@ -221,7 +221,7 @@ void QFxTextInput::setMaxLength(int ml) } /*! - \qmlproperty bool LineEdit::cursorVisible + \qmlproperty bool TextInput::cursorVisible If true the text edit shows a cursor. This property is set and unset when the line edit gets focus, but it can also @@ -244,8 +244,8 @@ void QFxTextInput::setCursorVisible(bool on) } /*! - \qmlproperty int LineEdit::cursorPosition - The position of the cursor in the LineEdit. + \qmlproperty int TextInput::cursorPosition + The position of the cursor in the TextInput. */ int QFxTextInput::cursorPosition() const { @@ -259,7 +259,7 @@ void QFxTextInput::setCursorPosition(int cp) } /*! - \qmlproperty int LineEdit::selectionStart + \qmlproperty int TextInput::selectionStart The cursor position before the first character in the current selection. Setting this and selectionEnd allows you to specify a selection in the @@ -287,7 +287,7 @@ void QFxTextInput::setSelectionStart(int s) } /*! - \qmlproperty int LineEdit::selectionEnd + \qmlproperty int TextInput::selectionEnd The cursor position after the last character in the current selection. Setting this and selectionStart allows you to specify a selection in the @@ -368,12 +368,12 @@ void QFxTextInput::setEchoMode(uint echo) } /*! - \qmlproperty Component LineEdit::cursorDelegate - The delegate for the cursor in the LineEdit. + \qmlproperty Component TextInput::cursorDelegate + The delegate for the cursor in the TextInput. - If you set a cursorDelegate for a LineEdit, this delegate will be used for + If you set a cursorDelegate for a TextInput, this delegate will be used for drawing the cursor instead of the standard cursor. An instance of the - delegate will be created and managed by the LineEdit when a cursor is + delegate will be created and managed by the TextInput when a cursor is needed, and the x property of delegate instance will be set so as to be one pixel before the top left of the current character. @@ -514,7 +514,7 @@ void QFxTextInput::drawContents(QPainter *p, const QRect &r) } /*! - \qmlproperty bool LineEdit::smooth + \qmlproperty bool TextInput::smooth Set this property if you want the text to be smoothly scaled or transformed. Smooth filtering gives better visual quality, but is slower. If diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index 365c0e8..61850c3 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -339,7 +339,7 @@ QmlContext *QmlContext::parentContext() const } /*! - Add a default \a object to this context. The object will be added after + Add \a defaultObject to this context. The object will be added after any existing default objects. */ void QmlContext::addDefaultObject(QObject *defaultObject) @@ -417,7 +417,7 @@ void QmlContext::setContextProperty(const QString &name, QObject *value) Resolves the URL \a src relative to the URL of the containing component. - \sa QmlEngine::componentUrl(), setBaseUrl() + \sa QmlEngine::baseUrl(), setBaseUrl() */ QUrl QmlContext::resolvedUrl(const QUrl &src) { @@ -441,13 +441,12 @@ QUrl QmlContext::resolvedUrl(const QUrl &src) } /*! - Explicitly sets the url both resolveUri() and resolveUrl() will - use for relative references to \a baseUrl. + Explicitly sets the url resolveUrl() will use for relative references to \a baseUrl. Calling this function will override the url of the containing component used by default. - \sa resolvedUrl(), resolvedUri() + \sa resolvedUrl() */ void QmlContext::setBaseUrl(const QUrl &baseUrl) { diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 558bd49..52fd0b7 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -532,15 +532,6 @@ void QmlDeclarativeData::destroyed(QObject *object) delete this; } -/*! \internal */ -/* -QScriptEngine *QmlEngine::scriptEngine() -{ - Q_D(QmlEngine); - return &d->scriptEngine; -} -*/ - /*! Creates a QScriptValue allowing you to use \a object in QML script. \a engine is the QmlEngine it is to be created in. diff --git a/src/declarative/qml/qmlengine.h b/src/declarative/qml/qmlengine.h index 6066059..8caa505 100644 --- a/src/declarative/qml/qmlengine.h +++ b/src/declarative/qml/qmlengine.h @@ -74,7 +74,6 @@ public: void clearComponentCache(); - void addImportPath(const QString& dir); void setNetworkAccessManager(QNetworkAccessManager *); diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index e69746e..99f9f0c 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -540,10 +540,10 @@ QmlAbstractBinding *QmlMetaProperty::binding() const } /*! - Set the binding associated with this property to \a binding. Returns + Set the binding associated with this property to \a newBinding. Returns the existing binding (if any), otherwise 0. - \a binding will be enabled, and the returned binding (if any) will be + \a newBinding will be enabled, and the returned binding (if any) will be disabled. */ QmlAbstractBinding * diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 2c02cee..3acbf56 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -310,8 +310,8 @@ void QFxView::continueExecute() This signal is emitted when the view is resized to \a size. */ -/*! \fn void QFxView::error(const QList &errors) - This signal is emitted when the qml loaded contains errors. +/*! \fn void QFxView::errors(const QList &errors) + This signal is emitted when the qml loaded contains \a errors. */ /*! diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qfxview.h index 03557a3..25e2997 100644 --- a/src/declarative/util/qfxview.h +++ b/src/declarative/util/qfxview.h @@ -62,7 +62,8 @@ class QmlError; class QFxViewPrivate; class Q_DECLARATIVE_EXPORT QFxView : public QGraphicsView { -Q_OBJECT + Q_OBJECT + Q_PROPERTY(bool contentResizable READ contentResizable WRITE setContentResizable) public: explicit QFxView(QWidget *parent = 0); diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index f97bdbe..b02edec 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -251,45 +251,26 @@ span.string,span.char .qmlname { white-space: nowrap; - font-weight: bold; - font-size: 125%; } .qmltype { - font-weight: bold; - font-size: 125%; -} - -.qmlproto, .qmldoc { - // border-top: 1px solid #84b0c7; + // font-weight: bold; + text-align: center; + font-size: 160%; } .qmlproto { - padding: 0; - //background-color: #e4e4e4;//#d5e1e8; - //font-weight: bold; - //-webkit-border-top-left-radius: 8px; - //-webkit-border-top-right-radius: 8px; - //-moz-border-radius-topleft: 8px; - //-moz-border-radius-topright: 8px; + background-color: #eee; + border-width: 1px; + border-style: solid; + border-color: #ddd; + font-weight: bold; + padding: 6px 0px 6px 10px; + margin: 42px 0px 0px 0px; } .qmldoc { - border-top: 1px solid #e4e4e4; - //padding: 2px 5px; - //background-color: #eef3f5; - //border-top-width: 0; - //-webkit-border-bottom-left-radius: 8px; - //-webkit-border-bottom-right-radius: 8px; - //-moz-border-radius-bottomleft: 8px; - //-moz-border-radius-bottomright: 8px; -} - -.qmldoc p, .qmldoc dl, .qmldoc ul { - //margin: 6px 0; } *.qmlitem p { - //margin-top: 0px; - //margin-bottom: 0px; } -- cgit v0.12 From 544e175cd6063f293260f5cd8dbd3ca0a9cc7554 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 19 Aug 2009 15:27:27 +1000 Subject: Doc clarification --- src/declarative/fx/qfxmouseregion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/fx/qfxmouseregion.cpp b/src/declarative/fx/qfxmouseregion.cpp index 1da3c69..858764a 100644 --- a/src/declarative/fx/qfxmouseregion.cpp +++ b/src/declarative/fx/qfxmouseregion.cpp @@ -481,8 +481,8 @@ void QFxMouseRegion::timerEvent(QTimerEvent *event) \qmlproperty bool MouseRegion::containsMouse This property holds whether the mouse is currently inside the mouse region. - \warning This property is only partially implemented -- it is only valid when the mouse is moved over the - region. If the region moves under the mouse, \e containsMouse will not change. + \warning This property is not updated if the region moves under the mouse: \e containsMouse will not change. + In addition, if hoverEnabled is false, containsMouse will only be valid when the mouse is pressed. */ bool QFxMouseRegion::hovered() const { -- cgit v0.12 From b1e8d7aacf86e0ae5cb4910905c61dad434fe934 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 19 Aug 2009 15:40:20 +1000 Subject: installed imports test --- .../qmlparser/lib/com/nokia/installedtest/InstalledTest.qml | 2 ++ .../declarative/qmlparser/lib/com/nokia/installedtest/qmldir | 1 + tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 11 +++++++++++ 3 files changed, 14 insertions(+) create mode 100644 tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml create mode 100644 tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml new file mode 100644 index 0000000..65f0276 --- /dev/null +++ b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Rect {} diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir new file mode 100644 index 0000000..41e2f2c --- /dev/null +++ b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir @@ -0,0 +1 @@ +InstalledTest 1.0 InstalledTest.qml diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 258eaa1..5ed41ef 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -13,6 +13,8 @@ class tst_qmlparser : public QObject public: tst_qmlparser() { QmlMetaType::registerCustomStringConverter(qMetaTypeId(), myCustomVariantTypeConverter); + QFileInfo fileInfo(__FILE__); + engine.addImportPath(fileInfo.absoluteDir().filePath(QLatin1String("lib"))); } private slots: @@ -512,6 +514,7 @@ void tst_qmlparser::imports_data() QTest::addColumn("qml"); QTest::addColumn("type"); + // import built-ins QTest::newRow("missing import") << "Test {}" << ""; @@ -600,6 +603,8 @@ void tst_qmlparser::imports_data() "import com.nokia.Test 1.10 as T10\n" "T10.Test {}" << ""; + + // import locals QTest::newRow("local import") << "import \"subdir\"\n" "Test {}" @@ -617,6 +622,12 @@ void tst_qmlparser::imports_data() "import com.nokia.Test 1.0\n" "Test {}" << "TestType"; + + // import installed + QTest::newRow("installed import") + << "import com.nokia.installedtest 1.0\n" + "InstalledTest {}" + << "QFxRect"; } void tst_qmlparser::imports() -- cgit v0.12 From a48e06bc745afae421d9f91c7143dd1a49906c77 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 19 Aug 2009 15:40:41 +1000 Subject: tighten installed importing still not per-spec --- src/declarative/qml/qmlengine.cpp | 58 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 558bd49..a92ec0f 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1054,37 +1054,35 @@ struct QmlEnginePrivate::ImportedNamespace { QUrl url = QUrl(urls.at(i) + QLatin1String("/") + type + QLatin1String(".qml")); int vmaj = majversions.at(i); int vmin = minversions.at(i); - // XXX search non-files too! (eg. zip files, see QT-524) - QFileInfo f(url.toLocalFile()); - if (f.exists()) { - bool ok=true; - if (vmaj || vmin) { - QString version = QString::number(vmaj) + QLatin1String(".") + QString::number(vmin); - ok=false; - // Check version file - XXX cache these in QmlEngine! - QFile qmldir(urls.at(i)+QLatin1String("/qmldir")); - if (qmldir.open(QIODevice::ReadOnly)) { - do { - QString line = QString::fromUtf8(qmldir.readLine()); - if (line.at(0) == QLatin1Char('#')) - continue; - int space1 = line.indexOf(QLatin1Char(' ')); - int space2 = space1 >=0 ? line.indexOf(QLatin1Char(' '),space1+1) : -1; - QStringRef maptype = line.leftRef(space1); - QStringRef mapversion = line.midRef(space1+1,space2<0?line.length()-space1-2:space2-space1-1); - QStringRef mapfile = space2<0 ? QStringRef() : line.midRef(space2+1,line.length()-space2-2); - if (maptype==type && mapversion==version) { - if (mapfile.isEmpty()) - return url; - else - return url.resolved(mapfile.toString()); - } - } while (!qmldir.atEnd()); - } + if (vmaj || vmin) { + QString version = QString::number(vmaj) + QLatin1String(".") + QString::number(vmin); + // Check version file - XXX cache these in QmlEngine! + QFile qmldir(QUrl(urls.at(i)+QLatin1String("/qmldir")).toLocalFile()); + if (qmldir.open(QIODevice::ReadOnly)) { + do { + QString line = QString::fromUtf8(qmldir.readLine()); + if (line.at(0) == QLatin1Char('#')) + continue; + int space1 = line.indexOf(QLatin1Char(' ')); + int space2 = space1 >=0 ? line.indexOf(QLatin1Char(' '),space1+1) : -1; + QStringRef maptype = line.leftRef(space1); + QStringRef mapversion = line.midRef(space1+1,space2<0?line.length()-space1-2:space2-space1-1); + QStringRef mapfile = space2<0 ? QStringRef() : line.midRef(space2+1,line.length()-space2-2); + if (maptype==type && mapversion==version) { + if (mapfile.isEmpty()) + return url; + else + return url.resolved(mapfile.toString()); + } + } while (!qmldir.atEnd()); } - if (ok) - return url; + return QUrl(); // no match for requested version } + + // XXX search non-files too! (eg. zip files, see QT-524) + QFileInfo f(url.toLocalFile()); + if (f.exists()) + return url; // (unversioned) local import } return QUrl(); } @@ -1133,7 +1131,7 @@ public: foreach (QString p, importPath) { QString dir = p+QLatin1Char('/')+url; if (QFile::exists(dir+QLatin1String("/qmldir"))) { - url = dir; + url = QLatin1String("file://")+dir; found = true; break; } -- cgit v0.12 From 6cd5d7c2d94f55fd5cef8bdc077689ff652269d3 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 19 Aug 2009 15:55:43 +1000 Subject: update doc images --- doc/src/declarative/pics/horizontalLayout_example.png | Bin 292 -> 0 bytes .../declarative/pics/horizontalpositioner_example.png | Bin 0 -> 292 bytes doc/src/declarative/pics/layout-add.gif | Bin 7821 -> 0 bytes doc/src/declarative/pics/layout-move.gif | Bin 6154 -> 0 bytes doc/src/declarative/pics/layout-remove.gif | Bin 5610 -> 0 bytes doc/src/declarative/pics/positioner-add.gif | Bin 0 -> 7821 bytes doc/src/declarative/pics/positioner-move.gif | Bin 0 -> 6154 bytes doc/src/declarative/pics/positioner-remove.gif | Bin 0 -> 5610 bytes doc/src/declarative/pics/verticalLayout_example.png | Bin 385 -> 0 bytes doc/src/declarative/pics/verticalLayout_transition.gif | Bin 12641 -> 0 bytes doc/src/declarative/pics/verticalpositioner_example.png | Bin 0 -> 385 bytes .../declarative/pics/verticalpositioner_transition.gif | Bin 0 -> 12641 bytes 12 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc/src/declarative/pics/horizontalLayout_example.png create mode 100644 doc/src/declarative/pics/horizontalpositioner_example.png delete mode 100644 doc/src/declarative/pics/layout-add.gif delete mode 100644 doc/src/declarative/pics/layout-move.gif delete mode 100644 doc/src/declarative/pics/layout-remove.gif create mode 100644 doc/src/declarative/pics/positioner-add.gif create mode 100644 doc/src/declarative/pics/positioner-move.gif create mode 100644 doc/src/declarative/pics/positioner-remove.gif delete mode 100644 doc/src/declarative/pics/verticalLayout_example.png delete mode 100644 doc/src/declarative/pics/verticalLayout_transition.gif create mode 100644 doc/src/declarative/pics/verticalpositioner_example.png create mode 100644 doc/src/declarative/pics/verticalpositioner_transition.gif diff --git a/doc/src/declarative/pics/horizontalLayout_example.png b/doc/src/declarative/pics/horizontalLayout_example.png deleted file mode 100644 index 42f90ec..0000000 Binary files a/doc/src/declarative/pics/horizontalLayout_example.png and /dev/null differ diff --git a/doc/src/declarative/pics/horizontalpositioner_example.png b/doc/src/declarative/pics/horizontalpositioner_example.png new file mode 100644 index 0000000..42f90ec Binary files /dev/null and b/doc/src/declarative/pics/horizontalpositioner_example.png differ diff --git a/doc/src/declarative/pics/layout-add.gif b/doc/src/declarative/pics/layout-add.gif deleted file mode 100644 index 86e9247..0000000 Binary files a/doc/src/declarative/pics/layout-add.gif and /dev/null differ diff --git a/doc/src/declarative/pics/layout-move.gif b/doc/src/declarative/pics/layout-move.gif deleted file mode 100644 index 1825c22..0000000 Binary files a/doc/src/declarative/pics/layout-move.gif and /dev/null differ diff --git a/doc/src/declarative/pics/layout-remove.gif b/doc/src/declarative/pics/layout-remove.gif deleted file mode 100644 index 7086511..0000000 Binary files a/doc/src/declarative/pics/layout-remove.gif and /dev/null differ diff --git a/doc/src/declarative/pics/positioner-add.gif b/doc/src/declarative/pics/positioner-add.gif new file mode 100644 index 0000000..86e9247 Binary files /dev/null and b/doc/src/declarative/pics/positioner-add.gif differ diff --git a/doc/src/declarative/pics/positioner-move.gif b/doc/src/declarative/pics/positioner-move.gif new file mode 100644 index 0000000..1825c22 Binary files /dev/null and b/doc/src/declarative/pics/positioner-move.gif differ diff --git a/doc/src/declarative/pics/positioner-remove.gif b/doc/src/declarative/pics/positioner-remove.gif new file mode 100644 index 0000000..7086511 Binary files /dev/null and b/doc/src/declarative/pics/positioner-remove.gif differ diff --git a/doc/src/declarative/pics/verticalLayout_example.png b/doc/src/declarative/pics/verticalLayout_example.png deleted file mode 100644 index 458dc7f..0000000 Binary files a/doc/src/declarative/pics/verticalLayout_example.png and /dev/null differ diff --git a/doc/src/declarative/pics/verticalLayout_transition.gif b/doc/src/declarative/pics/verticalLayout_transition.gif deleted file mode 100644 index ed61adb..0000000 Binary files a/doc/src/declarative/pics/verticalLayout_transition.gif and /dev/null differ diff --git a/doc/src/declarative/pics/verticalpositioner_example.png b/doc/src/declarative/pics/verticalpositioner_example.png new file mode 100644 index 0000000..458dc7f Binary files /dev/null and b/doc/src/declarative/pics/verticalpositioner_example.png differ diff --git a/doc/src/declarative/pics/verticalpositioner_transition.gif b/doc/src/declarative/pics/verticalpositioner_transition.gif new file mode 100644 index 0000000..ed61adb Binary files /dev/null and b/doc/src/declarative/pics/verticalpositioner_transition.gif differ -- cgit v0.12 From 8311cdfcd522edaa37ba8dac2968998231cf9bed Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 19 Aug 2009 15:56:21 +1000 Subject: update TextInput documentation --- src/declarative/fx/qfxtextinput.cpp | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp index eb6c5bf..164739f 100644 --- a/src/declarative/fx/qfxtextinput.cpp +++ b/src/declarative/fx/qfxtextinput.cpp @@ -53,8 +53,8 @@ QML_DEFINE_NOCREATE_TYPE(QValidator); QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QIntValidator,QIntValidator); /*! - \qmlclass LineEdit - The LineEdit item allows you to add an editable line of text to a scene. + \qmlclass TextInput + The TextInput item allows you to add an editable line of text to a scene. */ QFxTextInput::QFxTextInput(QFxItem* parent) : QFxPaintedItem(*(new QFxTextInputPrivate), parent) @@ -78,9 +78,9 @@ QFxTextInput::~QFxTextInput() } /*! - \qmlproperty string LineEdit::text + \qmlproperty string TextInput::text - The text in the LineEdit. + The text in the TextInput. */ QString QFxTextInput::text() const @@ -99,9 +99,9 @@ void QFxTextInput::setText(const QString &s) } /*! - \qmlproperty font LineEdit::font + \qmlproperty font TextInput::font - Set the LineEdit's font attributes. \c font.size sets the font's point size. + Set the TextInput's font attributes. \c font.size sets the font's point size. */ QFont QFxTextInput::font() const { @@ -125,7 +125,7 @@ void QFxTextInput::setFont(const QFont &font) } /*! - \qmlproperty color LineEdit::color + \qmlproperty color TextInput::color The text color. */ @@ -143,7 +143,7 @@ void QFxTextInput::setColor(const QColor &c) /*! - \qmlproperty color LineEdit::highlightColor + \qmlproperty color TextInput::highlightColor The text highlight color, used behind selections. */ @@ -164,7 +164,7 @@ void QFxTextInput::setHighlightColor(const QColor &color) } /*! - \qmlproperty color LineEdit::highlightedTextColor + \qmlproperty color TextInput::highlightedTextColor The highlighted text color, used in selections. */ @@ -222,7 +222,7 @@ void QFxTextInput::setMaxLength(int ml) } /*! - \qmlproperty bool LineEdit::cursorVisible + \qmlproperty bool TextInput::cursorVisible If true the text edit shows a cursor. This property is set and unset when the line edit gets focus, but it can also @@ -245,8 +245,8 @@ void QFxTextInput::setCursorVisible(bool on) } /*! - \qmlproperty int LineEdit::cursorPosition - The position of the cursor in the LineEdit. + \qmlproperty int TextInput::cursorPosition + The position of the cursor in the TextInput. */ int QFxTextInput::cursorPosition() const { @@ -260,7 +260,7 @@ void QFxTextInput::setCursorPosition(int cp) } /*! - \qmlproperty int LineEdit::selectionStart + \qmlproperty int TextInput::selectionStart The cursor position before the first character in the current selection. Setting this and selectionEnd allows you to specify a selection in the @@ -288,7 +288,7 @@ void QFxTextInput::setSelectionStart(int s) } /*! - \qmlproperty int LineEdit::selectionEnd + \qmlproperty int TextInput::selectionEnd The cursor position after the last character in the current selection. Setting this and selectionStart allows you to specify a selection in the @@ -369,12 +369,12 @@ void QFxTextInput::setEchoMode(uint echo) } /*! - \qmlproperty Component LineEdit::cursorDelegate - The delegate for the cursor in the LineEdit. + \qmlproperty Component TextInput::cursorDelegate + The delegate for the cursor in the TextInput. - If you set a cursorDelegate for a LineEdit, this delegate will be used for + If you set a cursorDelegate for a TextInput, this delegate will be used for drawing the cursor instead of the standard cursor. An instance of the - delegate will be created and managed by the LineEdit when a cursor is + delegate will be created and managed by the TextInput when a cursor is needed, and the x property of delegate instance will be set so as to be one pixel before the top left of the current character. @@ -522,7 +522,7 @@ void QFxTextInput::selectAll() /*! - \qmlproperty bool LineEdit::smooth + \qmlproperty bool TextInput::smooth Set this property if you want the text to be smoothly scaled or transformed. Smooth filtering gives better visual quality, but is slower. If -- cgit v0.12 From df5662fb8b447f067d2dfa6b37e4d798899d1ebb Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 19 Aug 2009 15:56:56 +1000 Subject: update documentation --- doc/src/declarative/elements.qdoc | 16 +++++++++------- src/declarative/util/qmlpalette.cpp | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 3f74ff5..c71ac1b 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -1,4 +1,4 @@ -/*! +/*! \page elements.html \target elements \title Qml Elements @@ -71,11 +71,12 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \list \o \l Item +\o \l Rect \o \l Image +\o \l BorderImage \o \l Text +\o \l TextInput \o \l TextEdit -\o \l Rect -\o \l AnimatedImage \endlist \o @@ -96,13 +97,14 @@ The following table lists the Qml elements provided by the Qt Declarative module \list \o \l Loader \o \l Repeater +\o \l Palette \o \l ComponentInstance \o \l GraphicsObjectContainer \endlist \header \o \bold {Views} -\o \bold {Layouts} +\o \bold {Positioners} \o \bold {Transforms} \o \bold {Effects} @@ -128,9 +130,9 @@ The following table lists the Qml elements provided by the Qt Declarative module \o \list -\o \l VerticalLayout -\o \l HorizontalLayout -\o \l GridLayout +\o \l VerticalPositioner +\o \l HorizontalPositioner +\o \l GridPositioner \endlist \o diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp index e714bc7..d500986 100644 --- a/src/declarative/util/qmlpalette.cpp +++ b/src/declarative/util/qmlpalette.cpp @@ -62,7 +62,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Palette,QmlPalette) Example: \code - Palette { id: MyPalette; colorGroup: "Active" } + Palette { id: MyPalette; colorGroup: Qt.Active } Rect { width: 640; height: 480 -- cgit v0.12 From eeb66cd4a8939cd54b890eb511d99f4a62d3f423 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 19 Aug 2009 15:56:56 +1000 Subject: Use range semantics for versions. Meets spec QT-558 --- src/declarative/qml/qmlengine.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index a92ec0f..5902c99 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -1055,7 +1055,6 @@ struct QmlEnginePrivate::ImportedNamespace { int vmaj = majversions.at(i); int vmin = minversions.at(i); if (vmaj || vmin) { - QString version = QString::number(vmaj) + QLatin1String(".") + QString::number(vmin); // Check version file - XXX cache these in QmlEngine! QFile qmldir(QUrl(urls.at(i)+QLatin1String("/qmldir")).toLocalFile()); if (qmldir.open(QIODevice::ReadOnly)) { @@ -1066,23 +1065,29 @@ struct QmlEnginePrivate::ImportedNamespace { int space1 = line.indexOf(QLatin1Char(' ')); int space2 = space1 >=0 ? line.indexOf(QLatin1Char(' '),space1+1) : -1; QStringRef maptype = line.leftRef(space1); - QStringRef mapversion = line.midRef(space1+1,space2<0?line.length()-space1-2:space2-space1-1); - QStringRef mapfile = space2<0 ? QStringRef() : line.midRef(space2+1,line.length()-space2-2); - if (maptype==type && mapversion==version) { - if (mapfile.isEmpty()) - return url; - else - return url.resolved(mapfile.toString()); + if (maptype==type) { + // eg. 1.2-5 + QString mapversions = line.mid(space1+1,space2<0?line.length()-space1-2:space2-space1-1); + int dot = mapversions.indexOf(QLatin1Char('.')); + int dash = mapversions.indexOf(QLatin1Char('-')); + int mapvmaj = mapversions.left(dot).toInt(); + if (mapvmaj==vmaj) { + int mapvmin_from = (dash <= 0 ? mapversions.mid(dot+1) : mapversions.mid(dot+1,dash-dot-1)).toInt(); + int mapvmin_to = dash <= 0 ? mapvmin_from : mapversions.mid(dash+1).toInt(); + if (vmin >= mapvmin_from && vmin <= mapvmin_to) { + QStringRef mapfile = space2<0 ? QStringRef() : line.midRef(space2+1,line.length()-space2-2); + return url.resolved(mapfile.toString()); + } + } } } while (!qmldir.atEnd()); } - return QUrl(); // no match for requested version + } else { + // XXX search non-files too! (eg. zip files, see QT-524) + QFileInfo f(url.toLocalFile()); + if (f.exists()) + return url; // (unversioned) local import } - - // XXX search non-files too! (eg. zip files, see QT-524) - QFileInfo f(url.toLocalFile()); - if (f.exists()) - return url; // (unversioned) local import } return QUrl(); } -- cgit v0.12 From 2eb1aba797f9380b4622575a3ef9c409e3b35036 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Wed, 19 Aug 2009 15:57:47 +1000 Subject: More installed version test --- .../qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml | 2 ++ tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir | 3 ++- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml new file mode 100644 index 0000000..a0706ad --- /dev/null +++ b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/InstalledTest2.qml @@ -0,0 +1,2 @@ +import Qt 4.6 +Text {} diff --git a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir index 41e2f2c..f22e179 100644 --- a/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir +++ b/tests/auto/declarative/qmlparser/lib/com/nokia/installedtest/qmldir @@ -1 +1,2 @@ -InstalledTest 1.0 InstalledTest.qml +InstalledTest 1.0-3 InstalledTest.qml +InstalledTest 1.4 InstalledTest2.qml diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 5ed41ef..9974ef8 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -628,6 +628,10 @@ void tst_qmlparser::imports_data() << "import com.nokia.installedtest 1.0\n" "InstalledTest {}" << "QFxRect"; + QTest::newRow("installed import") + << "import com.nokia.installedtest 1.4\n" + "InstalledTest {}" + << "QFxText"; } void tst_qmlparser::imports() -- cgit v0.12