From bb8ba98542e1ed363d4218b9a9a4e68a6c4b5337 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 6 Oct 2010 11:26:23 +1000 Subject: Create Loader components in correct context Task-number: QTBUG-13481 --- src/declarative/graphicsitems/qdeclarativeloader.cpp | 4 +++- .../qdeclarativeloader/data/CreationContextLoader.qml | 15 +++++++++++++++ .../qdeclarativeloader/data/creationContext.qml | 8 ++++++++ .../qdeclarativeloader/tst_qdeclarativeloader.cpp | 14 ++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml create mode 100644 tests/auto/declarative/qdeclarativeloader/data/creationContext.qml diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 1066c2b..5647b14 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -337,7 +337,9 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() return; } - QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q)); + QDeclarativeContext *creationContext = component->creationContext(); + if (!creationContext) creationContext = qmlContext(q); + QDeclarativeContext *ctxt = new QDeclarativeContext(creationContext); ctxt->setContextObject(q); QDeclarativeComponent *c = component; diff --git a/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml new file mode 100644 index 0000000..bfc9a8d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml @@ -0,0 +1,15 @@ +import QtQuick 1.0 + +Loader { + id: myLoader + property int testProperty: 1912 + sourceComponent: loaderComponent + Component { + id: loaderComponent + Item { + Component.onCompleted: { + test = (myLoader.testProperty == 1912); + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml new file mode 100644 index 0000000..5297978 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +Item { + property bool test: false + + CreationContextLoader { + } +} diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 8d04616..1bde55b 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -89,6 +89,7 @@ private slots: void deleteComponentCrash(); void nonItem(); void vmeErrors(); + void creationContext(); private: QDeclarativeEngine engine; @@ -562,6 +563,19 @@ void tst_QDeclarativeLoader::vmeErrors() delete loader; } +// QTBUG-13481 +void tst_QDeclarativeLoader::creationContext() +{ + QDeclarativeComponent component(&engine, TEST_FILE("creationContext.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test").toBool(), true); + + delete o; +} + QTEST_MAIN(tst_QDeclarativeLoader) #include "tst_qdeclarativeloader.moc" -- cgit v0.12 From 0030599cbe39c9fc7d6f2632b4e66a54b1b46417 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 6 Oct 2010 13:59:19 +1000 Subject: Ensure PathView updates positions when path changes. Fixes regression caused by optimization added in commit 35a51442ed21f58c06b21293eeb56e843251ee82. Task-number: QTBUG-14239 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 17 +++++++++++++++-- src/declarative/graphicsitems/qdeclarativepathview_p.h | 1 + .../qdeclarativepathview/data/pathUpdate.qml | 18 ++++++++++++++++++ .../qdeclarativepathview/tst_qdeclarativepathview.cpp | 18 ++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index d134929..3ae8788 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -300,6 +300,19 @@ void QDeclarativePathViewPrivate::setHighlightPosition(qreal pos) } } +void QDeclarativePathView::pathUpdated() +{ + Q_D(QDeclarativePathView); + QList::iterator it = d->items.begin(); + while (it != d->items.end()) { + QDeclarativeItem *item = *it; + if (QDeclarativePathViewAttached *att = d->attached(item)) + att->m_percent = -1; + ++it; + } + refill(); +} + void QDeclarativePathViewPrivate::updateItem(QDeclarativeItem *item, qreal percent) { if (QDeclarativePathViewAttached *att = attached(item)) { @@ -526,9 +539,9 @@ void QDeclarativePathView::setPath(QDeclarativePath *path) if (d->path == path) return; if (d->path) - disconnect(d->path, SIGNAL(changed()), this, SLOT(refill())); + disconnect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated())); d->path = path; - connect(d->path, SIGNAL(changed()), this, SLOT(refill())); + connect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated())); if (d->isValid() && isComponentComplete()) { d->clear(); if (d->attType) { diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h index 62a8c44..7775b1c 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h @@ -186,6 +186,7 @@ private Q_SLOTS: void modelReset(); void createdItem(int index, QDeclarativeItem *item); void destroyingItem(QDeclarativeItem *item); + void pathUpdated(); private: friend class QDeclarativePathViewAttached; diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml new file mode 100644 index 0000000..0c99e7f --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml @@ -0,0 +1,18 @@ +import Qt 4.7 + +Rectangle { + width: 400 + height: 400 + + PathView { + id: view + objectName: "pathView" + anchors.fill: parent + model: 10 + delegate: Rectangle { objectName: "wrapper"; color: "green"; width: 100; height: 100 } + path: Path { + startX: view.width/2; startY: 0 + PathLine { x: view.width/2; y: view.height } + } + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 65007a6..3a2a577 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -86,6 +86,7 @@ private slots: void package(); void emptyModel(); void closed(); + void pathUpdate(); private: QDeclarativeView *createView(); @@ -808,6 +809,23 @@ void tst_QDeclarativePathView::closed() } } +// QTBUG-14239 +void tst_QDeclarativePathView::pathUpdate() +{ + QDeclarativeView *canvas = createView(); + QVERIFY(canvas); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdate.qml")); + + QDeclarativePathView *pathView = canvas->rootObject()->findChild("pathView"); + QVERIFY(pathView); + + QDeclarativeItem *item = findItem(pathView, "wrapper", 0); + QVERIFY(item); + QCOMPARE(item->x(), 150.0); + + delete canvas; +} + QDeclarativeView *tst_QDeclarativePathView::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); -- cgit v0.12 From 4647f24469ec93b3b66628472af5462fbe957439 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 6 Oct 2010 12:41:16 +1000 Subject: Update QtGui def files --- src/s60installs/bwins/QtGuiu.def | 5 ++++- src/s60installs/eabi/QtGuiu.def | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 9a61523..7cc2752 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12892,5 +12892,8 @@ EXPORTS ?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12891 NONAME ; void QTapAndHoldGesture::setTimeout(int) ?qmljsDebugArguments@QApplicationPrivate@@2VQString@@A @ 12892 NONAME ; class QString QApplicationPrivate::qmljsDebugArguments ?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@PAVQGraphicsItem@@@Z @ 12893 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(class QGraphicsItem *) const - ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12894 NONAME ; class QString QFont::lastResortFont(void) const + ?maxTextureHeight@QTextureGlyphCache@@UBEHXZ @ 12894 NONAME ; int QTextureGlyphCache::maxTextureHeight(void) const + ?maxTextureWidth@QTextureGlyphCache@@UBEHXZ @ 12895 NONAME ; int QTextureGlyphCache::maxTextureWidth(void) const + ?convertToPostscriptFontFamilyName@QFontEngine@@SA?AVQByteArray@@ABV2@@Z @ 12896 NONAME ; class QByteArray QFontEngine::convertToPostscriptFontFamilyName(class QByteArray const &) + ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12897 NONAME ; class QString QFont::lastResortFont(void) const diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 634b7af..4e867a3 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12098,4 +12098,5 @@ EXPORTS _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFP13QGraphicsItem @ 12097 NONAME _ZNK20QGraphicsItemPrivate21effectiveBoundingRectEP13QGraphicsItem @ 12098 NONAME _ZNK5QFont14lastResortFontEv @ 12099 NONAME + _ZN11QFontEngine33convertToPostscriptFontFamilyNameERK10QByteArray @ 12100 NONAME -- cgit v0.12 From 695b54e671b55bd8103dee8b30ee76309dbd26c1 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 6 Oct 2010 14:01:56 +1000 Subject: Fix minehunt execution from QtDemo Task-number: QTBUG-14250 Reviewed-by: Martin Jones --- demos/declarative/minehunt/main.cpp | 2 +- demos/declarative/minehunt/minehunt.pro | 1 + demos/declarative/minehunt/minehunt.qrc | 20 ++++++++++++++++++++ demos/qtdemo/menumanager.cpp | 1 + demos/qtdemo/xml/examples.xml | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 demos/declarative/minehunt/minehunt.qrc diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp index 8bbaee9..2b286ef 100644 --- a/demos/declarative/minehunt/main.cpp +++ b/demos/declarative/minehunt/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView); #endif canvas.engine()->rootContext()->setContextObject(game); - canvas.setSource(QString("minehunt.qml")); + canvas.setSource(QString("qrc:minehunt.qml")); QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit())); #ifdef Q_OS_SYMBIAN diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 7a491ab..753ca4e 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -6,6 +6,7 @@ CONFIG += qt plugin # Input HEADERS += minehunt.h SOURCES += main.cpp minehunt.cpp +RESOURCES = minehunt.qrc sources.files = minehunt.qml minehunt.pro MinehuntCore sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt diff --git a/demos/declarative/minehunt/minehunt.qrc b/demos/declarative/minehunt/minehunt.qrc new file mode 100644 index 0000000..fa8e27d --- /dev/null +++ b/demos/declarative/minehunt/minehunt.qrc @@ -0,0 +1,20 @@ + + + minehunt.qml + MinehuntCore/Explosion.qml + MinehuntCore/Tile.qml + MinehuntCore/qmldir + MinehuntCore/pics/background.png + MinehuntCore/pics/back.png + MinehuntCore/pics/bomb-color.png + MinehuntCore/pics/bomb.png + MinehuntCore/pics/face-sad.png + MinehuntCore/pics/face-smile-big.png + MinehuntCore/pics/face-smile.png + MinehuntCore/pics/flag-color.png + MinehuntCore/pics/flag.png + MinehuntCore/pics/front.png + MinehuntCore/pics/quit.png + MinehuntCore/pics/star.png + + diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp index fe3c5aa..ea9146e 100644 --- a/demos/qtdemo/menumanager.cpp +++ b/demos/qtdemo/menumanager.cpp @@ -518,6 +518,7 @@ QString MenuManager::resolveExeFile(const QString &name) dir.cd(dirName); dir.cd(fileName); + fileName = fileName.split("/").last(); QFile unixFile(dir.path() + "/" + fileName); if (unixFile.exists()) return unixFile.fileName(); QFile winR(dir.path() + "\\release\\" + fileName + ".exe"); diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index 0ab048e..27f72bb 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -18,7 +18,7 @@ - + -- cgit v0.12 From cd4389efee184d2ad65b52c5ef64793868f1a004 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 6 Oct 2010 15:12:46 +1000 Subject: Ensure the TextInput cursor blinks immediately when enabled. Previously we relied on cursorPosChanged being called to do the update, but that isn't called in all circumstances. Now we explicitly update when the cursor is enabled or disabled. Task-number: QTBUG-13993 --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 4817999..637dd77 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -417,7 +417,11 @@ void QDeclarativeTextInput::setCursorVisible(bool on) return; d->cursorVisible = on; d->control->setCursorBlinkPeriod(on?QApplication::cursorFlashTime():0); - //d->control should emit the cursor update regions + QRect r = d->control->cursorRect(); + if (d->control->inputMask().isEmpty()) + updateRect(r); + else + updateRect(); emit cursorVisibleChanged(d->cursorVisible); } -- cgit v0.12 From 8209815ee6eea3cbc1ca7b71ce8b68ae8930c0bd Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 6 Oct 2010 15:38:39 +1000 Subject: Autotest Task-number: QTBUG-14089 --- .../data/aliasPropertyChangeSignals.qml | 16 ++++++++++++++++ .../qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml new file mode 100644 index 0000000..7944deb --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml @@ -0,0 +1,16 @@ +import QtQuick 1.0 + +QtObject { + id: root + + property alias aliasProperty: root.realProperty + onAliasPropertyChanged: root.test = true + + property int realProperty: 0 + + property bool test: false + + Component.onCompleted: { + root.realProperty = 10; + } +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 8609a7e..3c82fc5 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -119,6 +119,7 @@ private slots: void cppnamespace(); void aliasProperties(); void aliasPropertiesAndSignals(); + void aliasPropertyChangeSignals(); void componentCompositeType(); void i18n(); void i18n_data(); @@ -1816,6 +1817,20 @@ void tst_qdeclarativelanguage::initTestCase() out.write(in.readAll()); } +void tst_qdeclarativelanguage::aliasPropertyChangeSignals() +{ + QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.qml")); + + VERIFY_ERRORS(0); + QObject *o = component.create(); + QVERIFY(o != 0); + + QEXPECT_FAIL("", "QTBUG-14089", Abort); + QCOMPARE(o->property("test").toBool(), true); + + delete o; +} + QTEST_MAIN(tst_qdeclarativelanguage) #include "tst_qdeclarativelanguage.moc" -- cgit v0.12 From 9d2078629b54a44defda7fa491824df437ffea11 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 6 Oct 2010 17:43:22 +1000 Subject: Allow default QApplication::startDragDistance() to be defined in platformdefs.h Task-number: QT-3930 Reviewed-by: Joona Petrell --- src/gui/kernel/qapplication.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index fdacefc..3323fbc 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -477,11 +477,14 @@ bool Q_GUI_EXPORT qt_tab_all_widgets = true; bool qt_in_tab_key_event = false; int qt_antialiasing_threshold = -1; static int drag_time = 500; +#ifndef QT_GUI_DRAG_DISTANCE +#define QT_GUI_DRAG_DISTANCE 4 +#endif #ifdef Q_OS_SYMBIAN // The screens are a bit too small to for your thumb when using only 4 pixels drag distance. -static int drag_distance = 12; +static int drag_distance = 12; //XXX move to qplatformdefs.h #else -static int drag_distance = 4; +static int drag_distance = QT_GUI_DRAG_DISTANCE; #endif static Qt::LayoutDirection layout_direction = Qt::LeftToRight; QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut -- cgit v0.12 From 7d79beeb4c88d4e5fb8d7aecd8dd07419b465f55 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 6 Oct 2010 17:55:15 +1000 Subject: Set reasonable QT_GUI_DRAG_DISTANCE in mkspecs/linux-g++-maemo/qplatformdefs.h Task-number: QT-3930 --- mkspecs/linux-g++-maemo/qplatformdefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/linux-g++-maemo/qplatformdefs.h b/mkspecs/linux-g++-maemo/qplatformdefs.h index d7feb9e..df6152a 100644 --- a/mkspecs/linux-g++-maemo/qplatformdefs.h +++ b/mkspecs/linux-g++-maemo/qplatformdefs.h @@ -42,3 +42,4 @@ #include "../linux-g++/qplatformdefs.h" #define QT_GUI_DOUBLE_CLICK_RADIUS 20 +#define QT_GUI_DRAG_DISTANCE 16 -- cgit v0.12 From 651135cf53aacc4f580cc382b8192bd313366ed8 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 6 Oct 2010 18:52:44 +1000 Subject: Do not show 'More' button when in fullscreen view. Task-number: QTBUG-11813 --- demos/declarative/flickr/mobile/ImageDetails.qml | 2 ++ demos/declarative/flickr/mobile/ToolBar.qml | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 5dd3b4e..9d1464e 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -172,6 +172,8 @@ Flipable { states: State { name: "Back" PropertyChanges { target: itemRotation; angle: 180 } + PropertyChanges { target: toolBar; button2Visible: false } + PropertyChanges { target: toolBar; button1Label: "Back" } } transitions: Transition { diff --git a/demos/declarative/flickr/mobile/ToolBar.qml b/demos/declarative/flickr/mobile/ToolBar.qml index 55f19d2..d8abb14 100644 --- a/demos/declarative/flickr/mobile/ToolBar.qml +++ b/demos/declarative/flickr/mobile/ToolBar.qml @@ -46,20 +46,24 @@ Item { property alias button1Label: button1.text property alias button2Label: button2.text + property alias button2Visible: button2.visible + signal button1Clicked signal button2Clicked BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } - Button { - id: button1 - anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32 - onClicked: toolbar.button1Clicked() - } + Row { + anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30 + Button { + id: button1 + width: 140; height: 32 + onClicked: toolbar.button1Clicked() + } - Button { - id: button2 - anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32 - onClicked: toolbar.button2Clicked() + Button { + id: button2; width: 140; height: 32 + onClicked: toolbar.button2Clicked() + } } } -- cgit v0.12 From f532679ca11914b453e22342f2ae5e9f790ce47a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 6 Oct 2010 11:48:24 +0200 Subject: Fixes assert in QDeclarativeWebView If QDeclarativeWebView was instantiated twice an assert was triggered by QWebSettings::enablePersistentStorage(); This patch is crtical for tooling (Bauhaus) Task-number: QTBUG-14278 Reviewed-by: Aaron Kennedy --- src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp index 94f08bd..e4f70de 100644 --- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -249,7 +249,11 @@ void QDeclarativeWebView::init() { d = new QDeclarativeWebViewPrivate(this); - QWebSettings::enablePersistentStorage(); + if (QWebSettings::iconDatabasePath().isNull() && + QWebSettings::globalSettings()->localStoragePath().isNull() && + QWebSettings::offlineStoragePath().isNull() && + QWebSettings::offlineWebApplicationCachePath().isNull()) + QWebSettings::enablePersistentStorage(); setAcceptedMouseButtons(Qt::LeftButton); setFlag(QGraphicsItem::ItemHasNoContents, true); -- cgit v0.12 From 9d574d9c6bed5b4528415402a9f2f68ab5de8009 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 7 Oct 2010 08:30:18 +1000 Subject: Update import statement. --- tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml index 0c99e7f..0c2ac0c 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 1.0 Rectangle { width: 400 -- cgit v0.12 From d97692f1eb18cb85830493be2e8d22fc00a85edf Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 7 Oct 2010 09:39:28 +1000 Subject: Rename toolbar button. Task-number: QT-3637 --- demos/declarative/flickr/flickr.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 1533c04..740ee35 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -109,7 +109,7 @@ Item { states: State { name: "DetailedView" PropertyChanges { target: views; x: -parent.width } - PropertyChanges { target: toolBar; button1Label: "More..." } + PropertyChanges { target: toolBar; button1Label: "View..." } PropertyChanges { target: toolBar onButton1Clicked: if (imageDetails.state=='') imageDetails.state='Back'; else imageDetails.state='' -- cgit v0.12 From 0ed462973acc683882ac30ae6959340564f305a3 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 7 Oct 2010 10:37:50 +1000 Subject: Fix setting PathView offset when all visible items are removed. If we remove all items then we don't have a valid firstIndex with which to anchor item positions, so just use offset. Task-number: QTBUG-14199 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 2 ++ .../qdeclarativepathview/tst_qdeclarativepathview.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 3ae8788..31943b2 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -1331,6 +1331,8 @@ void QDeclarativePathView::refill() if (idx >= d->modelCount) idx = 0; } + if (!d->items.count()) + d->firstIndex = -1; if (d->modelCount) { // add items to beginning and end diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 3a2a577..a2a5363 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -351,6 +351,10 @@ void tst_QDeclarativePathView::dataModel() model.addItem("yellow", "7"); model.addItem("thistle", "8"); model.addItem("cyan", "9"); + model.addItem("peachpuff", "10"); + model.addItem("powderblue", "11"); + model.addItem("gold", "12"); + model.addItem("sandybrown", "13"); ctxt->setContextProperty("testData", &model); @@ -371,7 +375,7 @@ void tst_QDeclarativePathView::dataModel() model.insertItem(4, "orange", "10"); QTest::qWait(100); - QTRY_COMPARE(findItems(pathview, "wrapper").count(), 10); + QTRY_COMPARE(findItems(pathview, "wrapper").count(), 14); QVERIFY(pathview->currentIndex() == 0); @@ -420,6 +424,11 @@ void tst_QDeclarativePathView::dataModel() QVERIFY(item->property("onPath").toBool()); } + // QTBUG-14199 + pathview->setOffset(7); + pathview->setOffset(0); + QCOMPARE(findItems(pathview, "wrapper").count(), 5); + delete canvas; } -- cgit v0.12 From 591695490b9ed7f1cd31e03e067a5962d6aadcee Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 7 Oct 2010 10:50:54 +1000 Subject: Doc fix. --- src/declarative/graphicsitems/qdeclarativerepeater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 00f2848..cb64212 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -134,13 +134,13 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() create items as they are required. Also, note that Repeater is \l {Item}-based, and can only repeat \l {Item}-derived objects. - For example, it cannot be used to repeat QObjects: + For example, it cannot be used to repeat QtObjects: \badcode Item { - //XXX does not work! Can't repeat QObject as it doesn't derive from Item. + //XXX does not work! Can't repeat QtObject as it doesn't derive from Item. Repeater { model: 10 - QObject {} + QtObject {} } } \endcode -- cgit v0.12