diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-05-05 03:13:40 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-05-05 03:13:40 (GMT) |
commit | fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4 (patch) | |
tree | b16e2cfd90d7e996f79f7e3020a4c4ae7b44c970 /src | |
parent | a5d15c36ae3db3caff4eeb86fd7eb5cdbb928f2d (diff) | |
parent | 99502731c6f093c8db82189d46b949657ad83b25 (diff) | |
download | Qt-fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4.zip Qt-fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4.tar.gz Qt-fde6b4cc1e720ae655ccac9d7f83c7d2dc4badc4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src')
30 files changed, 500 insertions, 316 deletions
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index c750e67..b6feeb1 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -8941bee5706ef2171ed5def63834deefc7440d11 +992e57ee469bd8c6a2afef6b15896a161ab8aeb3 diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 23cae67..c3d6314 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from and has the sha1 checksum - 540ae4ccd25609e1bfe1673195ce126255e36774 + 3f0f51f4c87e65bfe04165c6af4c00934b0ca1e2 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index b8825bd..05fc2af 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,36 @@ +2010-05-03 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix qtlibraryinfix not to contain space + + List catenation with += adds whitespace cutting the infix + from the final target. + + * WebCore.pro: + +2010-05-03 Thomas Zander <t.zander@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix library infix usage when compiling inside of Qt + + Don't apply the infix when building inside Qt, as that's done through the + inclusion of qbase.pri. + + * WebCore.pro: + +2010-04-29 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit versioning added + https://bugs.webkit.org/show_bug.cgi?id=37207 + + QtWebkit releases separated from Qt release cycle. + + * WebCore.pro: + 2010-03-27 Robert Hogan <robert@webkit.org> Reviewed by nobody, fix typo in previous commit. diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 2a64982..3d57562 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -69,13 +69,13 @@ CONFIG(standalone_package) { CONFIG(QTDIR_build) { include($$QT_SOURCE_TREE/src/qbase.pri) - # Qt will set the version for us when building in Qt's tree } else { - VERSION = $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} DESTDIR = $$OUTPUT_DIR/lib !static: DEFINES += QT_MAKEDLL - symbian: TARGET +=$${QT_LIBINFIX} + symbian: TARGET =$$TARGET$${QT_LIBINFIX} } +include($$PWD/../WebKit/qt/qtwebkit_version.pri) +VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION} unix { QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index 3c86770..1efae16 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -292,6 +292,7 @@ void QGraphicsWebViewPrivate::update(const QRect & dirtyRect) if (overlay) overlay->update(QRectF(dirtyRect)); #if USE(ACCELERATED_COMPOSITING) + updateCompositingScrollPosition(); syncLayers(); #endif } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index f28524a..b8b50b7 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -3191,233 +3191,255 @@ QWebPluginFactory *QWebPage::pluginFactory() const \o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version. \endlist */ -QString QWebPage::userAgentForUrl(const QUrl& url) const +QString QWebPage::userAgentForUrl(const QUrl&) const { - Q_UNUSED(url) - QString ua = QLatin1String("Mozilla/5.0 (" + // splitting the string in three and user QStringBuilder is better than using QString::arg() + static QString firstPart; + static QString secondPart; + static QString thirdPart; + + if (firstPart.isNull() || secondPart.isNull() || thirdPart.isNull()) { + QString firstPartTemp; + firstPartTemp.reserve(150); + firstPartTemp += QString::fromLatin1("Mozilla/5.0 (" // Platform #ifdef Q_WS_MAC - "Macintosh" + "Macintosh" #elif defined Q_WS_QWS - "QtEmbedded" + "QtEmbedded" #elif defined Q_WS_WIN - "Windows" + "Windows" #elif defined Q_WS_X11 - "X11" + "X11" #elif defined Q_OS_SYMBIAN - "SymbianOS" + "SymbianOS" #else - "Unknown" + "Unknown" #endif - // Placeholder for Platform Version - "%1; " + ); + + firstPartTemp += QString::fromLatin1("; "); - // Placeholder for security strength (N or U) - "%2; " + // SSL support +#if !defined(QT_NO_OPENSSL) + // we could check QSslSocket::supportsSsl() here, but this makes + // OpenSSL, certificates etc being loaded in all cases were QWebPage + // is used. This loading is not needed for non-https. + firstPartTemp += QString::fromLatin1("U; "); + // this may lead to a false positive: We indicate SSL since it is + // compiled in even though supportsSsl() might return false +#else + firstPartTemp += QString::fromLatin1("N; "); +#endif - // Subplatform" + // Operating system #ifdef Q_OS_AIX - "AIX" + firstPartTemp += QString::fromLatin1("AIX"); #elif defined Q_OS_WIN32 - "%3" + + switch (QSysInfo::WindowsVersion) { + case QSysInfo::WV_32s: + firstPartTemp += QString::fromLatin1("Windows 3.1"); + break; + case QSysInfo::WV_95: + firstPartTemp += QString::fromLatin1("Windows 95"); + break; + case QSysInfo::WV_98: + firstPartTemp += QString::fromLatin1("Windows 98"); + break; + case QSysInfo::WV_Me: + firstPartTemp += QString::fromLatin1("Windows 98; Win 9x 4.90"); + break; + case QSysInfo::WV_NT: + firstPartTemp += QString::fromLatin1("WinNT4.0"); + break; + case QSysInfo::WV_2000: + firstPartTemp += QString::fromLatin1("Windows NT 5.0"); + break; + case QSysInfo::WV_XP: + firstPartTemp += QString::fromLatin1("Windows NT 5.1"); + break; + case QSysInfo::WV_2003: + firstPartTemp += QString::fromLatin1("Windows NT 5.2"); + break; + case QSysInfo::WV_VISTA: + firstPartTemp += QString::fromLatin1("Windows NT 6.0"); + break; + case QSysInfo::WV_WINDOWS7: + firstPartTemp += QString::fromLatin1("Windows NT 6.1"); + break; + case QSysInfo::WV_CE: + firstPartTemp += QString::fromLatin1("Windows CE"); + break; + case QSysInfo::WV_CENET: + firstPartTemp += QString::fromLatin1("Windows CE .NET"); + break; + case QSysInfo::WV_CE_5: + firstPartTemp += QString::fromLatin1("Windows CE 5.x"); + break; + case QSysInfo::WV_CE_6: + firstPartTemp += QString::fromLatin1("Windows CE 6.x"); + break; + } + #elif defined Q_OS_DARWIN #ifdef __i386__ || __x86_64__ - "Intel Mac OS X" + firstPartTemp += QString::fromLatin1("Intel Mac OS X"); #else - "PPC Mac OS X" + firstPartTemp += QString::fromLatin1("PPC Mac OS X"); #endif #elif defined Q_OS_BSDI - "BSD" + firstPartTemp += QString::fromLatin1("BSD"); #elif defined Q_OS_BSD4 - "BSD Four" + firstPartTemp += QString::fromLatin1("BSD Four"); #elif defined Q_OS_CYGWIN - "Cygwin" + firstPartTemp += QString::fromLatin1("Cygwin"); #elif defined Q_OS_DGUX - "DG/UX" + firstPartTemp += QString::fromLatin1("DG/UX"); #elif defined Q_OS_DYNIX - "DYNIX/ptx" + firstPartTemp += QString::fromLatin1("DYNIX/ptx"); #elif defined Q_OS_FREEBSD - "FreeBSD" + firstPartTemp += QString::fromLatin1("FreeBSD"); #elif defined Q_OS_HPUX - "HP-UX" + firstPartTemp += QString::fromLatin1("HP-UX"); #elif defined Q_OS_HURD - "GNU Hurd" + firstPartTemp += QString::fromLatin1("GNU Hurd"); #elif defined Q_OS_IRIX - "SGI Irix" + firstPartTemp += QString::fromLatin1("SGI Irix"); #elif defined Q_OS_LINUX - "Linux" + +#if defined(__x86_64__) + firstPartTemp += QString::fromLatin1("Linux x86_64"); +#elif defined(__i386__) + firstPartTemp += QString::fromLatin1("Linux i686"); +#else + firstPartTemp += QString::fromLatin1("Linux"); +#endif + #elif defined Q_OS_LYNX - "LynxOS" + firstPartTemp += QString::fromLatin1("LynxOS"); #elif defined Q_OS_NETBSD - "NetBSD" + firstPartTemp += QString::fromLatin1("NetBSD"); #elif defined Q_OS_OS2 - "OS/2" + firstPartTemp += QString::fromLatin1("OS/2"); #elif defined Q_OS_OPENBSD - "OpenBSD" + firstPartTemp += QString::fromLatin1("OpenBSD"); #elif defined Q_OS_OS2EMX - "OS/2" + firstPartTemp += QString::fromLatin1("OS/2"); #elif defined Q_OS_OSF - "HP Tru64 UNIX" + firstPartTemp += QString::fromLatin1("HP Tru64 UNIX"); #elif defined Q_OS_QNX6 - "QNX RTP Six" + firstPartTemp += QString::fromLatin1("QNX RTP Six"); #elif defined Q_OS_QNX - "QNX" + firstPartTemp += QString::fromLatin1("QNX"); #elif defined Q_OS_RELIANT - "Reliant UNIX" + firstPartTemp += QString::fromLatin1("Reliant UNIX"); #elif defined Q_OS_SCO - "SCO OpenServer" + firstPartTemp += QString::fromLatin1("SCO OpenServer"); #elif defined Q_OS_SOLARIS - "Sun Solaris" + firstPartTemp += QString::fromLatin1("Sun Solaris"); #elif defined Q_OS_ULTRIX - "DEC Ultrix" -#elif defined Q_WS_S60 - "Series60" -#elif defined Q_OS_UNIX - "UNIX BSD/SYSV system" -#elif defined Q_OS_UNIXWARE - "UnixWare Seven, Open UNIX Eight" -#else - "Unknown" -#endif - // Placeholder for SubPlatform Version - "%4; "); - - // Platform Version - QString osVer; -#ifdef Q_OS_SYMBIAN - QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion(); - switch (symbianVersion) { - case QSysInfo::SV_9_2: - osVer = "/9.2"; - break; - case QSysInfo::SV_9_3: - osVer = "/9.3"; - break; - case QSysInfo::SV_9_4: - osVer = "/9.4"; - break; - default: - osVer = "Unknown"; - } -#endif - ua = ua.arg(osVer); - - QChar securityStrength(QLatin1Char('N')); -#if !defined(QT_NO_OPENSSL) - // we could check QSslSocket::supportsSsl() here, but this makes - // OpenSSL, certificates etc being loaded in all cases were QWebPage - // is used. This loading is not needed for non-https. - securityStrength = QLatin1Char('U'); - // this may lead to a false positive: We indicate SSL since it is - // compiled in even though supportsSsl() might return false -#endif - ua = ua.arg(securityStrength); - -#if defined Q_OS_WIN32 - QString ver; - switch (QSysInfo::WindowsVersion) { - case QSysInfo::WV_32s: - ver = "Windows 3.1"; - break; - case QSysInfo::WV_95: - ver = "Windows 95"; - break; - case QSysInfo::WV_98: - ver = "Windows 98"; - break; - case QSysInfo::WV_Me: - ver = "Windows 98; Win 9x 4.90"; - break; - case QSysInfo::WV_NT: - ver = "WinNT4.0"; + firstPartTemp += QString::fromLatin1("DEC Ultrix"); +#elif defined Q_OS_SYMBIAN + firstPartTemp += QString::fromLatin1("SymbianOS"); + QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion(); + switch (symbianVersion) { + case QSysInfo::SV_9_2: + firstPartTemp += QString::fromLatin1("/9.2"); break; - case QSysInfo::WV_2000: - ver = "Windows NT 5.0"; + case QSysInfo::SV_9_3: + firstPartTemp += QString::fromLatin1("/9.3"); break; - case QSysInfo::WV_XP: - ver = "Windows NT 5.1"; + case QSysInfo::SV_9_4: + firstPartTemp += QString::fromLatin1("/9.4"); break; - case QSysInfo::WV_2003: - ver = "Windows NT 5.2"; + default: + firstPartTemp += QString::fromLatin1("/Unknown"); + } + +#if defined Q_WS_S60 + firstPartTemp += QLatin1Char(' '); + firstPartTemp += QString::fromLatin1("Series60"); + QSysInfo::S60Version s60Version = QSysInfo::s60Version(); + switch (s60Version) { + case QSysInfo::SV_S60_3_1: + firstPartTemp += QString::fromLatin1("/3.1"); break; - case QSysInfo::WV_VISTA: - ver = "Windows NT 6.0"; + case QSysInfo::SV_S60_3_2: + firstPartTemp += QString::fromLatin1("/3.2"); break; -#if QT_VERSION > 0x040500 - case QSysInfo::WV_WINDOWS7: - ver = "Windows NT 6.1"; + case QSysInfo::SV_S60_5_0: + firstPartTemp += QString::fromLatin1("/5.0"); break; + default: + firstPartTemp += QString::fromLatin1("/Unknown"); + } #endif - case QSysInfo::WV_CE: - ver = "Windows CE"; - break; - case QSysInfo::WV_CENET: - ver = "Windows CE .NET"; - break; - case QSysInfo::WV_CE_5: - ver = "Windows CE 5.x"; - break; - case QSysInfo::WV_CE_6: - ver = "Windows CE 6.x"; - break; - } - ua = QString(ua).arg(ver); + +#elif defined Q_OS_UNIX + firstPartTemp += QString::fromLatin1("UNIX BSD/SYSV system"); +#elif defined Q_OS_UNIXWARE + firstPartTemp += QString::fromLatin1("UnixWare Seven, Open UNIX Eight"); +#else + firstPartTemp += QString::fromLatin1("Unknown"); #endif - // SubPlatform Version - QString subPlatformVer; -#ifdef Q_OS_SYMBIAN - QSysInfo::S60Version s60Version = QSysInfo::s60Version(); - switch (s60Version) { - case QSysInfo::SV_S60_3_1: - subPlatformVer = "/3.1"; - break; - case QSysInfo::SV_S60_3_2: - subPlatformVer = "/3.2"; - break; - case QSysInfo::SV_S60_5_0: - subPlatformVer = "/5.0"; - break; - default: - subPlatformVer = " Unknown"; - } + // language is the split + firstPartTemp += QString::fromLatin1("; "); + firstPartTemp.squeeze(); + firstPart = firstPartTemp; + + QString secondPartTemp; + secondPartTemp.reserve(150); + secondPartTemp += QString::fromLatin1(") "); + + // webkit/qt version + secondPartTemp += QString::fromLatin1("AppleWebKit/"); + secondPartTemp += qWebKitVersion(); + secondPartTemp += QString::fromLatin1(" (KHTML, like Gecko) "); + + + // Application name split the third part + secondPartTemp.squeeze(); + secondPart = secondPartTemp; + + QString thirdPartTemp; + thirdPartTemp.reserve(150); +#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) + thirdPartTemp + QLatin1String(" Mobile Safari/"); +#else + thirdPartTemp += QLatin1String(" Safari/"); #endif - ua = ua.arg(subPlatformVer); + thirdPartTemp += qWebKitVersion(); + thirdPartTemp.squeeze(); + thirdPart = thirdPartTemp; + Q_ASSERT(!firstPart.isNull()); + Q_ASSERT(!secondPart.isNull()); + Q_ASSERT(!thirdPart.isNull()); + } // Language - QLocale locale; + QString languageName; if (d->client && d->client->ownerWidget()) - locale = d->client->ownerWidget()->locale(); - QString name = locale.name(); - name[2] = QLatin1Char('-'); - ua.append(name); - ua.append(QLatin1String(") ")); - - // webkit/qt version - ua.append(QString(QLatin1String("AppleWebKit/%1 (KHTML, like Gecko) ")) - .arg(QString(qWebKitVersion()))); + languageName = d->client->ownerWidget()->locale().name(); + else + languageName = QLocale().name(); + languageName[2] = QLatin1Char('-'); // Application name/version QString appName = QCoreApplication::applicationName(); if (!appName.isEmpty()) { - ua.append(appName); QString appVer = QCoreApplication::applicationVersion(); if (!appVer.isEmpty()) - ua.append(QLatin1Char('/') + appVer); + appName.append(QLatin1Char('/') + appVer); } else { // Qt version - ua.append(QLatin1String("Qt/")); - ua.append(QLatin1String(qVersion())); + appName = QString::fromLatin1("Qt/") + QString::fromLatin1(qVersion()); } -#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) - ua.append(QString(QLatin1String(" Mobile Safari/%1")).arg(qWebKitVersion())); -#else - ua.append(QString(QLatin1String(" Safari/%1")).arg(qWebKitVersion())); -#endif - return ua; + return firstPart + languageName + secondPart + appName + thirdPart; } diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 8594f09..6e450c2 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,55 @@ +2010-04-29 Janne Koskinen <janne.p.koskinen@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit versioning added + https://bugs.webkit.org/show_bug.cgi?id=37207 + + QtWebkit releases separated from Qt release cycle. + + * qtwebkit_version.pri: Added. + +2010-05-02 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage::userAgentForUrl is terrible API + https://bugs.webkit.org/show_bug.cgi?id=33875 + + Simplify the creation of the user agent string to avoid some + overhead for each loaded url. + + The static part of the user agent is cached so it only have + to be made once. + This creation has been made in order to simplify the code. + + The two variable: application name and current language are + set dynamically when needed. + The default locale is non longer created if the widget locale + is used. + + * Api/qwebpage.cpp: + (QWebPage::userAgentForUrl): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::userAgentApplicationName): + (tst_QWebPage::userAgentLocaleChange): + +2010-05-02 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] GraphicsLayer: animation incorrect when scrolling + https://bugs.webkit.org/show_bug.cgi?id=38371 + + This is a regression introduced with the invalidate-on-scroll code path, that uses QGraphicsWebViewPrivate::update() + instead of QGraphicsWebViewPrivate::scroll(). The patch makes sure that the scrolling position is correct on + each content update - this shouldn't have a performance impact - the only overhead is an additional value-test on each update. + + Tested by http://www.the-art-of-web.com/css/css-animation/ + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::update): + 2010-04-29 Andreas Kling <andreas.kling@nokia.com> Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebKit/qt/qtwebkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qtwebkit_version.pri new file mode 100644 index 0000000..ffd192c --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/qtwebkit_version.pri @@ -0,0 +1,4 @@ +QT_WEBKIT_VERSION = 4.7.0 +QT_WEBKIT_MAJOR_VERSION = 4 +QT_WEBKIT_MINOR_VERSION = 7 +QT_WEBKIT_PATCH_VERSION = 0 diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 85d4b60..f7eddd5 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -23,6 +23,7 @@ #include <QDir> #include <QGraphicsWidget> #include <QLineEdit> +#include <QLocale> #include <QMenu> #include <QPushButton> #include <QtTest/QtTest> @@ -106,6 +107,8 @@ private slots: void errorPageExtension(); void errorPageExtensionInIFrames(); void errorPageExtensionInFrameset(); + void userAgentApplicationName(); + void userAgentLocaleChange(); void crashTests_LazyInitializationOfMainFrame(); @@ -1748,6 +1751,38 @@ void tst_QWebPage::errorPageExtensionInFrameset() m_view->setPage(0); } +class FriendlyWebPage : public QWebPage +{ +public: + friend class tst_QWebPage; +}; + +void tst_QWebPage::userAgentApplicationName() +{ + const QString oldApplicationName = QCoreApplication::applicationName(); + FriendlyWebPage page; + + const QString applicationNameMarker = QString::fromUtf8("StrangeName\342\210\236"); + QCoreApplication::setApplicationName(applicationNameMarker); + QVERIFY(page.userAgentForUrl(QUrl()).contains(applicationNameMarker)); + + QCoreApplication::setApplicationName(oldApplicationName); +} + +void tst_QWebPage::userAgentLocaleChange() +{ + FriendlyWebPage page; + m_view->setPage(&page); + + const QString markerString = QString::fromLatin1(" nn-NO)"); + + if (page.userAgentForUrl(QUrl()).contains(markerString)) + QSKIP("marker string already present", SkipSingle); + + m_view->setLocale(QLocale(QString::fromLatin1("nn_NO"))); + QVERIFY(page.userAgentForUrl(QUrl()).contains(markerString)); +} + void tst_QWebPage::crashTests_LazyInitializationOfMainFrame() { { diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp index f15316b..ef07cbb 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp @@ -128,7 +128,6 @@ static qreal adjustedPosition(QGraphicsObject *item, QDeclarativeAnchorLine::Anc \internal \class QDeclarativeAnchors \since 4.7 - \ingroup group_layouts \brief The QDeclarativeAnchors class provides a way to lay out items relative to other items. \warning Currently, only anchoring to siblings or parent is supported. diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index b462443..35aa0f8 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -345,19 +345,21 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd() \code Flickable { - width: 200; height: 200; contentWidth: image.width; contentHeight: image.height - Image { id: image; source: "bigimage.png" } + width: 200; height: 200 + contentWidth: image.width; contentHeight: image.height + + Image { id: image; source: "bigImage.png" } } \endcode \image flickable.gif - \note Flickable does not automatically clip its contents. If - it is not full-screen it is likely that \c clip should be set - to true. + Flickable does not automatically clip its contents. If + it is not full-screen it is likely that \l {Item::clip}{clip} should be set + to \c true. - \note Due to an implementation detail items placed inside a flickable cannot anchor to it by - id, use 'parent' instead. + \note Due to an implementation detail, items placed inside a Flickable cannot anchor to it by + \c id. Use \c parent instead. */ /*! @@ -400,18 +402,17 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd() These properties describe the position and size of the currently viewed area. The size is defined as the percentage of the full view currently visible, scaled to 0.0 - 1.0. The page position is usually in the range 0.0 (beginning) to - 1.0 minus size ratio (end), i.e. yPosition is in the range 0.0 to 1.0-heightRatio. + 1.0 minus size ratio (end), i.e. \c yPosition is in the range 0.0 to 1.0-\c heightRatio. However, it is possible for the contents to be dragged outside of the normal range, resulting in the page positions also being outside the normal range. - These properties are typically used to draw a scrollbar, for example: - \code - Rectangle { - opacity: 0.5; anchors.right: MyListView.right-2; width: 6 - y: MyListView.visibleArea.yPosition * MyListView.height - height: MyListView.visibleArea.heightRatio * MyListView.height - } - \endcode + These properties are typically used to draw a scrollbar. For example: + + \snippet doc/src/snippets/declarative/flickableScrollbar.qml 0 + \dots 4 + \snippet doc/src/snippets/declarative/flickableScrollbar.qml 1 + + \sa {declarative/scrollbar}{scrollbar example} */ QDeclarativeFlickable::QDeclarativeFlickable(QDeclarativeItem *parent) @@ -479,11 +480,12 @@ void QDeclarativeFlickable::setContentY(qreal pos) /*! \qmlproperty bool Flickable::interactive - A user cannot drag or flick a Flickable that is not interactive. + This property holds whether the user can interact with the Flickable. A user + cannot drag or flick a Flickable that is not interactive. This property is useful for temporarily disabling flicking. This allows special interaction with Flickable's children: for example, you might want to - freeze a flickable map while viewing detailed information on a location popup that is a child of the Flickable. + freeze a flickable map while scrolling through a pop-up dialog that is a child of the Flickable. */ bool QDeclarativeFlickable::isInteractive() const { @@ -1026,7 +1028,7 @@ void QDeclarativeFlickable::setOverShoot(bool o) This enables the feeling that the edges of the view are soft, rather than a hard physical boundary. - boundsBehavior can be one of: + The \c boundsBehavior can be one of: \list \o \e StopAtBounds - the contents can not be dragged beyond the boundary @@ -1059,12 +1061,16 @@ void QDeclarativeFlickable::setBoundsBehavior(BoundsBehavior b) \qmlproperty int Flickable::contentHeight The dimensions of the content (the surface controlled by Flickable). Typically this - should be set to the combined size of the items placed in the Flickable. + should be set to the combined size of the items placed in the Flickable. Note this + can be set automatically using \l {Item::childrenRect.width}{childrenRect.width} + and \l {Item::childrenRect.height}{childrenRect.height}. For example: \code Flickable { - width: 320; height: 480; contentWidth: image.width; contentHeight: image.height - Image { id: image; source: "bigimage.png" } + width: 320; height: 480 + contentWidth: childrenRect.width; contentHeight: childrenRect.height + + Image { id: image; source: "bigImage.png" } } \endcode */ diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index 57045f1..85f40c3 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -94,8 +94,6 @@ public: \class QDeclarativeFlipable \brief The Flipable item provides a surface that can be flipped. - \ingroup group_widgets - Flipable is an item that can be visibly "flipped" between its front and back sides. */ diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 3937778..1c32b45 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -134,8 +134,6 @@ QT_BEGIN_NAMESPACE \class QDeclarativeImage Image \brief The QDeclarativeImage class provides an image item that you can add to a QDeclarativeView. - \ingroup group_coreitems - Example: \qml Image { source: "pics/star.png" } diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index dc34725..14f6b4a 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -219,46 +219,9 @@ QT_BEGIN_NAMESPACE The angle to rotate, in degrees clockwise. */ - -/*! - \group group_animation - \title Animation -*/ - -/*! - \group group_coreitems - \title Basic Items -*/ - -/*! - \group group_layouts - \title Layouts -*/ - -/*! - \group group_states - \title States and Transitions -*/ - -/*! - \group group_utility - \title Utility -*/ - -/*! - \group group_views - \title Views -*/ - -/*! - \group group_widgets - \title Widgets -*/ - /*! \internal \class QDeclarativeContents - \ingroup group_utility \brief The QDeclarativeContents class gives access to the height and width of an item's contents. */ @@ -267,62 +230,93 @@ QDeclarativeContents::QDeclarativeContents() : m_x(0), m_y(0), m_width(0), m_hei { } +QDeclarativeContents::~QDeclarativeContents() +{ + QList<QGraphicsItem *> children = m_item->childItems(); + for (int i = 0; i < children.count(); ++i) { + QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i)); + if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects? + continue; + QDeclarativeItemPrivate::get(child)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed); + } +} + QRectF QDeclarativeContents::rectF() const { return QRectF(m_x, m_y, m_width, m_height); } -//TODO: optimization: only check sender(), if there is one -void QDeclarativeContents::calcHeight() +void QDeclarativeContents::calcHeight(QDeclarativeItem *changed) { qreal oldy = m_y; qreal oldheight = m_height; - qreal top = FLT_MAX; - qreal bottom = 0; - - QList<QGraphicsItem *> children = m_item->childItems(); - for (int i = 0; i < children.count(); ++i) { - QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i)); - if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects? - continue; - qreal y = child->y(); - if (y + child->height() > bottom) - bottom = y + child->height(); + if (changed) { + qreal top = oldy; + qreal bottom = oldy + oldheight; + qreal y = changed->y(); + if (y + changed->height() > bottom) + bottom = y + changed->height(); if (y < top) top = y; - } - if (!children.isEmpty()) m_y = top; - m_height = qMax(bottom - top, qreal(0.0)); + m_height = bottom - top; + } else { + qreal top = FLT_MAX; + qreal bottom = 0; + QList<QGraphicsItem *> children = m_item->childItems(); + for (int i = 0; i < children.count(); ++i) { + QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i)); + if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects? + continue; + qreal y = child->y(); + if (y + child->height() > bottom) + bottom = y + child->height(); + if (y < top) + top = y; + } + if (!children.isEmpty()) + m_y = top; + m_height = qMax(bottom - top, qreal(0.0)); + } if (m_height != oldheight || m_y != oldy) emit rectChanged(rectF()); } -//TODO: optimization: only check sender(), if there is one -void QDeclarativeContents::calcWidth() +void QDeclarativeContents::calcWidth(QDeclarativeItem *changed) { qreal oldx = m_x; qreal oldwidth = m_width; - qreal left = FLT_MAX; - qreal right = 0; - - QList<QGraphicsItem *> children = m_item->childItems(); - for (int i = 0; i < children.count(); ++i) { - QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i)); - if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects? - continue; - qreal x = child->x(); - if (x + child->width() > right) - right = x + child->width(); + if (changed) { + qreal left = oldx; + qreal right = oldx + oldwidth; + qreal x = changed->x(); + if (x + changed->width() > right) + right = x + changed->width(); if (x < left) left = x; - } - if (!children.isEmpty()) m_x = left; - m_width = qMax(right - left, qreal(0.0)); + m_width = right - left; + } else { + qreal left = FLT_MAX; + qreal right = 0; + QList<QGraphicsItem *> children = m_item->childItems(); + for (int i = 0; i < children.count(); ++i) { + QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i)); + if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects? + continue; + qreal x = child->x(); + if (x + child->width() > right) + right = x + child->width(); + if (x < left) + left = x; + } + if (!children.isEmpty()) + m_x = left; + m_width = qMax(right - left, qreal(0.0)); + } if (m_width != oldwidth || m_x != oldx) emit rectChanged(rectF()); @@ -331,21 +325,53 @@ void QDeclarativeContents::calcWidth() void QDeclarativeContents::setItem(QDeclarativeItem *item) { m_item = item; + //### optimize + connect(this, SIGNAL(rectChanged(QRectF)), m_item, SIGNAL(childrenRectChanged(QRectF))); QList<QGraphicsItem *> children = m_item->childItems(); for (int i = 0; i < children.count(); ++i) { QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(i)); if(!child)//### Should this be ignoring non-QDeclarativeItem graphicsobjects? continue; - connect(child, SIGNAL(heightChanged()), this, SLOT(calcHeight())); - connect(child, SIGNAL(yChanged()), this, SLOT(calcHeight())); - connect(child, SIGNAL(widthChanged()), this, SLOT(calcWidth())); - connect(child, SIGNAL(xChanged()), this, SLOT(calcWidth())); - connect(this, SIGNAL(rectChanged(QRectF)), m_item, SIGNAL(childrenRectChanged(QRectF))); + QDeclarativeItemPrivate::get(child)->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed); + //###what about changes to visibility? } + //### defer until componentComplete + calcHeight(); + calcWidth(); +} + +void QDeclarativeContents::itemGeometryChanged(QDeclarativeItem *changed, const QRectF &newGeometry, const QRectF &oldGeometry) +{ + if (newGeometry.width() != oldGeometry.width()) + calcWidth(changed); + if (newGeometry.height() != oldGeometry.height()) + calcHeight(changed); +} + +void QDeclarativeContents::itemDestroyed(QDeclarativeItem *item) +{ + if (item) + QDeclarativeItemPrivate::get(item)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed); + calcWidth(); calcHeight(); +} + +void QDeclarativeContents::childRemoved(QDeclarativeItem *item) +{ + if (item) + QDeclarativeItemPrivate::get(item)->removeItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed); calcWidth(); + calcHeight(); +} + +void QDeclarativeContents::childAdded(QDeclarativeItem *item) +{ + if (item) + QDeclarativeItemPrivate::get(item)->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry | QDeclarativeItemPrivate::Destroyed); + calcWidth(item); + calcHeight(item); } QDeclarativeItemKeyFilter::QDeclarativeItemKeyFilter(QDeclarativeItem *item) @@ -1258,8 +1284,6 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec changes. For many properties in Item or Item derivatives this can be used to add a touch of imperative logic to your application (when absolutely necessary). - - \ingroup group_coreitems */ /*! @@ -1388,6 +1412,7 @@ QDeclarativeItem::~QDeclarativeItem() delete d->_anchorLines; d->_anchorLines = 0; delete d->_anchors; d->_anchors = 0; delete d->_stateGroup; d->_stateGroup = 0; + delete d->_contents; d->_contents = 0; } /*! @@ -1628,7 +1653,6 @@ QRectF QDeclarativeItem::childrenRect() Q_D(QDeclarativeItem); if (!d->_contents) { d->_contents = new QDeclarativeContents; - QDeclarative_setParent_noEvent(d->_contents, this); d->_contents->setItem(this); } return d->_contents->rectF(); @@ -2551,6 +2575,16 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change, } } break; + case ItemChildAddedChange: + if (d->_contents) + d->_contents->childAdded(qobject_cast<QDeclarativeItem*>( + value.value<QGraphicsItem*>())); + break; + case ItemChildRemovedChange: + if (d->_contents) + d->_contents->childRemoved(qobject_cast<QDeclarativeItem*>( + value.value<QGraphicsItem*>())); + break; default: break; } diff --git a/src/declarative/graphicsitems/qdeclarativeitem_p.h b/src/declarative/graphicsitems/qdeclarativeitem_p.h index b4dd60a..516d6d0 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem_p.h +++ b/src/declarative/graphicsitems/qdeclarativeitem_p.h @@ -79,24 +79,32 @@ class QNetworkReply; class QDeclarativeItemKeyFilter; //### merge into private? -class QDeclarativeContents : public QObject +class QDeclarativeContents : public QObject, public QDeclarativeItemChangeListener { Q_OBJECT public: QDeclarativeContents(); + ~QDeclarativeContents(); QRectF rectF() const; void setItem(QDeclarativeItem *item); -public Q_SLOTS: - void calcHeight(); - void calcWidth(); + void childRemoved(QDeclarativeItem *item); + void childAdded(QDeclarativeItem *item); Q_SIGNALS: void rectChanged(QRectF); +protected: + void itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeometry, const QRectF &oldGeometry); + void itemDestroyed(QDeclarativeItem *item); + //void itemVisibilityChanged(QDeclarativeItem *item) + private: + void calcHeight(QDeclarativeItem *changed = 0); + void calcWidth(QDeclarativeItem *changed = 0); + QDeclarativeItem *m_item; qreal m_x; qreal m_y; diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index c7b209a..d178107 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -292,8 +292,6 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() \class QDeclarativeMouseArea \brief The QDeclarativeMouseArea class provides a simple mouse handling abstraction for use within Qml. - \ingroup group_coreitems - All QDeclarativeItem derived classes can do mouse handling but the QDeclarativeMouseArea class exposes mouse handling data as properties and tracks flicking and dragging of the mouse. diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp index f52636f..5dd7e5d 100644 --- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp +++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp @@ -59,8 +59,8 @@ QT_BEGIN_NAMESPACE \brief The QDeclarativePaintedItem class is an abstract base class for QDeclarativeView items that want cached painting. \internal - This is a convenience class for implementing items that paint their contents - using a QPainter. The contents of the item are cached behind the scenes. + This is a convenience class for implementing items that cache their painting. + The contents of the item are cached behind the scenes. The dirtyCache() function should be called if the contents change to ensure the cache is refreshed the next time painting occurs. @@ -184,7 +184,6 @@ void QDeclarativePaintedItem::setContentsScale(qreal scale) QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativePaintedItemPrivate), parent) { - init(); } /*! @@ -195,7 +194,6 @@ QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativeItem *parent) QDeclarativePaintedItem::QDeclarativePaintedItem(QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent) : QDeclarativeItem(dd, parent) { - init(); } /*! @@ -206,14 +204,21 @@ QDeclarativePaintedItem::~QDeclarativePaintedItem() clearCache(); } -/*! - \internal -*/ -void QDeclarativePaintedItem::init() +void QDeclarativePaintedItem::geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry) { - connect(this,SIGNAL(widthChanged()),this,SLOT(clearCache())); - connect(this,SIGNAL(heightChanged()),this,SLOT(clearCache())); - connect(this,SIGNAL(visibleChanged()),this,SLOT(clearCache())); + if (newGeometry.width() != oldGeometry.width() || + newGeometry.height() != oldGeometry.height()) + clearCache(); +} + +QVariant QDeclarativePaintedItem::itemChange(GraphicsItemChange change, + const QVariant &value) +{ + if (change == ItemVisibleHasChanged) + clearCache(); + + return QDeclarativeItem::itemChange(change, value); } void QDeclarativePaintedItem::setCacheFrozen(bool frozen) diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h index cc616af..8d08ba2 100644 --- a/src/declarative/graphicsitems/qdeclarativepainteditem_p.h +++ b/src/declarative/graphicsitems/qdeclarativepainteditem_p.h @@ -87,6 +87,10 @@ protected: QDeclarativePaintedItem(QDeclarativePaintedItemPrivate &dd, QDeclarativeItem *parent); virtual void drawContents(QPainter *p, const QRect &) = 0; + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + virtual QVariant itemChange(GraphicsItemChange change, + const QVariant &value); void setCacheFrozen(bool); @@ -100,7 +104,6 @@ protected Q_SLOTS: void clearCache(); private: - void init(); Q_DISABLE_COPY(QDeclarativePaintedItem) Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativePaintedItem) }; diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index e867a52..4d8b619 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -63,7 +63,6 @@ QT_BEGIN_NAMESPACE /*! \internal \class QDeclarativePathElement - \ingroup group_utility */ /*! @@ -86,7 +85,6 @@ QT_BEGIN_NAMESPACE /*! \internal \class QDeclarativePath - \ingroup group_utility \brief The QDeclarativePath class defines a path. \sa QDeclarativePathView */ @@ -513,7 +511,6 @@ void QDeclarativeCurve::setY(qreal y) /*! \internal \class QDeclarativePathAttribute - \ingroup group_utility \brief The QDeclarativePathAttribute class allows to set the value of an attribute at a given position in the path. \sa QDeclarativePath @@ -586,7 +583,6 @@ void QDeclarativePathAttribute::setValue(qreal value) /*! \internal \class QDeclarativePathLine - \ingroup group_utility \brief The QDeclarativePathLine class defines a straight line. \sa QDeclarativePath @@ -630,7 +626,6 @@ void QDeclarativePathLine::addToPath(QPainterPath &path) /*! \internal \class QDeclarativePathQuad - \ingroup group_utility \brief The QDeclarativePathQuad class defines a quadratic Bezier curve with a control point. \sa QDeclarativePath @@ -718,7 +713,6 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path) /*! \internal \class QDeclarativePathCubic - \ingroup group_utility \brief The QDeclarativePathCubic class defines a cubic Bezier curve with two control points. \sa QDeclarativePath @@ -844,7 +838,6 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path) /*! \internal \class QDeclarativePathPercent - \ingroup group_utility \brief The QDeclarativePathPercent class manipulates the way a path is interpreted. QDeclarativePathPercent allows you to bunch up items (or spread out items) along various diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index c1ef04d..7e4549f 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -76,7 +76,6 @@ void QDeclarativeBasePositionerPrivate::unwatchChanges(QDeclarativeItem* other) /*! \internal \class QDeclarativeBasePositioner - \ingroup group_layouts \brief The QDeclarativeBasePositioner class provides a base for QDeclarativeGraphics layouts. To create a QDeclarativeGraphics Positioner, simply subclass QDeclarativeBasePositioner and implement @@ -404,7 +403,6 @@ Column { \internal \class QDeclarativeColumn \brief The QDeclarativeColumn class lines up items vertically. - \ingroup group_positioners */ QDeclarativeColumn::QDeclarativeColumn(QDeclarativeItem *parent) : QDeclarativeBasePositioner(Vertical, parent) @@ -547,7 +545,6 @@ Row { \internal \class QDeclarativeRow \brief The QDeclarativeRow class lines up items horizontally. - \ingroup group_positioners */ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent) : QDeclarativeBasePositioner(Horizontal, parent) @@ -698,8 +695,6 @@ Grid { \internal \class QDeclarativeGrid \brief The QDeclarativeGrid class lays out items in a grid. - \ingroup group_layouts - */ QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) : QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight) diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 37a63eb..eeff0c3 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -142,7 +142,6 @@ QSet<QUrl> QTextDocumentWithImageResources::errors; \internal \class QDeclarativeText \qmlclass Text - \ingroup group_coreitems \brief The QDeclarativeText class provides a formatted text item that you can add to a QDeclarativeView. diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 31ed418..762640c 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -85,7 +85,6 @@ TextEdit { \internal \class QDeclarativeTextEdit \qmlclass TextEdit - \ingroup group_coreitems \brief The QDeclarativeTextEdit class provides an editable formatted text item that you can add to a QDeclarativeView. diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 03366f0..8b64e0e 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -104,7 +104,8 @@ QScriptValue QDeclarativeObjectScriptClass::newQObject(QObject *object, int type QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); if (!object) - return newObject(scriptEngine, this, new ObjectData(object, type)); + return scriptEngine->nullValue(); +// return newObject(scriptEngine, this, new ObjectData(object, type)); if (QObjectPrivate::get(object)->wasDeleted) return scriptEngine->undefinedValue(); @@ -775,7 +776,8 @@ QScriptDeclarativeClass::Value MetaCallArgument::toValue(QDeclarativeEngine *e) return QScriptDeclarativeClass::Value(engine, *((QString *)&data)); } else if (type == QMetaType::QObjectStar) { QObject *object = *((QObject **)&data); - QDeclarativeData::get(object, true)->setImplicitDestructible(); + if (object) + QDeclarativeData::get(object, true)->setImplicitDestructible(); QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(e); return QScriptDeclarativeClass::Value(engine, priv->objectClass->newQObject(object)); } else if (type == qMetaTypeId<QList<QObject *> >()) { diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp index 1f528e8..5fab631 100644 --- a/src/declarative/util/qdeclarativebind.cpp +++ b/src/declarative/util/qdeclarativebind.cpp @@ -98,7 +98,6 @@ public: /*! \internal \class QDeclarativeBind - \ingroup group_utility \brief The QDeclarativeBind class allows arbitrary property bindings to be created. Simple bindings are usually earier to do in-place rather than creating a diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index 4115193..f98ce8b 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -78,7 +78,6 @@ public: /*! \qmlclass FontLoader QDeclarativeFontLoader \since 4.7 - \ingroup group_utility \brief This item allows using fonts by name or url. Example: diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 861cbc8..ea209aa 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -149,7 +149,6 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje \class QDeclarativeState \brief The QDeclarativeState class allows you to define configurations of objects and properties. - \ingroup group_states QDeclarativeState allows you to specify a state as a set of batched changes from the default configuration. diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp index 5b51495..9b042d7 100644 --- a/src/declarative/util/qdeclarativestategroup.cpp +++ b/src/declarative/util/qdeclarativestategroup.cpp @@ -47,6 +47,7 @@ #include <qdeclarativebinding_p.h> #include <qdeclarativeglobal_p.h> +#include <QtCore/qstringbuilder.h> #include <QtCore/qdebug.h> #include <private/qobject_p.h> @@ -62,7 +63,7 @@ class QDeclarativeStateGroupPrivate : public QObjectPrivate public: QDeclarativeStateGroupPrivate() : nullState(0), componentComplete(true), - ignoreTrans(false), applyingState(false) {} + ignoreTrans(false), applyingState(false), unnamedCount(0) {} QString currentState; QDeclarativeState *nullState; @@ -78,6 +79,7 @@ public: bool componentComplete; bool ignoreTrans; bool applyingState; + int unnamedCount; QDeclarativeTransition *findTransition(const QString &from, const QString &to); void setCurrentStateInternal(const QString &state, bool = false); @@ -259,6 +261,12 @@ void QDeclarativeStateGroup::componentComplete() Q_D(QDeclarativeStateGroup); d->componentComplete = true; + for (int ii = 0; ii < d->states.count(); ++ii) { + QDeclarativeState *state = d->states.at(ii); + if (state->name().isEmpty()) + state->setName(QLatin1String("anonymousState") % QString::number(++d->unnamedCount)); + } + if (d->updateAutoState()) { return; } else if (!d->currentState.isEmpty()) { diff --git a/src/declarative/util/qdeclarativesystempalette.cpp b/src/declarative/util/qdeclarativesystempalette.cpp index 9bb3f69..6c62446 100644 --- a/src/declarative/util/qdeclarativesystempalette.cpp +++ b/src/declarative/util/qdeclarativesystempalette.cpp @@ -59,7 +59,6 @@ public: /*! \qmlclass SystemPalette QDeclarativeSystemPalette \since 4.7 - \ingroup group_utility \brief The SystemPalette item gives access to the Qt palettes. \sa QPalette diff --git a/src/declarative/util/qdeclarativetimeline.cpp b/src/declarative/util/qdeclarativetimeline.cpp index 291b2f3..0258b3c 100644 --- a/src/declarative/util/qdeclarativetimeline.cpp +++ b/src/declarative/util/qdeclarativetimeline.cpp @@ -255,7 +255,6 @@ qreal QDeclarativeTimeLinePrivate::value(const Op &op, int time, qreal base, boo /*! \internal \class QDeclarativeTimeLine - \ingroup group_animation \brief The QDeclarativeTimeLine class provides a timeline for controlling animations. QDeclarativeTimeLine is similar to QTimeLine except: @@ -875,7 +874,6 @@ void QDeclarativeTimeLine::remove(QDeclarativeTimeLineObject *v) /*! \internal \class QDeclarativeTimeLineValue - \ingroup group_animation \brief The QDeclarativeTimeLineValue class provides a value that can be modified by QDeclarativeTimeLine. */ diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp index f284156..ab8b116 100644 --- a/src/declarative/util/qdeclarativetransition.cpp +++ b/src/declarative/util/qdeclarativetransition.cpp @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE /*! \qmlclass Transition QDeclarativeTransition - \since 4.7 + \since 4.7 \brief The Transition element defines animated transitions that occur on state changes. \sa {qmlstates}{States}, {state-transitions}{Transitions}, {QtDeclarative} @@ -63,8 +63,6 @@ QT_BEGIN_NAMESPACE \internal \class QDeclarativeTransition \brief The QDeclarativeTransition class allows you to define animated transitions that occur on state changes. - - \ingroup group_states */ //ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting |