From da0303d1ba6acc58f60c7448fefeffc88e8e331b Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 12 Aug 2010 16:32:11 +1000 Subject: QAudioOutput(ALSA); Fix check for available devices. ALSA can return a list of one empty item when no devices are available. Task-number: QTBUG-12690 Reviewed-by: Andrew den Exter --- src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 31 +++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp index f663dd2..633b309 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp @@ -431,21 +431,24 @@ QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) while (*n != NULL) { name = snd_device_name_get_hint(*n, "NAME"); - descr = snd_device_name_get_hint(*n, "DESC"); - io = snd_device_name_get_hint(*n, "IOID"); - if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) { - QString deviceName = QLatin1String(name); - QString deviceDescription = QLatin1String(descr); - allDevices.append(deviceName.toLocal8Bit().constData()); - if(deviceDescription.contains(QLatin1String("Default Audio Device"))) - devices.append(deviceName.toLocal8Bit().constData()); - } - if(name != NULL) + if (name != 0 && qstrcmp(name, "null") != 0) { + descr = snd_device_name_get_hint(*n, "DESC"); + io = snd_device_name_get_hint(*n, "IOID"); + + if ((descr != NULL) && ((io == NULL) || (io == filter))) { + QString deviceName = QLatin1String(name); + QString deviceDescription = QLatin1String(descr); + allDevices.append(deviceName.toLocal8Bit().constData()); + if (deviceDescription.contains(QLatin1String("Default Audio Device"))) + devices.append(deviceName.toLocal8Bit().constData()); + } + free(name); - if(descr != NULL) - free(descr); - if(io != NULL) - free(io); + if (descr != NULL) + free(descr); + if (io != NULL) + free(io); + } ++n; } snd_device_name_free_hint(hints); -- cgit v0.12 From 12f129eb1e1472e5eec561ab780ed709e5b66987 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 12 Aug 2010 17:29:29 +0200 Subject: QNAM HTTP: Fix crash related to aborted uploads Task-number: QTBUG-12285 --- src/network/access/qhttpnetworkconnection.cpp | 2 ++ src/network/access/qhttpnetworkconnectionchannel.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index def4c34..5de199e 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -651,6 +651,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // is the reply associated the currently processing of this channel? if (channels[i].reply == reply) { channels[i].reply = 0; + channels[i].request = QHttpNetworkRequest(); + channels[i].resendCurrent = false; if (!reply->isFinished() && !channels[i].alreadyPipelinedRequests.isEmpty()) { // the reply had to be prematurely removed, e.g. it was not finished diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 6a13669..ddc5d05 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -644,8 +644,10 @@ void QHttpNetworkConnectionChannel::allDone() // finished request. // Note that this may trigger a segfault at some other point. But then we can fix the underlying // problem. - if (!resendCurrent) + if (!resendCurrent) { + request = QHttpNetworkRequest(); reply = 0; + } // move next from pipeline to current request if (!alreadyPipelinedRequests.isEmpty()) { -- cgit v0.12 From 6155050f68cc86c445552da61a5f240c16f5e2cd Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 13 Aug 2010 10:50:31 +1000 Subject: Don't define highp/mediump/lowp if desktop GL has them OpenGL 4.0 systems now have compatibility with ES2, including support for the precision qualifiers. If the GL_ARB_ES2_compatibility extension is present, then we don't define highp/mediump/lowp to the empty string. Task-number: QTBUG-12862 Reviewed-by: Sarah Smith --- dist/changes-4.6.4 | 5 +++-- src/opengl/qgl.cpp | 3 +++ src/opengl/qgl_p.h | 3 ++- src/opengl/qglshaderprogram.cpp | 10 ++++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index 381023f..ab59dc5 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -63,8 +63,9 @@ QtNetwork QtOpenGL -------- - - foo - * bar + - QGLShaderProgram + * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL + implementation has the GL_ARB_ES2_compatibility extension. QtScript -------- diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0521bab..0137c85 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4923,6 +4923,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= FragmentProgram; if (extensions.match("GL_ARB_fragment_shader")) glExtensions |= FragmentShader; + if (extensions.match("GL_ARB_ES2_compatibility")) + glExtensions |= ES2Compatibility; if (extensions.match("GL_ARB_texture_mirrored_repeat")) glExtensions |= MirroredRepeat; if (extensions.match("GL_EXT_framebuffer_object")) @@ -4941,6 +4943,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= FramebufferObject; glExtensions |= GenerateMipmap; glExtensions |= FragmentShader; + glExtensions |= ES2Compatibility; #endif #if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) if (extensions.match("GL_OES_framebuffer_object")) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 4facb65..1603ca1 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -291,7 +291,8 @@ public: DDSTextureCompression = 0x00008000, ETC1TextureCompression = 0x00010000, PVRTCTextureCompression = 0x00020000, - FragmentShader = 0x00040000 + FragmentShader = 0x00040000, + ES2Compatibility = 0x00080000 }; Q_DECLARE_FLAGS(Extensions, Extension) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index edbb635..9bfe027 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -97,6 +97,10 @@ QT_BEGIN_NAMESPACE to just features that are present in GLSL/ES, and avoid standard variable names that only work on the desktop. + If the \c{GL_ARB_ES2_compatibility} extension is present, + then the above prefix is not added because the desktop OpenGL + implementation supports precision qualifiers. + \section1 Simple shader example \snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 1 @@ -390,8 +394,10 @@ bool QGLShader::compileSourceCode(const char *source) srclen.append(GLint(headerLen)); } #ifdef QGL_DEFINE_QUALIFIERS - src.append(qualifierDefines); - srclen.append(GLint(sizeof(qualifierDefines) - 1)); + if (!(QGLExtensions::glExtensions() & QGLExtensions::ES2Compatibility)) { + src.append(qualifierDefines); + srclen.append(GLint(sizeof(qualifierDefines) - 1)); + } #endif #ifdef QGL_REDEFINE_HIGHP if (d->shaderType == Fragment) { -- cgit v0.12 From 36a98407ce53e2d7ae6f1ef3b65794b113ae1606 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 13 Aug 2010 11:25:55 +1000 Subject: Update changes-4.6.4 with recent shader program changes --- dist/changes-4.6.4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index ab59dc5..dbb2189 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -64,6 +64,8 @@ QtOpenGL -------- - QGLShaderProgram + * [QTBUG-12478] Don't resolve GLSL extensions if no shaders. + * [QTBUG-12591] setUniformValue(QSize) was setting (w,w) not (w,h). * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL implementation has the GL_ARB_ES2_compatibility extension. -- cgit v0.12 From 0a94e2af3c29afa6e8d7ae3041bed4f187b3c1ca Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 16 Aug 2010 12:19:06 +1000 Subject: Fix OpenGLVersionFlags on OpenGL 4.0 systems If the OpenGL version was 4.0 or higher, the flags for 1.1, 1.5, 2.0, and so on were not being set. This lead to the flags indicating that older OpenGL versions were not supported when they clearly were. Back port parts of 28659c21d12a267b10e5b441bf4c776e04d69bdc from Qt 4.7 to fix this in Qt 4.6. Task-number: QTBUG-12554 Reviewed-by: Sarah Smith --- dist/changes-4.6.4 | 1 + src/opengl/qgl.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index dbb2189..389aa3a 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -68,6 +68,7 @@ QtOpenGL * [QTBUG-12591] setUniformValue(QSize) was setting (w,w) not (w,h). * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL implementation has the GL_ARB_ES2_compatibility extension. + * [QTBUG-12554] Wrong OpenGLVersionFlags on OpenGL 4.0 systems. QtScript -------- diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0137c85..81e55b3 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1173,8 +1173,16 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co QGLFormat::OpenGL_Version_2_1 | QGLFormat::OpenGL_Version_3_0; } - else - qWarning("Unrecognised OpenGL version"); + else { + versionFlags |= QGLFormat::OpenGL_Version_1_1 | + QGLFormat::OpenGL_Version_1_2 | + QGLFormat::OpenGL_Version_1_3 | + QGLFormat::OpenGL_Version_1_4 | + QGLFormat::OpenGL_Version_1_5 | + QGLFormat::OpenGL_Version_2_0 | + QGLFormat::OpenGL_Version_2_1 | + QGLFormat::OpenGL_Version_3_0; + } } return versionFlags; } -- cgit v0.12 From f087ad801b19ffa32a538269cd1475ead963f013 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 17 Aug 2010 16:00:17 +0200 Subject: qmake: fix assertion on Windows when DESTDIR is empty in static libs Basically replacing project->values("foo").first() with project->first("foo") which does a null check. Task-number: QTBUG-12851 Reviewed-by: ossi --- qmake/generators/win32/winmakefile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index c36cc9c..4944d06 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -472,10 +472,13 @@ void Win32MakefileGenerator::processRcFileVar() resFile.replace(".rc", Option::res_ext); project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); if (!project->values("OBJECTS_DIR").isEmpty()) { - if(project->isActiveConfig("staticlib")) - project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep); + QString resDestDir; + if (project->isActiveConfig("staticlib")) + resDestDir = fileInfo(project->first("DESTDIR")).absoluteFilePath(); else - project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep); + resDestDir = project->first("OBJECTS_DIR"); + resDestDir.append(Option::dir_sep); + project->values("RES_FILE").first().prepend(resDestDir); } project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false); project->values("POST_TARGETDEPS") += project->values("RES_FILE"); -- cgit v0.12 From aa664a9d193f450134540ef285a0e1ac755984e8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 18 Aug 2010 14:05:55 +0200 Subject: fix epic fail from 4ba6646 Reviewed-by: ossi --- bin/syncqt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/syncqt b/bin/syncqt index d665e87..cee5398 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -961,7 +961,7 @@ if($check_includes) { my $lib = $_; my $dir = "$modules{$lib}"; { - my $current_dir = "$_"; + my $current_dir = $dir; #calc subdirs my @subdirs = ($current_dir); foreach (@subdirs) { -- cgit v0.12 From 0f8498584fe3f3c5e200076c0a3b7fbe33db4b52 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 20 Aug 2010 17:04:23 +0200 Subject: fix shadow build of configure.exe Reviewed-by: ossi --- tools/configure/configure.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 91de7c2..ab4b155 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -27,7 +27,7 @@ INCPATH += $$QT_SOURCE_TREE/src/corelib/arch/generic \ $$QT_SOURCE_TREE/src/corelib/global \ $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ - $$QT_BUILD_TREE/tools/shared + $$QT_SOURCE_TREE/tools/shared HEADERS = configureapp.h environment.h tools.h\ $$QT_SOURCE_TREE/src/corelib/tools/qbytearray.h \ -- cgit v0.12 From 8c47746c8da6d9d431e69fb2a828e151c36318d0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 20 Aug 2010 17:05:01 +0200 Subject: fix Norwegian Breakfast Network warnings in configure Reviewed-by: ossi --- tools/configure/configureapp.cpp | 16 ++++++++-------- tools/configure/environment.cpp | 7 +++---- tools/configure/tools.cpp | 10 +++++----- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b35f454..5de4f27 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -313,7 +313,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENVG" ] = "no"; - dictionary[ "IPV6" ] = "yes"; // Always, dynamicly loaded + dictionary[ "IPV6" ] = "yes"; // Always, dynamically loaded dictionary[ "OPENSSL" ] = "auto"; dictionary[ "DBUS" ] = "auto"; dictionary[ "S60" ] = "yes"; @@ -2094,7 +2094,7 @@ bool Configure::checkAvailability(const QString &part) available = (paths.size() == 0); if (!available) { - if (epocRoot.isNull() || epocRoot == "") + if (epocRoot.isEmpty()) epocRoot = ""; cout << endl << "The QtMultimedia audio backend will not be built because required" << endl @@ -2625,7 +2625,7 @@ void Configure::generateOutputVars() QString set_config = dictionary["QCONFIG"]; if (possible_configs.contains(set_config)) { - foreach(QString cfg, possible_configs) { + foreach (const QString &cfg, possible_configs) { qtConfig += (cfg + "-config"); if (cfg == set_config) break; @@ -2736,7 +2736,7 @@ void Configure::generateCachefile() QStringList buildParts; buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations"; - foreach(QString item, disabledBuildParts) { + foreach (const QString &item, disabledBuildParts) { buildParts.removeAll(item); } cacheStream << "QT_BUILD_PARTS = " << buildParts.join( " " ) << endl; @@ -3041,7 +3041,7 @@ void Configure::generateConfigfiles() QStringList kbdDrivers = dictionary["KBD_DRIVERS"].split(" ");; QStringList allKbdDrivers; allKbdDrivers<<"tty"<<"usb"<<"sl5000"<<"yopy"<<"vr41xx"<<"qvfb"<<"um"; - foreach(QString kbd, allKbdDrivers) { + foreach (const QString &kbd, allKbdDrivers) { if( !kbdDrivers.contains(kbd)) tmpStream<<"#define QT_NO_QWS_KBD_"< &dictionary, QMap &dictionary, QMap &dictionary, QMap &dictionary, QMap Date: Mon, 23 Aug 2010 16:49:08 +0200 Subject: QNAM HTTP: Prepare a compression auto test related to a future bugfix Task-number: QTBUG-12908 --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index ca563ef..2ff02d4 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -281,6 +281,8 @@ private Q_SLOTS: void symbianOpenCDataUrlCrash(); + void qtbug12908compressedHttpReply(); + // NOTE: This test must be last! void parentingRepliesToTheApp(); }; @@ -4171,6 +4173,30 @@ void tst_QNetworkReply::symbianOpenCDataUrlCrash() QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(598)); } +// TODO: +// Prepare a gzip that has one chunk that expands to the size mentioned in the bugreport. +// Then have a custom HTTP server that waits after this chunk so the returning gets +// triggered. +void tst_QNetworkReply::qtbug12908compressedHttpReply() +{ + QString header("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: 63\r\n\r\n"); + + // dd if=/dev/zero of=qtbug-12908 bs=16384 count=1 && gzip qtbug-12908 && base64 -w 0 qtbug-12908.gz + QString encodedFile("H4sICDdDaUwAA3F0YnVnLTEyOTA4AO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA"); + QByteArray decodedFile = QByteArray::fromBase64(encodedFile.toAscii()); + + MiniHttpServer server(header.toAscii() + decodedFile); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(reply->error(), QNetworkReply::NoError); +} // NOTE: This test must be last testcase in tst_qnetworkreply! -- cgit v0.12 From 67ddb9cca2b638b1cf71eb98e906260b83a38677 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Tue, 24 Aug 2010 15:15:29 +1000 Subject: Fix the broken unicode detection of ODBC driver. the unicode flag is entirely overrided by mistake. Task-number:QTBUG-13109 Reviewed-by:Michael Goddard --- src/sql/drivers/odbc/qsql_odbc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index f41a914..b06970c 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -2132,7 +2132,7 @@ void QODBCDriverPrivate::checkSqlServer() serverType = QString::fromUtf8((const char *)serverString.constData(), t); #endif isFreeTDSDriver = serverType.contains(QLatin1String("tdsodbc"), Qt::CaseInsensitive); - unicode = isFreeTDSDriver == false; + unicode = unicode && !isFreeTDSDriver; } } -- cgit v0.12 From 3c2dc7f652996d1f3b504b42d872734df2e9234f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 25 Aug 2010 10:53:06 +0200 Subject: WGL_COLOR_BITS_ARB should not take the alpha bits into account. The WGL_COLOR_BITS_ARB attribute is only supposed to specify the number of color bits in each buffer, *excluding* the alpha bits. Task-number: QTBUG-13141 Reviewed-by: Samuel --- src/opengl/qgl_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index ed4814f..55f224a 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -920,7 +920,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc) iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB; iAttributes[i++] = TRUE; iAttributes[i++] = WGL_COLOR_BITS_ARB; - iAttributes[i++] = 32; + iAttributes[i++] = 24; iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; iAttributes[i++] = d->glFormat.doubleBuffer(); if (d->glFormat.stereo()) { -- cgit v0.12 From 4bc81bb1cb3cd4a0a3fe071e00556124e770d7ac Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 08:56:24 +1000 Subject: Handle QAbstractItemModel layoutChanged() signal Treated identically to reset. Task-number: QTBUG-13146 --- src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 65b14cf..c6b8514 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -714,6 +714,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); + QObject::disconnect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_modelReset())); d->m_abstractItemModel = 0; } else if (d->m_visualItemModel) { QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)), @@ -761,6 +762,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); + QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_modelReset())); d->m_metaDataCacheable = true; return; } -- cgit v0.12 From 6f4d7ef066fef92eda4ae9c1ba5a380c9e2ed95b Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 26 Aug 2010 09:01:41 +1000 Subject: Remove unused code. --- src/declarative/util/qdeclarativelistmodel.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 0162beb..7504c23 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -58,9 +58,6 @@ Q_DECLARE_METATYPE(QListModelInterface *) QT_BEGIN_NAMESPACE -#define DATA_ROLE_ID 1 -#define DATA_ROLE_NAME "data" - QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListModelData::instructions() const { return (QDeclarativeListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData)); -- cgit v0.12 From 08df2a17f4f0ed9b5ce69ad91e3849260acda092 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 09:19:37 +1000 Subject: Add test for VisualItemModel layoutChanged() handling Task-number: QTBUG-13146 --- .../qdeclarativevisualdatamodel/data/datalist.qml | 15 ++++++++++ .../tst_qdeclarativevisualdatamodel.cpp | 35 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml new file mode 100644 index 0000000..a798f77 --- /dev/null +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/datalist.qml @@ -0,0 +1,15 @@ +import Qt 4.7 + +ListView { + width: 100 + height: 100 + anchors.fill: parent + model: myModel + delegate: Component { + Rectangle { + height: 25 + width: 100 + Text { objectName: "display"; text: display } + } + } +} diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp index e0f32ea..3cd786f 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -83,6 +83,7 @@ public: private slots: void rootIndex(); + void updateLayout(); void objectListModel(); private: @@ -155,6 +156,40 @@ void tst_qdeclarativevisualdatamodel::rootIndex() delete obj; } +void tst_qdeclarativevisualdatamodel::updateLayout() +{ + QDeclarativeView view; + + QStandardItemModel model; + initStandardTreeModel(&model); + + view.rootContext()->setContextProperty("myModel", &model); + + view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml")); + + QDeclarativeListView *listview = qobject_cast(view.rootObject()); + QVERIFY(listview != 0); + + QDeclarativeItem *contentItem = listview->contentItem(); + QVERIFY(contentItem != 0); + + QDeclarativeText *name = findItem(contentItem, "display", 0); + QCOMPARE(name->text(), QString("Row 1 Item")); + name = findItem(contentItem, "display", 1); + QCOMPARE(name->text(), QString("Row 2 Item")); + name = findItem(contentItem, "display", 2); + QCOMPARE(name->text(), QString("Row 3 Item")); + + model.invisibleRootItem()->sortChildren(0, Qt::DescendingOrder); + + name = findItem(contentItem, "display", 0); + QCOMPARE(name->text(), QString("Row 3 Item")); + name = findItem(contentItem, "display", 1); + QCOMPARE(name->text(), QString("Row 2 Item")); + name = findItem(contentItem, "display", 2); + QCOMPARE(name->text(), QString("Row 1 Item")); +} + void tst_qdeclarativevisualdatamodel::objectListModel() { QDeclarativeView view; -- cgit v0.12 From af6d440e241b9b9127b76a40c4c5ef051cf02401 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 26 Aug 2010 10:36:06 +1000 Subject: Remove dead code. --- src/declarative/util/qdeclarativexmllistmodel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 7b3d4a8..02bf370 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -466,8 +466,6 @@ public: QList roleObjects; static void append_role(QDeclarativeListProperty *list, QDeclarativeXmlListModelRole *role); static void clear_role(QDeclarativeListProperty *list); - static void removeAt_role(QDeclarativeListProperty *list, int i); - static void insert_role(QDeclarativeListProperty *list, int i, QDeclarativeXmlListModelRole *role); QList > data; int redirectCount; }; -- cgit v0.12 From 8bedba8ecb9cde3de68defea3e2b062504224aa6 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 11:44:03 +1000 Subject: Fix ListView.view attached property with VisualItemModel We assumed that the attached object was created at the same time as the item. Task-number: QTBUG-13166 Reviewed-by: Aaron Kennedy --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativegridview_p.h | 12 ++++++++++-- src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativelistview_p.h | 12 ++++++++++-- .../auto/declarative/qdeclarativelistview/data/itemlist.qml | 6 +++--- .../qdeclarativelistview/tst_qdeclarativelistview.cpp | 1 + 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index d67e69a..37beab5 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -64,7 +64,7 @@ public: FxGridItem(QDeclarativeItem *i, QDeclarativeGridView *v) : item(i), view(v) { attached = static_cast(qmlAttachedPropertiesObject(item)); if (attached) - attached->m_view = view; + attached->setView(view); } ~FxGridItem() {} diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h index d6bbaf3..fdb6f94 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview_p.h +++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h @@ -43,6 +43,7 @@ #define QDECLARATIVEGRIDVIEW_H #include "private/qdeclarativeflickable_p.h" +#include "private/qdeclarativeguard_p.h" QT_BEGIN_HEADER @@ -220,8 +221,14 @@ public: : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {} ~QDeclarativeGridViewAttached() {} - Q_PROPERTY(QDeclarativeGridView *view READ view CONSTANT) + Q_PROPERTY(QDeclarativeGridView *view READ view WRITE setView NOTIFY viewChanged) QDeclarativeGridView *view() { return m_view; } + void setView(QDeclarativeGridView *view) { + if (view != m_view) { + m_view = view; + emit viewChanged(); + } + } Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged) bool isCurrentItem() const { return m_isCurrent; } @@ -249,9 +256,10 @@ Q_SIGNALS: void delayRemoveChanged(); void add(); void remove(); + void viewChanged(); public: - QDeclarativeGridView *m_view; + QDeclarativeGuard m_view; bool m_isCurrent : 1; bool m_delayRemove : 1; }; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 2e2e08c..f80c73a 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -96,7 +96,7 @@ public: FxListItem(QDeclarativeItem *i, QDeclarativeListView *v) : item(i), section(0), view(v) { attached = static_cast(qmlAttachedPropertiesObject(item)); if (attached) - attached->m_view = view; + attached->setView(view); } ~FxListItem() {} qreal position() const { diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index b264861..14925d7 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -43,6 +43,7 @@ #define QDECLARATIVELISTVIEW_H #include "private/qdeclarativeflickable_p.h" +#include "private/qdeclarativeguard_p.h" QT_BEGIN_HEADER @@ -268,8 +269,14 @@ public: : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {} ~QDeclarativeListViewAttached() {} - Q_PROPERTY(QDeclarativeListView *view READ view CONSTANT) + Q_PROPERTY(QDeclarativeListView *view READ view WRITE setView NOTIFY viewChanged) QDeclarativeListView *view() { return m_view; } + void setView(QDeclarativeListView *view) { + if (view != m_view) { + m_view = view; + emit viewChanged(); + } + } Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged) bool isCurrentItem() const { return m_isCurrent; } @@ -327,9 +334,10 @@ Q_SIGNALS: void delayRemoveChanged(); void add(); void remove(); + void viewChanged(); public: - QDeclarativeListView *m_view; + QDeclarativeGuard m_view; mutable QString m_section; QString m_prevSection; QString m_nextSection; diff --git a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml b/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml index 66728d6..9ea5953 100644 --- a/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml +++ b/tests/auto/declarative/qdeclarativelistview/data/itemlist.qml @@ -13,17 +13,17 @@ Rectangle { objectName: "itemModel" Rectangle { objectName: "item1" - height: view.height; width: view.width; color: "#FFFEF0" + height: ListView.view.height; width: view.width; color: "#FFFEF0" Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } } Rectangle { objectName: "item2" - height: view.height; width: view.width; color: "#F0FFF7" + height: ListView.view.height; width: view.width; color: "#F0FFF7" Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } } Rectangle { objectName: "item3" - height: view.height; width: view.width; color: "#F4F0FF" + height: ListView.view.height; width: view.width; color: "#F4F0FF" Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } } } diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 9c24e03..491ac0f 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1066,6 +1066,7 @@ void tst_QDeclarativeListView::itemList() QDeclarativeItem *item = findItem(contentItem, "item1"); QTRY_VERIFY(item); QTRY_COMPARE(item->x(), 0.0); + QCOMPARE(item->height(), listview->height()); QDeclarativeText *text = findItem(contentItem, "text1"); QTRY_VERIFY(text); -- cgit v0.12 From d630c627ed1dfbcfb48f907d2d37048b049830a5 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 13:51:38 +1000 Subject: Avoid Flickable view jumping when drag threashold is exceeded. Task-number: QTBUG-13176 --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 10 ++++++++-- src/declarative/graphicsitems/qdeclarativeflickable_p_p.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index a6e8c85..a710190 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -653,6 +653,8 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven timeline.clear(); hData.velocity = 0; vData.velocity = 0; + hData.dragStartOffset = 0; + vData.dragStartOffset = 0; lastPos = QPoint(); QDeclarativeItemPrivate::start(lastPosTime); pressPos = event->pos(); @@ -675,7 +677,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (q->yflick()) { int dy = int(event->pos().y() - pressPos.y()); if (qAbs(dy) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) { - qreal newY = dy + vData.pressPos; + if (!vMoved) + vData.dragStartOffset = dy; + qreal newY = dy + vData.pressPos - vData.dragStartOffset; const qreal minY = q->minYExtent(); const qreal maxY = q->maxYExtent(); if (newY > minY) @@ -705,7 +709,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (q->xflick()) { int dx = int(event->pos().x() - pressPos.x()); if (qAbs(dx) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) { - qreal newX = dx + hData.pressPos; + if (!hMoved) + hData.dragStartOffset = dx; + qreal newX = dx + hData.pressPos - hData.dragStartOffset; const qreal minX = q->minXExtent(); const qreal maxX = q->maxXExtent(); if (newX > minX) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h index b919e1b..c398faa 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h @@ -96,6 +96,7 @@ public: QDeclarativeTimeLineValueProxy move; qreal viewSize; qreal pressPos; + qreal dragStartOffset; qreal velocity; qreal flickTarget; QDeclarativeFlickablePrivate::Velocity smoothVelocity; -- cgit v0.12 From 58a76965e20c4c66ab2dc9cf73aa72b1cfddfbeb Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 14:11:58 +1000 Subject: ListView.view and GridView.view properties should not be writable. Task-number: QTBUG-13166 --- src/declarative/graphicsitems/qdeclarativegridview_p.h | 2 +- src/declarative/graphicsitems/qdeclarativelistview_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h index fdb6f94..ee632b1 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview_p.h +++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h @@ -221,7 +221,7 @@ public: : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {} ~QDeclarativeGridViewAttached() {} - Q_PROPERTY(QDeclarativeGridView *view READ view WRITE setView NOTIFY viewChanged) + Q_PROPERTY(QDeclarativeGridView *view READ view NOTIFY viewChanged) QDeclarativeGridView *view() { return m_view; } void setView(QDeclarativeGridView *view) { if (view != m_view) { diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index 14925d7..8fbff49 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -269,7 +269,7 @@ public: : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {} ~QDeclarativeListViewAttached() {} - Q_PROPERTY(QDeclarativeListView *view READ view WRITE setView NOTIFY viewChanged) + Q_PROPERTY(QDeclarativeListView *view READ view NOTIFY viewChanged) QDeclarativeListView *view() { return m_view; } void setView(QDeclarativeListView *view) { if (view != m_view) { -- cgit v0.12 From 2af41f34eca0effced19b59d4c3327e3e4b627cb Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 26 Aug 2010 13:31:27 +1000 Subject: Add quit buttons to declarative demos Task-number: QTBUG-13048 Reviewed-by: Martin Jones --- demos/declarative/calculator/Core/calculator.js | 10 +++---- demos/declarative/calculator/calculator.qml | 16 +++++------ .../minehunt/MinehuntCore/pics/quit.png | Bin 0 -> 583 bytes demos/declarative/minehunt/main.cpp | 1 + demos/declarative/minehunt/minehunt.qml | 12 +++++++++ demos/declarative/photoviewer/photoviewer.qml | 5 ++++ demos/declarative/rssnews/rssnews.qml | 20 +++++++++++++- demos/declarative/snake/snake.qml | 6 +++++ demos/declarative/twitter/TwitterCore/TitleBar.qml | 12 ++++++++- .../twitter/TwitterCore/images/quit.png | Bin 0 -> 2369 bytes demos/declarative/webbrowser/content/Header.qml | 30 ++++++++++++++++++--- 11 files changed, 92 insertions(+), 20 deletions(-) create mode 100644 demos/declarative/minehunt/MinehuntCore/pics/quit.png create mode 100644 demos/declarative/twitter/TwitterCore/images/quit.png diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js index 16cc309..7c363c7 100644 --- a/demos/declarative/calculator/Core/calculator.js +++ b/demos/declarative/calculator/Core/calculator.js @@ -74,6 +74,11 @@ function doOperation(op) { memory = display.text.valueOf() } else if (op == leftArrow) { display.text = display.text.toString().slice(0, -1) + if (display.text.length == 0) { + display.text = "0" + } + } else if (op == "Off") { + Qt.quit(); } else if (op == "C") { display.text = "0" } else if (op == "AC") { @@ -82,10 +87,5 @@ function doOperation(op) { lastOp = "" display.text ="0" } - - if (op == rotateRight) - main.state = "orientation " + Orientation.Landscape - if (op == rotateLeft) - main.state = '' } diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 288455b..68c922b 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -58,7 +58,7 @@ Rectangle { property string plusminus : "\u00b1" function doOp(operation) { CalcEngine.doOperation(operation) } - + Item { id: main state: "orientation " + runtime.orientation @@ -70,8 +70,10 @@ Rectangle { anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 } - Row { - Display { id: display; width: box.width; height: 64 } + Display { + id: display + width: box.width-3 + height: 64 } Column { @@ -82,11 +84,7 @@ Rectangle { Row { spacing: 6 - - Button { - id: rotateButton - width: column.w; height: column.h; color: 'purple'; operation: rotateRight - } + Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" } Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow } Button { width: column.w; height: column.h; color: 'purple'; operation: "C" } Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" } @@ -103,7 +101,7 @@ Rectangle { } Grid { - id: grid; rows: 4; columns: 5; spacing: 6 + id: grid; rows: 5; columns: 5; spacing: 6 property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns) diff --git a/demos/declarative/minehunt/MinehuntCore/pics/quit.png b/demos/declarative/minehunt/MinehuntCore/pics/quit.png new file mode 100644 index 0000000..b822057 Binary files /dev/null and b/demos/declarative/minehunt/MinehuntCore/pics/quit.png differ diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp index fc223dd..8bbaee9 100644 --- a/demos/declarative/minehunt/main.cpp +++ b/demos/declarative/minehunt/main.cpp @@ -59,6 +59,7 @@ int main(int argc, char *argv[]) #endif canvas.engine()->rootContext()->setContextObject(game); canvas.setSource(QString("minehunt.qml")); + QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit())); #ifdef Q_OS_SYMBIAN canvas.showFullScreen(); diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index 136f56a..a7daa90 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -67,6 +67,18 @@ Item { x: 20; spacing: 20 anchors.bottom: field.bottom; anchors.bottomMargin: 15 + Image { + source: "MinehuntCore/pics/quit.png" + scale: quitMouse.pressed ? 0.8 : 1.0 + smooth: quitMouse.pressed + y: 10 + MouseArea { + id: quitMouse + anchors.fill: parent + anchors.margins: -20 + onClicked: Qt.quit() + } + } Column { spacing: 2 Image { source: "MinehuntCore/pics/bomb-color.png" } diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml index 4ed3105..3072ea2 100644 --- a/demos/declarative/photoviewer/photoviewer.qml +++ b/demos/declarative/photoviewer/photoviewer.qml @@ -81,6 +81,11 @@ Rectangle { onClicked: mainWindow.editMode = !mainWindow.editMode anchors.horizontalCenter: parent.horizontalCenter } + Button { + id: quitButton; label: qsTr("Quit"); rotation: -2; + onClicked: Qt.quit() + anchors.horizontalCenter: parent.horizontalCenter + } } Rectangle { diff --git a/demos/declarative/rssnews/rssnews.qml b/demos/declarative/rssnews/rssnews.qml index def3e2c..fb5b5a3 100644 --- a/demos/declarative/rssnews/rssnews.qml +++ b/demos/declarative/rssnews/rssnews.qml @@ -71,6 +71,7 @@ Rectangle { id: categories anchors.fill: parent model: rssFeeds + footer: quitButtonDelegate delegate: CategoryDelegate {} highlight: Rectangle { color: "steelblue" } highlightMoveSpeed: 9999999 @@ -87,7 +88,24 @@ Rectangle { delegate: NewsDelegate {} } } - + Component { + id: quitButtonDelegate + Item { + width: categories.width; height: 60 + Text { + text: "Quit" + font { family: "Helvetica"; pixelSize: 16; bold: true } + anchors { + left: parent.left; leftMargin: 15 + verticalCenter: parent.verticalCenter + } + } + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } + } ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right } Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" } } diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index ed3bac9..12ad71c 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -194,6 +194,12 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter } + Content.Button { + text: "Quit" + anchors { left: btnA.right; leftMargin: 3; verticalCenter: parent.verticalCenter } + onClicked: Qt.quit(); + } + Text { color: activePalette.text text: "Score: " + score; font.bold: true diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml index 558bc18..479aa20 100644 --- a/demos/declarative/twitter/TwitterCore/TitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml @@ -58,10 +58,20 @@ Item { rssModel.tags = editor.text } + Image { + id: quitButton + x: 5 + anchors.verticalCenter: parent.verticalCenter + source: "images/quit.png" + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } Text { id: categoryText anchors { - left: parent.left; right: tagButton.left; leftMargin: 10; rightMargin: 10 + left: quitButton.right; right: tagButton.left; leftMargin: 5; rightMargin: 10 verticalCenter: parent.verticalCenter } elide: Text.ElideLeft diff --git a/demos/declarative/twitter/TwitterCore/images/quit.png b/demos/declarative/twitter/TwitterCore/images/quit.png new file mode 100644 index 0000000..5bda1b6 Binary files /dev/null and b/demos/declarative/twitter/TwitterCore/images/quit.png differ diff --git a/demos/declarative/webbrowser/content/Header.qml b/demos/declarative/webbrowser/content/Header.qml index 5abf440..d3ccae3 100644 --- a/demos/declarative/webbrowser/content/Header.qml +++ b/demos/declarative/webbrowser/content/Header.qml @@ -51,7 +51,6 @@ Image { x: webView.contentX < 0 ? -webView.contentX : webView.contentX > webView.contentWidth-webView.width ? -webView.contentX+webView.contentWidth-webView.width : 0 - y: { if (webView.progress < 1.0) return 0; @@ -59,7 +58,6 @@ Image { webView.contentY < 0 ? -webView.contentY : webView.contentY > height ? -height : -webView.contentY } } - Column { width: parent.width @@ -101,14 +99,38 @@ Image { Button { id: reloadButton - anchors { right: parent.right; rightMargin: 4 } + anchors { right: quitButton.left; rightMargin: 10 } action: webView.reload; image: "pics/view-refresh.png" visible: webView.progress == 1.0 && !header.urlChanged } + Text { + id: quitButton + color: "white" + style: Text.Sunken + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + font.pixelSize: 18 + width: 60 + text: "Quit" + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + Rectangle { + width: 1 + y: 5 + height: parent.height-10 + anchors.right: parent.left + color: "darkgray" + } + } Button { id: stopButton - anchors { right: parent.right; rightMargin: 4 } + anchors { right: quitButton.left; rightMargin: 10 } action: webView.stop; image: "pics/edit-delete.png" visible: webView.progress < 1.0 && !header.urlChanged } -- cgit v0.12 From f936a199e44a8d443240368f748f7be87cffc186 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 26 Aug 2010 15:43:53 +1000 Subject: Make declarative examples a bit more qt-like. --- .../minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg | Bin 30730 -> 0 bytes .../minehunt/MinehuntCore/pics/background.png | Bin 0 -> 313930 bytes demos/declarative/minehunt/minehunt.qml | 2 +- .../webbrowser/content/pics/edit-delete.png | Bin 1333 -> 831 bytes .../webbrowser/content/pics/go-jump-locationbar.png | Bin 714 -> 408 bytes .../webbrowser/content/pics/go-next-view.png | Bin 1187 -> 1310 bytes .../webbrowser/content/pics/go-previous-view.png | Bin 1226 -> 1080 bytes examples/declarative/animation/states/qt-logo.png | Bin 0 -> 5149 bytes examples/declarative/animation/states/states.qml | 8 ++++---- examples/declarative/animation/states/transitions.qml | 8 ++++---- examples/declarative/animation/states/user.png | Bin 4886 -> 0 bytes .../declarative/imageelements/image/ImageCell.qml | 2 +- .../declarative/imageelements/image/face-smile.png | Bin 15408 -> 0 bytes examples/declarative/imageelements/image/qt-logo.png | Bin 0 -> 5149 bytes .../modelviews/listview/content/pics/arrow-down.png | Bin 892 -> 0 bytes .../modelviews/listview/content/pics/arrow-up.png | Bin 929 -> 0 bytes .../modelviews/listview/content/pics/list-delete.png | Bin 1074 -> 0 bytes examples/declarative/positioners/add.png | Bin 1577 -> 810 bytes examples/declarative/positioners/del.png | Bin 1661 -> 488 bytes 19 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg create mode 100644 demos/declarative/minehunt/MinehuntCore/pics/background.png create mode 100644 examples/declarative/animation/states/qt-logo.png delete mode 100644 examples/declarative/animation/states/user.png delete mode 100644 examples/declarative/imageelements/image/face-smile.png create mode 100644 examples/declarative/imageelements/image/qt-logo.png delete mode 100644 examples/declarative/modelviews/listview/content/pics/arrow-down.png delete mode 100644 examples/declarative/modelviews/listview/content/pics/arrow-up.png delete mode 100644 examples/declarative/modelviews/listview/content/pics/list-delete.png diff --git a/demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg b/demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg deleted file mode 100644 index 445567f..0000000 Binary files a/demos/declarative/minehunt/MinehuntCore/pics/No-Ones-Laughing-3.jpg and /dev/null differ diff --git a/demos/declarative/minehunt/MinehuntCore/pics/background.png b/demos/declarative/minehunt/MinehuntCore/pics/background.png new file mode 100644 index 0000000..3734a27 Binary files /dev/null and b/demos/declarative/minehunt/MinehuntCore/pics/background.png differ diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index 136f56a..bc1bf4b 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -49,7 +49,7 @@ Item { width: 450; height: 450 - Image { source: "MinehuntCore/pics/No-Ones-Laughing-3.jpg"; anchors.fill: parent; fillMode: Image.Tile } + Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile } Grid { anchors.horizontalCenter: parent.horizontalCenter diff --git a/demos/declarative/webbrowser/content/pics/edit-delete.png b/demos/declarative/webbrowser/content/pics/edit-delete.png index 351659b..df2a147 100644 Binary files a/demos/declarative/webbrowser/content/pics/edit-delete.png and b/demos/declarative/webbrowser/content/pics/edit-delete.png differ diff --git a/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png index 636fe38..61f779c 100644 Binary files a/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png and b/demos/declarative/webbrowser/content/pics/go-jump-locationbar.png differ diff --git a/demos/declarative/webbrowser/content/pics/go-next-view.png b/demos/declarative/webbrowser/content/pics/go-next-view.png index 3bce02d..a585cab 100644 Binary files a/demos/declarative/webbrowser/content/pics/go-next-view.png and b/demos/declarative/webbrowser/content/pics/go-next-view.png differ diff --git a/demos/declarative/webbrowser/content/pics/go-previous-view.png b/demos/declarative/webbrowser/content/pics/go-previous-view.png index 3ec011e..612fb34 100644 Binary files a/demos/declarative/webbrowser/content/pics/go-previous-view.png and b/demos/declarative/webbrowser/content/pics/go-previous-view.png differ diff --git a/examples/declarative/animation/states/qt-logo.png b/examples/declarative/animation/states/qt-logo.png new file mode 100644 index 0000000..14ddf2a Binary files /dev/null and b/examples/declarative/animation/states/qt-logo.png differ diff --git a/examples/declarative/animation/states/states.qml b/examples/declarative/animation/states/states.qml index 77101d0..34cdae3 100644 --- a/examples/declarative/animation/states/states.qml +++ b/examples/declarative/animation/states/states.qml @@ -48,14 +48,14 @@ Rectangle { Image { id: userIcon x: topLeftRect.x; y: topLeftRect.y - source: "user.png" + source: "qt-logo.png" } Rectangle { id: topLeftRect anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 } - width: 64; height: 64 + width: 46; height: 54 color: "Transparent"; border.color: "Gray"; radius: 6 // Clicking in here sets the state to the default state, returning the image to @@ -67,7 +67,7 @@ Rectangle { id: middleRightRect anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 } - width: 64; height: 64 + width: 46; height: 54 color: "Transparent"; border.color: "Gray"; radius: 6 // Clicking in here sets the state to 'middleRight' @@ -78,7 +78,7 @@ Rectangle { id: bottomLeftRect anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 } - width: 64; height: 64 + width: 46; height: 54 color: "Transparent"; border.color: "Gray"; radius: 6 // Clicking in here sets the state to 'bottomLeft' diff --git a/examples/declarative/animation/states/transitions.qml b/examples/declarative/animation/states/transitions.qml index 1df60ae..884779c 100644 --- a/examples/declarative/animation/states/transitions.qml +++ b/examples/declarative/animation/states/transitions.qml @@ -54,14 +54,14 @@ Rectangle { Image { id: userIcon x: topLeftRect.x; y: topLeftRect.y - source: "user.png" + source: "qt-logo.png" } Rectangle { id: topLeftRect anchors { left: parent.left; top: parent.top; leftMargin: 10; topMargin: 20 } - width: 64; height: 64 + width: 46; height: 54 color: "Transparent"; border.color: "Gray"; radius: 6 // Clicking in here sets the state to the default state, returning the image to @@ -73,7 +73,7 @@ Rectangle { id: middleRightRect anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 20 } - width: 64; height: 64 + width: 46; height: 54 color: "Transparent"; border.color: "Gray"; radius: 6 // Clicking in here sets the state to 'middleRight' @@ -84,7 +84,7 @@ Rectangle { id: bottomLeftRect anchors { left: parent.left; bottom: parent.bottom; leftMargin: 10; bottomMargin: 20 } - width: 64; height: 64 + width: 46; height: 54 color: "Transparent"; border.color: "Gray"; radius: 6 // Clicking in here sets the state to 'bottomLeft' diff --git a/examples/declarative/animation/states/user.png b/examples/declarative/animation/states/user.png deleted file mode 100644 index dd7d7a2..0000000 Binary files a/examples/declarative/animation/states/user.png and /dev/null differ diff --git a/examples/declarative/imageelements/image/ImageCell.qml b/examples/declarative/imageelements/image/ImageCell.qml index bd232b9..71a17fe 100644 --- a/examples/declarative/imageelements/image/ImageCell.qml +++ b/examples/declarative/imageelements/image/ImageCell.qml @@ -48,7 +48,7 @@ Item { Image { id: image width: parent.width; height: parent.height - captionItem.height - source: "face-smile.png" + source: "qt-logo.png" clip: true // only makes a difference if mode is PreserveAspectCrop smooth: true } diff --git a/examples/declarative/imageelements/image/face-smile.png b/examples/declarative/imageelements/image/face-smile.png deleted file mode 100644 index 3d66d72..0000000 Binary files a/examples/declarative/imageelements/image/face-smile.png and /dev/null differ diff --git a/examples/declarative/imageelements/image/qt-logo.png b/examples/declarative/imageelements/image/qt-logo.png new file mode 100644 index 0000000..14ddf2a Binary files /dev/null and b/examples/declarative/imageelements/image/qt-logo.png differ diff --git a/examples/declarative/modelviews/listview/content/pics/arrow-down.png b/examples/declarative/modelviews/listview/content/pics/arrow-down.png deleted file mode 100644 index 63331a5..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/arrow-down.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/arrow-up.png b/examples/declarative/modelviews/listview/content/pics/arrow-up.png deleted file mode 100644 index 4459024..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/arrow-up.png and /dev/null differ diff --git a/examples/declarative/modelviews/listview/content/pics/list-delete.png b/examples/declarative/modelviews/listview/content/pics/list-delete.png deleted file mode 100644 index 9640f6b..0000000 Binary files a/examples/declarative/modelviews/listview/content/pics/list-delete.png and /dev/null differ diff --git a/examples/declarative/positioners/add.png b/examples/declarative/positioners/add.png index f29d84b..1ee4542 100644 Binary files a/examples/declarative/positioners/add.png and b/examples/declarative/positioners/add.png differ diff --git a/examples/declarative/positioners/del.png b/examples/declarative/positioners/del.png index 1d753a3..8d2eaed 100644 Binary files a/examples/declarative/positioners/del.png and b/examples/declarative/positioners/del.png differ -- cgit v0.12 From dac9c7f42765a46d445aae35fd0e85b402ceb164 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 16:00:37 +1000 Subject: Fix off-by-one at end when views scroll to keep currentItem visible. endPosition() is the last pixel of the item, i.e. width-1, so must add one to ensure the entire item is visible. Task-number: QTBUG-12822 --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 12 ++++++------ src/declarative/graphicsitems/qdeclarativelistview.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 37beab5..a0faf14 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2212,7 +2212,7 @@ void QDeclarativeGridView::trackedPositionChanged() if (trackedPos < d->startPosition() + d->highlightRangeStart) { pos = d->startPosition(); } else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + d->highlightRangeEnd) { - pos = d->endPosition() - d->size(); + pos = d->endPosition() - d->size() + 1; if (pos < d->startPosition()) pos = d->startPosition(); } else { @@ -2226,14 +2226,14 @@ void QDeclarativeGridView::trackedPositionChanged() } else { if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) { pos = d->currentItem->rowPos() < trackedPos ? trackedPos : d->currentItem->rowPos(); - } else if (d->trackedItem->endRowPos() > viewPos + d->size() - && d->currentItem->endRowPos() > viewPos + d->size()) { - if (d->trackedItem->endRowPos() < d->currentItem->endRowPos()) { - pos = d->trackedItem->endRowPos() - d->size(); + } else if (d->trackedItem->endRowPos() >= viewPos + d->size() + && d->currentItem->endRowPos() >= viewPos + d->size()) { + if (d->trackedItem->endRowPos() <= d->currentItem->endRowPos()) { + pos = d->trackedItem->endRowPos() - d->size() + 1; if (d->rowSize() > d->size()) pos = trackedPos; } else { - pos = d->currentItem->endRowPos() - d->size(); + pos = d->currentItem->endRowPos() - d->size() + 1; if (d->rowSize() > d->size()) pos = d->currentItem->rowPos(); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index f80c73a..d3d46f7 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2652,7 +2652,7 @@ void QDeclarativeListView::trackedPositionChanged() if (trackedPos < d->startPosition() + d->highlightRangeStart) { pos = d->startPosition(); } else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + d->highlightRangeEnd) { - pos = d->endPosition() - d->size(); + pos = d->endPosition() - d->size() + 1; if (pos < d->startPosition()) pos = d->startPosition(); } else { @@ -2666,14 +2666,14 @@ void QDeclarativeListView::trackedPositionChanged() } else { if (trackedPos < viewPos && d->currentItem->position() < viewPos) { pos = d->currentItem->position() < trackedPos ? trackedPos : d->currentItem->position(); - } else if (d->trackedItem->endPosition() > viewPos + d->size() - && d->currentItem->endPosition() > viewPos + d->size()) { - if (d->trackedItem->endPosition() < d->currentItem->endPosition()) { - pos = d->trackedItem->endPosition() - d->size(); - if (d->trackedItem->size() > d->size()) + } else if (d->trackedItem->endPosition() >= viewPos + d->size() + && d->currentItem->endPosition() >= viewPos + d->size()) { + if (d->trackedItem->endPosition() <= d->currentItem->endPosition()) { + pos = d->trackedItem->endPosition() - d->size() + 1; + if (d->trackedItem->size() > d->size()) pos = trackedPos; } else { - pos = d->currentItem->endPosition() - d->size(); + pos = d->currentItem->endPosition() - d->size() + 1; if (d->currentItem->size() > d->size()) pos = d->currentItem->position(); } -- cgit v0.12 From 55991e39819007b5c6d0662808d522cf32c383a4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 16:41:46 +1000 Subject: Revert 4bc81bb1cb3cd4a0a3fe071e00556124e770d7ac QAbstractItemModel calls that for all sorts of reasons. Task-number: QTBUG-13146 --- src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index c6b8514..65b14cf 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -714,7 +714,6 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); - QObject::disconnect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_modelReset())); d->m_abstractItemModel = 0; } else if (d->m_visualItemModel) { QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)), @@ -762,7 +761,6 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); - QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_modelReset())); d->m_metaDataCacheable = true; return; } -- cgit v0.12 From 48d057b8f4ae70d9ea43d4a234ff63956a70c3b6 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 16:47:22 +1000 Subject: Fix ListView and GridView tests following off-by-one fixes. Our tests were verifying incorrect positions... Task-number: QTBUG-12822 --- .../declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp | 4 ++-- .../declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index 1a28b71..896d69e 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -590,7 +590,7 @@ void tst_QDeclarativeGridView::currentIndex() QCOMPARE(gridview->currentIndex(), 35); QCOMPARE(gridview->currentItem(), findItem(contentItem, "wrapper", 35)); QCOMPARE(gridview->currentItem()->y(), gridview->highlightItem()->y()); - QCOMPARE(gridview->contentY(), 399.0); + QCOMPARE(gridview->contentY(), 400.0); gridview->moveCurrentIndexRight(); QCOMPARE(gridview->currentIndex(), 36); @@ -629,7 +629,7 @@ void tst_QDeclarativeGridView::currentIndex() gridview->moveCurrentIndexLeft(); QCOMPARE(gridview->currentIndex(), model.count()-1); - QTRY_COMPARE(gridview->contentY(), 879.0); + QTRY_COMPARE(gridview->contentY(), 880.0); gridview->moveCurrentIndexRight(); QCOMPARE(gridview->currentIndex(), 0); diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 491ac0f..e7c61db 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -979,7 +979,7 @@ void tst_QDeclarativeListView::currentIndex() // current item should be 20th item at startup // and current item should be in view QCOMPARE(listview->currentIndex(), 20); - QCOMPARE(listview->contentY(), 99.0); + QCOMPARE(listview->contentY(), 100.0); QCOMPARE(listview->currentItem(), findItem(contentItem, "wrapper", 20)); QCOMPARE(listview->highlightItem()->y(), listview->currentItem()->y()); -- cgit v0.12 From ff10e44642d65b2dde50579c4994aa9def43f4c0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 26 Aug 2010 17:18:21 +1000 Subject: Handle layoutChanged() properly in QML views. Update all visible items when layoutChanged() is emitted. Task-number: QTBUG-13146 --- src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 8 ++++++++ src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h | 1 + .../declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 65b14cf..b4e8bda 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -714,6 +714,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); + QObject::disconnect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged())); d->m_abstractItemModel = 0; } else if (d->m_visualItemModel) { QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)), @@ -761,6 +762,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)), this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int))); QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); + QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged())); d->m_metaDataCacheable = true; return; } @@ -1332,6 +1334,12 @@ void QDeclarativeVisualDataModel::_q_dataChanged(const QModelIndex &begin, const _q_itemsChanged(begin.row(), end.row() - begin.row() + 1, d->m_roles); } +void QDeclarativeVisualDataModel::_q_layoutChanged() +{ + Q_D(QDeclarativeVisualDataModel); + _q_itemsChanged(0, count(), d->m_roles); +} + void QDeclarativeVisualDataModel::_q_modelReset() { emit modelReset(); diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h index 50d2c53..e159786 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h @@ -194,6 +194,7 @@ private Q_SLOTS: void _q_rowsRemoved(const QModelIndex &,int,int); void _q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int); void _q_dataChanged(const QModelIndex&,const QModelIndex&); + void _q_layoutChanged(); void _q_modelReset(); void _q_createdPackage(int index, QDeclarativePackage *package); void _q_destroyingPackage(QDeclarativePackage *package); diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index e7c61db..bf4754d 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1002,7 +1002,7 @@ void tst_QDeclarativeListView::currentIndex() listview->decrementCurrentIndex(); QCOMPARE(listview->currentIndex(), model.count()-1); - QTRY_COMPARE(listview->contentY(), 279.0); + QTRY_COMPARE(listview->contentY(), 280.0); listview->incrementCurrentIndex(); QCOMPARE(listview->currentIndex(), 0); -- cgit v0.12 From 4fdb6a01b35d9cd4dc9e5e4d6682449476d68375 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 26 Aug 2010 12:20:45 +0100 Subject: fix for memory leak in QSysInfo::s60Version() A CDir was not deleted on several return paths in QSysInfo::s60Version(). This fix uses a QScopedPointer to clean up the CDir no matter what return path is taken. Reviewed-by: Simon Hausmann --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index af35316..401af85 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1828,6 +1828,7 @@ QSysInfo::S60Version QSysInfo::s60Version() CDir* contents; TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_S60SystemInstallDir, contents); if (err == KErrNone) { + QScopedPointer contentsDeleter(contents); err = contents->Sort(EDescending|ESortByName); if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 12) { TInt major = (*contents)[0].iName[9] - '0'; @@ -1850,7 +1851,6 @@ QSysInfo::S60Version QSysInfo::s60Version() } } } - delete contents; } # ifdef Q_CC_NOKIAX86 -- cgit v0.12 From fe8e118c41c6243ace972647934c90b7f937f60e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 26 Aug 2010 13:33:05 +0200 Subject: Autotest: don't use Q_FUNC_INFO for testing which method got called The string from Q_FUNC_INFO varies according to the compiler, so instead use an enum. Reviewed-by: Carlos Duclos --- tests/auto/qdbusthreading/tst_qdbusthreading.cpp | 35 ++++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/auto/qdbusthreading/tst_qdbusthreading.cpp b/tests/auto/qdbusthreading/tst_qdbusthreading.cpp index 94771a8..9d96ad8 100644 --- a/tests/auto/qdbusthreading/tst_qdbusthreading.cpp +++ b/tests/auto/qdbusthreading/tst_qdbusthreading.cpp @@ -70,7 +70,12 @@ public: QSemaphore sem1, sem2; volatile bool success; QEventLoop *loop; - const char *functionSpy; + enum FunctionSpy { + NoMethod = 0, + Adaptor_method, + Object_method + } functionSpy; + QThread *threadSpy; int signalSpy; @@ -127,7 +132,7 @@ public: public Q_SLOTS: void method() { - tst_QDBusThreading::self()->functionSpy = Q_FUNC_INFO; + tst_QDBusThreading::self()->functionSpy = tst_QDBusThreading::Adaptor_method; tst_QDBusThreading::self()->threadSpy = QThread::currentThread(); emit signal(); } @@ -155,7 +160,7 @@ public: public Q_SLOTS: void method() { - tst_QDBusThreading::self()->functionSpy = Q_FUNC_INFO; + tst_QDBusThreading::self()->functionSpy = tst_QDBusThreading::Object_method; tst_QDBusThreading::self()->threadSpy = QThread::currentThread(); emit signal(); deleteLater(); @@ -198,7 +203,7 @@ void Thread::run() static const char myConnectionName[] = "connection"; tst_QDBusThreading::tst_QDBusThreading() - : loop(0), functionSpy(0), threadSpy(0) + : loop(0), functionSpy(NoMethod), threadSpy(0) { _self = this; QCoreApplication::instance()->thread()->setObjectName("Main thread"); @@ -420,22 +425,22 @@ void tst_QDBusThreading::registerObjectInOtherThread() QTest::qWait(100); QCOMPARE(signalSpy, 0); - functionSpy = 0; + functionSpy = NoMethod; threadSpy = 0; QDBusReply reply = iface.call("method"); QVERIFY(reply.isValid()); - QCOMPARE(functionSpy, "void Object::method()"); + QCOMPARE(functionSpy, Object_method); QCOMPARE(threadSpy, th); QTest::qWait(100); QCOMPARE(signalSpy, 1); sem2.acquire(); // the object is gone - functionSpy = 0; + functionSpy = NoMethod; threadSpy = 0; reply = iface.call("method"); QVERIFY(!reply.isValid()); - QCOMPARE(functionSpy, (const char*)0); + QCOMPARE(functionSpy, NoMethod); QCOMPARE(threadSpy, (QThread*)0); } @@ -468,36 +473,36 @@ void tst_QDBusThreading::registerAdaptorInOtherThread() connect(&adaptor, SIGNAL(signal()), SLOT(signalSpySlot())); QCOMPARE(signalSpy, 0); - functionSpy = 0; + functionSpy = NoMethod; threadSpy = 0; QDBusReply reply = adaptor.call("method"); QVERIFY(reply.isValid()); - QCOMPARE(functionSpy, "void Adaptor::method()"); + QCOMPARE(functionSpy, Adaptor_method); QCOMPARE(threadSpy, th); QTest::qWait(100); QCOMPARE(signalSpy, 1); - functionSpy = 0; + functionSpy = NoMethod; threadSpy = 0; reply = object.call("method"); QVERIFY(reply.isValid()); - QCOMPARE(functionSpy, "void Object::method()"); + QCOMPARE(functionSpy, Object_method); QCOMPARE(threadSpy, th); QTest::qWait(100); QCOMPARE(signalSpy, 1); sem2.acquire(); // the object is gone - functionSpy = 0; + functionSpy = NoMethod; threadSpy = 0; reply = adaptor.call("method"); QVERIFY(!reply.isValid()); - QCOMPARE(functionSpy, (const char*)0); + QCOMPARE(functionSpy, NoMethod); QCOMPARE(threadSpy, (QThread*)0); reply = object.call("method"); QVERIFY(!reply.isValid()); - QCOMPARE(functionSpy, (const char*)0); + QCOMPARE(functionSpy, NoMethod); QCOMPARE(threadSpy, (QThread*)0); } -- cgit v0.12 From 26103b69df9bdd32016f3fbab975a26c8a147ea0 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 26 Aug 2010 15:30:59 +0300 Subject: Added support for DEPLOYMENT.pkg_build_version DEPLOYMENT.pkg_build_version can be used to pad the patch version number in Symbian pkg files to allow hot-fix deployments to be done between patch releases. DEPLOYMENT.pkg_build_version accepts only values 0 - 99, as pkg patch version number has limits how large numbers it can accept. The specified number is prefixed with zero if it is single digit and then appended to patch version number. Task-number: QTBUG-13147 Reviewed-by: Janne Koskinen --- qmake/generators/symbian/symbiancommon.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index d124b02..155dbc9 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -275,6 +275,20 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB if (success) applicationVersion = QString("%1,%2,%3").arg(major).arg(minor).arg(patch); + // Append package build version number if it is set + QString pkgBuildVersion = project->first("DEPLOYMENT.pkg_build_version"); + if (!pkgBuildVersion.isEmpty()) { + success = false; + uint build = pkgBuildVersion.toUInt(&success); + if (success && build < 100) { + if (pkgBuildVersion.size() == 1) + pkgBuildVersion.prepend(QLatin1Char('0')); + applicationVersion.append(pkgBuildVersion); + } else { + fprintf(stderr, "Warning: Invalid DEPLOYMENT.pkg_build_version (%s), must be a number between 0 - 99\n", qPrintable(pkgBuildVersion)); + } + } + // Package header QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; QString visualTarget = generator->escapeFilePath(project->first("TARGET")); -- cgit v0.12 From f2245941f0d1bc8244aa0d88437f0a42c9bba1fc Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 27 Aug 2010 12:12:03 +1000 Subject: Update example screenshot in doc. --- doc/src/images/qml-image-example.png | Bin 58184 -> 49584 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/src/images/qml-image-example.png b/doc/src/images/qml-image-example.png index c1951c0..8d9846f 100644 Binary files a/doc/src/images/qml-image-example.png and b/doc/src/images/qml-image-example.png differ -- cgit v0.12 From 34a107454426db2f40b3be31923b8a5ce1d84f6e Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 27 Aug 2010 14:32:25 +1000 Subject: Internal QML API cleanup --- .../qml/qdeclarativecompiledbindings.cpp | 2 +- src/declarative/qml/qdeclarativecompiler.cpp | 18 +-- .../qml/qdeclarativecompositetypemanager.cpp | 18 +-- src/declarative/qml/qdeclarativeimport.cpp | 157 +++++++++++---------- src/declarative/qml/qdeclarativeimport_p.h | 37 ++--- 5 files changed, 124 insertions(+), 108 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index 723da94..9402596 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -1874,7 +1874,7 @@ bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type return false; QDeclarativeImportedNamespace *ns = 0; - if (!engine->importDatabase.resolveType(imports, name.toUtf8(), &attachType, 0, 0, 0, &ns)) + if (!imports.resolveType(name.toUtf8(), &attachType, 0, 0, 0, &ns)) return false; if (ns || !attachType || !attachType->attachedPropertiesType()) return false; diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 2b4a4a5..34d33bb 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -703,7 +703,7 @@ void QDeclarativeCompiler::compileTree(Object *tree) for (int ii = 0; ii < importedScriptIndexes.count(); ++ii) output->importCache->add(importedScriptIndexes.at(ii), ii); - unit->imports.cache(output->importCache, engine); + unit->imports.populateCache(output->importCache, engine); Q_ASSERT(tree->metatype); @@ -1403,8 +1403,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop, QDeclarativeType *type = 0; QDeclarativeImportedNamespace *typeNamespace = 0; - enginePrivate->importDatabase.resolveType(unit->imports, prop->name, - &type, 0, 0, 0, &typeNamespace); + unit->imports.resolveType(prop->name, &type, 0, 0, 0, &typeNamespace); if (typeNamespace) { // ### We might need to indicate that this property is a namespace @@ -1512,7 +1511,7 @@ bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespac // Setup attached property data QDeclarativeType *type = 0; - enginePrivate->importDatabase.resolveTypeInNamespace(ns, prop->name, &type, 0, 0, 0); + unit->imports.resolveType(ns, prop->name, &type, 0, 0, 0); if (!type || !type->attachedPropertiesType()) COMPILE_EXCEPTION(prop, tr("Non-existent attached object")); @@ -2139,8 +2138,7 @@ bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop QString typeName = parts.at(0); QDeclarativeType *type = 0; - enginePrivate->importDatabase.resolveType(unit->imports, typeName.toUtf8(), - &type, 0, 0, 0, 0); + unit->imports.resolveType(typeName.toUtf8(), &type, 0, 0, 0, 0); if (!type || obj->typeName != type->qmlTypeName()) return true; @@ -2167,7 +2165,7 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const int dot = script.indexOf('.'); if (dot > 0) { QDeclarativeType *type = 0; - enginePrivate->importDatabase.resolveType(unit->imports, script.left(dot), &type, 0, 0, 0, 0); + unit->imports.resolveType(script.left(dot), &type, 0, 0, 0, 0); if (!type) return -1; const QMetaObject *mo = type->metaObject(); @@ -2185,8 +2183,7 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) const { QDeclarativeType *qmltype = 0; - if (!enginePrivate->importDatabase.resolveType(unit->imports, name, &qmltype, - 0, 0, 0, 0)) + if (!unit->imports.resolveType(name, &qmltype, 0, 0, 0, 0)) return 0; if (!qmltype) return 0; @@ -2344,8 +2341,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, Dyn QByteArray customTypeName; QDeclarativeType *qmltype = 0; QUrl url; - if (!enginePrivate->importDatabase.resolveType(unit->imports, p.customType, &qmltype, - &url, 0, 0, 0)) + if (!unit->imports.resolveType(p.customType, &qmltype, &url, 0, 0, 0)) COMPILE_EXCEPTION(&p, tr("Invalid property type")); if (!qmltype) { diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp index 2e77534..cc8f887 100644 --- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp +++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp @@ -523,7 +523,7 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData int waiting = 0; QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); - QDeclarativeImportDatabase &importDatabase = ep->importDatabase; + QDeclarativeImportDatabase *importDatabase = &ep->importDatabase; // For local urls, add an implicit import "." as first (most overridden) lookup. // This will also trigger the loading of the qmldir and the import of any native @@ -538,9 +538,10 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData qmldircomponentsnetwork = parser.components(); } - importDatabase.addToImport(&unit->imports, qmldircomponentsnetwork, QLatin1String("."), - QString(), -1, -1, QDeclarativeScriptParser::Import::File, - 0); // error ignored (just means no fallback) + unit->imports.addImport(importDatabase, + QLatin1String("."), QString(), -1, -1, QDeclarativeScriptParser::Import::File, + qmldircomponentsnetwork, + 0); // error ignored (just means no fallback) } @@ -577,8 +578,9 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData } QString errorString; - if (!importDatabase.addToImport(&unit->imports, qmldircomponentsnetwork, imp.uri, imp.qualifier, - vmaj, vmin, imp.type, &errorString)) { + if (!unit->imports.addImport(importDatabase, + imp.uri, imp.qualifier, vmaj, vmin, imp.type, + qmldircomponentsnetwork, &errorString)) { QDeclarativeError error; error.setUrl(unit->imports.baseUrl()); error.setDescription(errorString); @@ -606,8 +608,8 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData int minorVersion; QDeclarativeImportedNamespace *typeNamespace = 0; QString errorString; - if (!importDatabase.resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion, - &typeNamespace, &errorString) || typeNamespace) { + if (!unit->imports.resolveType(typeName, &ref.type, &url, &majorVersion, &minorVersion, + &typeNamespace, &errorString) || typeNamespace) { // Known to not be a type: // - known to be a namespace (Namespace {}) // - type with unknown namespace (UnknownNamespace.SomeType {}) diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index 5c21ebc..8f95e26 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -109,6 +109,11 @@ public: QHash set; }; +/*! +\class QDeclarativeImports +\brief The QDeclarativeImports class encapsulates one QML document's import statements. +\internal +*/ QDeclarativeImports::QDeclarativeImports(const QDeclarativeImports ©) : d(copy.d) { @@ -181,7 +186,7 @@ cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeImportedNamespac return cache; } -void QDeclarativeImports::cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const +void QDeclarativeImports::populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const { const QDeclarativeImportedNamespace &set = d->unqualifiedset; @@ -201,6 +206,67 @@ void QDeclarativeImports::cache(QDeclarativeTypeNameCache *cache, QDeclarativeEn cacheForNamespace(engine, set, cache); } + +/*! + \internal + + The given (namespace qualified) \a type is resolved to either + \list + \o a QDeclarativeImportedNamespace stored at \a ns_return, + \o a QDeclarativeType stored at \a type_return, or + \o a component located at \a url_return. + \endlist + + If any return pointer is 0, the corresponding search is not done. + + \sa addImport() +*/ +bool QDeclarativeImports::resolveType(const QByteArray& type, + QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin, + QDeclarativeImportedNamespace** ns_return, QString *errorString) const +{ + QDeclarativeImportedNamespace* ns = d->findNamespace(QString::fromUtf8(type)); + if (ns) { + if (ns_return) + *ns_return = ns; + return true; + } + if (type_return || url_return) { + if (d->find(type,vmaj,vmin,type_return,url_return, errorString)) { + if (qmlImportTrace()) { + if (type_return && *type_return && url_return && !url_return->isEmpty()) + qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " + << type << " => " << (*type_return)->typeName() << " " << *url_return; + if (type_return && *type_return) + qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " + << type << " => " << (*type_return)->typeName(); + if (url_return && !url_return->isEmpty()) + qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: " + << type << " => " << *url_return; + } + return true; + } + } + return false; +} + +/*! + \internal + + Searching \e only in the namespace \a ns (previously returned in a call to + resolveType(), \a type is found and returned to either + a QDeclarativeType stored at \a type_return, or + a component located at \a url_return. + + If either return pointer is 0, the corresponding search is not done. +*/ +bool QDeclarativeImports::resolveType(QDeclarativeImportedNamespace* ns, const QByteArray& type, + QDeclarativeType** type_return, QUrl* url_return, + int *vmaj, int *vmin) const +{ + return ns->find(type,vmaj,vmin,type_return,url_return); +} + bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return, QUrl *base, bool *typeRecursionDetected) @@ -280,15 +346,16 @@ QDeclarativeImportsPrivate::~QDeclarativeImportsPrivate() } bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath, const QString &uri, - QDeclarativeImportDatabase *database, - QDeclarativeDirComponents* components, QString *errorString) + QDeclarativeImportDatabase *database, + QDeclarativeDirComponents* components, QString *errorString) { QFile file(absoluteFilePath); QString filecontent; if (file.open(QFile::ReadOnly)) { filecontent = QString::fromUtf8(file.readAll()); if (qmlImportTrace()) - qDebug() << "QDeclarativeImportDatabase::add: loaded" << absoluteFilePath; + qDebug().nospace() << "QDeclarativeImports(" << qPrintable(base.toString()) << "::importExtension: " + << "loaded " << absoluteFilePath; } else { if (errorString) *errorString = QDeclarativeImportDatabase::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath); @@ -576,6 +643,10 @@ bool QDeclarativeImportedNamespace::find(const QByteArray& type, int *vmajor, in return false; } +/*! +\class QDeclarativeImportDatabase +\brief The QDeclarativeImportDatabase class manages the QML imports for a QDeclarativeEngine. +*/ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) : engine(e) { @@ -619,75 +690,19 @@ QDeclarativeImportDatabase::~QDeclarativeImportDatabase() The base URL must already have been set with Import::setBaseUrl(). */ -bool QDeclarativeImportDatabase::addToImport(QDeclarativeImports* imports, - const QDeclarativeDirComponents &qmldircomponentsnetwork, - const QString& uri, const QString& prefix, int vmaj, int vmin, - QDeclarativeScriptParser::Import::Type importType, - QString *errorString) +bool QDeclarativeImports::addImport(QDeclarativeImportDatabase *importDb, + const QString& uri, const QString& prefix, int vmaj, int vmin, + QDeclarativeScriptParser::Import::Type importType, + const QDeclarativeDirComponents &qmldircomponentsnetwork, + QString *errorString) { if (qmlImportTrace()) - qDebug().nospace() << "QDeclarativeImportDatabase::addToImport " << imports << " " << uri << " " - << vmaj << '.' << vmin << " " + qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::addImport: " + << uri << " " << vmaj << '.' << vmin << " " << (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File") << " as " << prefix; - bool ok = imports->d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, this, errorString); - return ok; -} - -/*! - \internal - - Using the given \a imports, the given (namespace qualified) \a type is resolved to either - a QDeclarativeImportedNamespace stored at \a ns_return, - a QDeclarativeType stored at \a type_return, or - a component located at \a url_return. - - If any return pointer is 0, the corresponding search is not done. - - \sa addToImport() -*/ -bool QDeclarativeImportDatabase::resolveType(const QDeclarativeImports& imports, const QByteArray& type, - QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin, - QDeclarativeImportedNamespace** ns_return, QString *errorString) const -{ - QDeclarativeImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type)); - if (ns) { - if (ns_return) - *ns_return = ns; - return true; - } - if (type_return || url_return) { - if (imports.d->find(type,vmaj,vmin,type_return,url_return, errorString)) { - if (qmlImportTrace()) { - if (type_return && *type_return && url_return && !url_return->isEmpty()) - qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << (*type_return)->typeName() << *url_return; - if (type_return && *type_return) - qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << (*type_return)->typeName(); - if (url_return && !url_return->isEmpty()) - qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << *url_return; - } - return true; - } - } - return false; -} - -/*! - \internal - - Searching \e only in the namespace \a ns (previously returned in a call to - resolveType(), \a type is found and returned to either - a QDeclarativeType stored at \a type_return, or - a component located at \a url_return. - - If either return pointer is 0, the corresponding search is not done. -*/ -bool QDeclarativeImportDatabase::resolveTypeInNamespace(QDeclarativeImportedNamespace* ns, const QByteArray& type, - QDeclarativeType** type_return, QUrl* url_return, - int *vmaj, int *vmin) const -{ - return ns->find(type,vmaj,vmin,type_return,url_return); + return d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, importDb, errorString); } /*! @@ -834,7 +849,7 @@ void QDeclarativeImportDatabase::setPluginPathList(const QStringList &paths) void QDeclarativeImportDatabase::addPluginPath(const QString& path) { if (qmlImportTrace()) - qDebug() << "QDeclarativeImportDatabase::addPluginPath" << path; + qDebug().nospace() << "QDeclarativeImportDatabase::addPluginPath: " << path; QUrl url = QUrl(path); if (url.isRelative() || url.scheme() == QLatin1String("file")) { @@ -848,7 +863,7 @@ void QDeclarativeImportDatabase::addPluginPath(const QString& path) void QDeclarativeImportDatabase::addImportPath(const QString& path) { if (qmlImportTrace()) - qDebug() << "QDeclarativeImportDatabase::addImportPath" << path; + qDebug().nospace() << "QDeclarativeImportDatabase::addImportPath: " << path; if (path.isEmpty()) return; @@ -882,7 +897,7 @@ void QDeclarativeImportDatabase::setImportPathList(const QStringList &paths) bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QString &uri, QString *errorString) { if (qmlImportTrace()) - qDebug() << "QDeclarativeImportDatabase::importPlugin" << uri << "from" << filePath; + qDebug().nospace() << "QDeclarativeImportDatabase::importPlugin: " << uri << " from " << filePath; QFileInfo fileInfo(filePath); const QString absoluteFilePath = fileInfo.absoluteFilePath(); diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/declarative/qml/qdeclarativeimport_p.h index 88246d4..84802de 100644 --- a/src/declarative/qml/qdeclarativeimport_p.h +++ b/src/declarative/qml/qdeclarativeimport_p.h @@ -65,9 +65,10 @@ QT_BEGIN_NAMESPACE class QDeclarativeTypeNameCache; class QDeclarativeEngine; class QDir; - class QDeclarativeImportedNamespace; class QDeclarativeImportsPrivate; +class QDeclarativeImportDatabase; + class QDeclarativeImports { public: @@ -79,7 +80,24 @@ public: void setBaseUrl(const QUrl &url); QUrl baseUrl() const; - void cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const; + bool resolveType(const QByteArray& type, + QDeclarativeType** type_return, QUrl* url_return, + int *version_major, int *version_minor, + QDeclarativeImportedNamespace** ns_return, + QString *errorString = 0) const; + bool resolveType(QDeclarativeImportedNamespace*, + const QByteArray& type, + QDeclarativeType** type_return, QUrl* url_return, + int *version_major, int *version_minor) const; + + bool addImport(QDeclarativeImportDatabase *, + const QString& uri, const QString& prefix, int vmaj, int vmin, + QDeclarativeScriptParser::Import::Type importType, + const QDeclarativeDirComponents &qmldircomponentsnetwork, + QString *errorString); + + void populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const; + private: friend class QDeclarativeImportDatabase; QDeclarativeImportsPrivate *d; @@ -102,21 +120,6 @@ public: void setPluginPathList(const QStringList &paths); void addPluginPath(const QString& path); - - bool addToImport(QDeclarativeImports*, const QDeclarativeDirComponents &qmldircomponentsnetwork, - const QString& uri, const QString& prefix, int vmaj, int vmin, - QDeclarativeScriptParser::Import::Type importType, - QString *errorString); - bool resolveType(const QDeclarativeImports&, const QByteArray& type, - QDeclarativeType** type_return, QUrl* url_return, - int *version_major, int *version_minor, - QDeclarativeImportedNamespace** ns_return, - QString *errorString = 0) const; - bool resolveTypeInNamespace(QDeclarativeImportedNamespace*, const QByteArray& type, - QDeclarativeType** type_return, QUrl* url_return, - int *version_major, int *version_minor ) const; - - private: friend class QDeclarativeImportsPrivate; QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, -- cgit v0.12 From f37a3adcdb990015f1f1583b267ff6f680844236 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 27 Aug 2010 15:02:50 +1000 Subject: Remove pointless \internal docs (that contain no information) --- .../graphicsitems/qdeclarativeanchors.cpp | 9 ---- .../graphicsitems/qdeclarativeborderimage.cpp | 6 --- .../graphicsitems/qdeclarativeevents.cpp | 5 -- .../graphicsitems/qdeclarativeflipable.cpp | 9 ---- .../graphicsitems/qdeclarativefocuspanel.cpp | 5 -- .../graphicsitems/qdeclarativefocusscope.cpp | 5 -- .../graphicsitems/qdeclarativegraphicswidget.cpp | 19 ------- .../graphicsitems/qdeclarativeimage.cpp | 13 ----- .../graphicsitems/qdeclarativeimagebase.cpp | 7 --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 12 ----- .../graphicsitems/qdeclarativelayoutitem.cpp | 7 --- .../graphicsitems/qdeclarativeloader.cpp | 11 ---- .../graphicsitems/qdeclarativemousearea.cpp | 11 ---- src/declarative/graphicsitems/qdeclarativepath.cpp | 58 ---------------------- .../graphicsitems/qdeclarativepositioners.cpp | 18 +------ .../graphicsitems/qdeclarativerectangle.cpp | 5 -- .../graphicsitems/qdeclarativerepeater.cpp | 21 -------- src/declarative/graphicsitems/qdeclarativetext.cpp | 26 ---------- .../graphicsitems/qdeclarativetextedit.cpp | 17 ------- .../graphicsitems/qdeclarativetextinput.cpp | 2 - .../graphicsitems/qdeclarativetranslate.cpp | 3 -- src/declarative/util/qdeclarativeanimation.cpp | 54 +------------------- src/declarative/util/qdeclarativebind.cpp | 15 +----- src/declarative/util/qdeclarativeconnections.cpp | 7 --- .../util/qdeclarativepropertychanges.cpp | 6 --- src/declarative/util/qdeclarativestate.cpp | 17 ------- src/declarative/util/qdeclarativetransition.cpp | 6 --- src/declarative/util/qdeclarativexmllistmodel.cpp | 5 -- 28 files changed, 4 insertions(+), 375 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp index 7ac2b17..26fb97f 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp @@ -148,15 +148,6 @@ static qreal adjustedPosition(QGraphicsObject *item, QDeclarativeAnchorLine::Anc return ret; } -/*! - \internal - \class QDeclarativeAnchors - \since 4.7 - \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. -*/ - QDeclarativeAnchors::QDeclarativeAnchors(QObject *parent) : QObject(*new QDeclarativeAnchorsPrivate(0), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp index e0c7fc2..f16770b 100644 --- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp @@ -79,12 +79,6 @@ QT_BEGIN_NAMESPACE rectangular item. */ -/*! - \class QDeclarativeBorderImage BorderImage - \internal - \brief The QDeclarativeBorderImage class provides an image item that you can add to a QDeclarativeView. -*/ - QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent) : QDeclarativeImageBase(*(new QDeclarativeBorderImagePrivate), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp index 0a35a3f..dbfb3fb 100644 --- a/src/declarative/graphicsitems/qdeclarativeevents.cpp +++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp @@ -60,11 +60,6 @@ Item { */ /*! - \internal - \class QDeclarativeKeyEvent -*/ - -/*! \qmlproperty int KeyEvent::key This property holds the code of the key that was pressed or released. diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp index 6ce0fa6..69dd66a 100644 --- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp @@ -99,15 +99,6 @@ public: \sa {declarative/ui-components/flipable}{Flipable example} */ -/*! - \internal - \class QDeclarativeFlipable - \brief The Flipable item provides a surface that can be flipped. - - Flipable is an item that can be visibly "flipped" between its front and - back sides. -*/ - QDeclarativeFlipable::QDeclarativeFlipable(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeFlipablePrivate), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp index 5c7959a..f345a14 100644 --- a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp +++ b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp @@ -61,11 +61,6 @@ QT_BEGIN_NAMESPACE \l {qmlfocus}{keyboard focus documentation}. */ -/*! - \internal - \class QDeclarativeFocusPanel -*/ - QDeclarativeFocusPanel::QDeclarativeFocusPanel(QDeclarativeItem *parent) : QDeclarativeItem(parent) { diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp index 4498275..da97a46 100644 --- a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp +++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp @@ -60,11 +60,6 @@ QT_BEGIN_NAMESPACE \sa {declarative/keyinteraction/focus}{Keyboard focus example} */ -/*! - \internal - \class QDeclarativeFocusScope -*/ - QDeclarativeFocusScope::QDeclarativeFocusScope(QDeclarativeItem *parent) : QDeclarativeItem(parent) { diff --git a/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp b/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp index ee45406..d45fe83 100644 --- a/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp +++ b/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp @@ -68,7 +68,6 @@ QDeclarativeGraphicsWidget::~QDeclarativeGraphicsWidget() delete d->_anchors; d->_anchors = 0; } -/*! \internal */ QDeclarativeAnchors *QDeclarativeGraphicsWidget::anchors() { Q_D(QDeclarativeGraphicsWidget); @@ -85,54 +84,36 @@ QDeclarativeItemPrivate::AnchorLines *QDeclarativeGraphicsWidgetPrivate::anchorL return _anchorLines; } -/*! - \internal -*/ QDeclarativeAnchorLine QDeclarativeGraphicsWidget::left() const { Q_D(const QDeclarativeGraphicsWidget); return d->anchorLines()->left; } -/*! - \internal -*/ QDeclarativeAnchorLine QDeclarativeGraphicsWidget::right() const { Q_D(const QDeclarativeGraphicsWidget); return d->anchorLines()->right; } -/*! - \internal -*/ QDeclarativeAnchorLine QDeclarativeGraphicsWidget::horizontalCenter() const { Q_D(const QDeclarativeGraphicsWidget); return d->anchorLines()->hCenter; } -/*! - \internal -*/ QDeclarativeAnchorLine QDeclarativeGraphicsWidget::top() const { Q_D(const QDeclarativeGraphicsWidget); return d->anchorLines()->top; } -/*! - \internal -*/ QDeclarativeAnchorLine QDeclarativeGraphicsWidget::bottom() const { Q_D(const QDeclarativeGraphicsWidget); return d->anchorLines()->bottom; } -/*! - \internal -*/ QDeclarativeAnchorLine QDeclarativeGraphicsWidget::verticalCenter() const { Q_D(const QDeclarativeGraphicsWidget); diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 1cc5f81..7a88e78 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -91,19 +91,6 @@ QT_BEGIN_NAMESPACE \sa {declarative/imageelements/image}{Image example}, QDeclarativeImageProvider */ -/*! - \internal - \class QDeclarativeImage Image - \brief The QDeclarativeImage class provides an image item that you can add to a QDeclarativeView. - - Example: - \qml - Image { source: "pics/star.png" } - \endqml - - A QDeclarativeImage object can be instantiated in QML using the tag \l Image. -*/ - QDeclarativeImage::QDeclarativeImage(QDeclarativeItem *parent) : QDeclarativeImageBase(*(new QDeclarativeImagePrivate), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index d6b935b..416604b 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -50,13 +50,6 @@ QT_BEGIN_NAMESPACE - -/*! - \class QDeclarativeImageBase - \internal - \brief The base class for declarative images. - */ - QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent) : QDeclarativeItem(dd, parent) { diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 0f16a79..1054898 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -229,12 +229,6 @@ QT_BEGIN_NAMESPACE The angle to rotate, in degrees clockwise. */ -/*! - \internal - \class QDeclarativeContents - \brief The QDeclarativeContents class gives access to the height and width of an item's contents. - -*/ QDeclarativeContents::QDeclarativeContents(QDeclarativeItem *item) : m_item(item), m_x(0), m_y(0), m_width(0), m_height(0) { //### optimize @@ -1728,7 +1722,6 @@ void QDeclarativeItemPrivate::parentProperty(QObject *o, void *rv, QDeclarativeN specify it. */ -/*! \internal */ QDeclarativeListProperty QDeclarativeItemPrivate::data() { return QDeclarativeListProperty(q_func(), 0, QDeclarativeItemPrivate::data_append); @@ -2416,7 +2409,6 @@ void QDeclarativeItemPrivate::focusChanged(bool flag) emit q->focusChanged(flag); } -/*! \internal */ QDeclarativeListProperty QDeclarativeItemPrivate::resources() { return QDeclarativeListProperty(q_func(), 0, QDeclarativeItemPrivate::resources_append, @@ -2441,7 +2433,6 @@ QDeclarativeListProperty QDeclarativeItemPrivate::resources() \sa {qmlstate}{States} */ -/*! \internal */ QDeclarativeListProperty QDeclarativeItemPrivate::states() { return _states()->statesProperty(); @@ -2465,7 +2456,6 @@ QDeclarativeListProperty QDeclarativeItemPrivate::states() */ -/*! \internal */ QDeclarativeListProperty QDeclarativeItemPrivate::transitions() { return _states()->transitionsProperty(); @@ -2538,7 +2528,6 @@ QDeclarativeListProperty QDeclarativeItemPrivate::transi \sa {qmlstates}{States} */ -/*! \internal */ QString QDeclarativeItemPrivate::state() const { if (!_stateGroup) @@ -2547,7 +2536,6 @@ QString QDeclarativeItemPrivate::state() const return _stateGroup->state(); } -/*! \internal */ void QDeclarativeItemPrivate::setState(const QString &state) { _states()->setState(state); diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp index 8509473..d71b2c5 100644 --- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp @@ -66,13 +66,6 @@ QT_BEGIN_NAMESPACE */ /*! - \internal - \class QDeclarativeLayoutItem - \brief The QDeclarativeLayoutItem class allows you to place your QML UI elements inside Qt's Graphics View layouts. -*/ - - -/*! \qmlproperty QSizeF LayoutItem::maximumSize The maximumSize property can be set to specify the maximum desired size of this LayoutItem diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 2fde4c8..5d71625 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -189,14 +189,6 @@ void QDeclarativeLoaderPrivate::initResize() \sa {dynamic-object-creation}{Dynamic Object Creation} */ -/*! - \internal - \class QDeclarativeLoader - */ - -/*! - Create a new QDeclarativeLoader instance. - */ QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeLoaderPrivate), parent) { @@ -204,9 +196,6 @@ QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent) d->flags |= QGraphicsItem::ItemIsFocusScope; } -/*! - Destroy the loader instance. - */ QDeclarativeLoader::~QDeclarativeLoader() { Q_D(QDeclarativeLoader); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 2823888..ec01549 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -317,16 +317,6 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate() \l Flickable, \c onCanceled should be used in addition to onReleased. */ -/*! - \internal - \class QDeclarativeMouseArea - \brief The QDeclarativeMouseArea class provides a simple mouse handling abstraction for use within QML. - - 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. - - A QDeclarativeMouseArea object can be instantiated in QML using the tag \l MouseArea. - */ QDeclarativeMouseArea::QDeclarativeMouseArea(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeMouseAreaPrivate), parent) { @@ -690,7 +680,6 @@ void QDeclarativeMouseArea::geometryChanged(const QRectF &newGeometry, d->lastPos = mapFromScene(d->lastScenePos); } -/*! \internal */ QVariant QDeclarativeMouseArea::itemChange(GraphicsItemChange change, const QVariant &value) { diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp index 0c069ce..f93357d 100644 --- a/src/declarative/graphicsitems/qdeclarativepath.cpp +++ b/src/declarative/graphicsitems/qdeclarativepath.cpp @@ -62,11 +62,6 @@ QT_BEGIN_NAMESPACE */ /*! - \internal - \class QDeclarativePathElement -*/ - -/*! \qmlclass Path QDeclarativePath \ingroup qml-view-elements \since 4.7 @@ -83,13 +78,6 @@ QT_BEGIN_NAMESPACE \sa PathView, PathAttribute, PathPercent, PathLine, PathQuad, PathCubic */ - -/*! - \internal - \class QDeclarativePath - \brief The QDeclarativePath class defines a path. - \sa QDeclarativePathView -*/ QDeclarativePath::QDeclarativePath(QObject *parent) : QObject(*(new QDeclarativePathPrivate), parent) { @@ -527,15 +515,6 @@ void QDeclarativeCurve::setY(qreal y) */ /*! - \internal - \class QDeclarativePathAttribute - \brief The QDeclarativePathAttribute class allows to set the value of an attribute at a given position in the path. - - \sa QDeclarativePath -*/ - - -/*! \qmlproperty string PathAttribute::name the name of the attribute to change. @@ -608,14 +587,6 @@ void QDeclarativePathAttribute::setValue(qreal value) */ /*! - \internal - \class QDeclarativePathLine - \brief The QDeclarativePathLine class defines a straight line. - - \sa QDeclarativePath -*/ - -/*! \qmlproperty real PathLine::x \qmlproperty real PathLine::y @@ -652,15 +623,6 @@ void QDeclarativePathLine::addToPath(QPainterPath &path) */ /*! - \internal - \class QDeclarativePathQuad - \brief The QDeclarativePathQuad class defines a quadratic Bezier curve with a control point. - - \sa QDeclarativePath -*/ - - -/*! \qmlproperty real PathQuad::x \qmlproperty real PathQuad::y @@ -743,14 +705,6 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path) */ /*! - \internal - \class QDeclarativePathCubic - \brief The QDeclarativePathCubic class defines a cubic Bezier curve with two control points. - - \sa QDeclarativePath -*/ - -/*! \qmlproperty real PathCubic::x \qmlproperty real PathCubic::y @@ -872,18 +826,6 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path) \sa Path */ -/*! - \internal - \class QDeclarativePathPercent - \brief The QDeclarativePathPercent class manipulates the way a path is interpreted. - - QDeclarativePathPercent allows you to bunch up items (or spread out items) along various - segments of a QDeclarativePathView's path. - - \sa QDeclarativePath - -*/ - qreal QDeclarativePathPercent::value() const { return _value; diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 4ceb5d9..b776b8e 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -108,8 +108,7 @@ void QDeclarativeBasePositioner::graphicsWidgetGeometryChanged() You also need to set a PositionerType, to declare whether you are positioning the x, y or both for the child items. Depending on the chosen type, only x or y changes will be applied. - Note that the subclass is responsible for adding the - spacing in between items. + Note that the subclass is responsible for adding the spacing in between items. */ QDeclarativeBasePositioner::QDeclarativeBasePositioner(PositionerType at, QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeBasePositionerPrivate), parent) @@ -439,11 +438,6 @@ Column { \image spacing_b.png */ -/*! - \internal - \class QDeclarativeColumn - \brief The QDeclarativeColumn class lines up items vertically. -*/ QDeclarativeColumn::QDeclarativeColumn(QDeclarativeItem *parent) : QDeclarativeBasePositioner(Vertical, parent) { @@ -579,11 +573,6 @@ Row { \image spacing_b.png */ -/*! - \internal - \class QDeclarativeRow - \brief The QDeclarativeRow class lines up items horizontally. -*/ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent) : QDeclarativeBasePositioner(Horizontal, parent) { @@ -736,11 +725,6 @@ Grid { \image spacing_b.png */ -/*! - \internal - \class QDeclarativeGrid - \brief The QDeclarativeGrid class lays out items in a grid. -*/ QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) : QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight) { diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 5990c2d..d027924 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -180,11 +180,6 @@ void QDeclarativeGradient::doUpdate() int QDeclarativeRectanglePrivate::doUpdateSlotIdx = -1; -/*! - \internal - \class QDeclarativeRectangle - \brief The QDeclarativeRectangle class provides a rectangle item that you can add to a QDeclarativeView. -*/ QDeclarativeRectangle::QDeclarativeRectangle(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeRectanglePrivate), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 4a951a2..97cf05c 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -146,23 +146,11 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() \endcode */ -/*! - \internal - \class QDeclarativeRepeater - */ - -/*! - Create a new QDeclarativeRepeater instance. - */ QDeclarativeRepeater::QDeclarativeRepeater(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeRepeaterPrivate), parent) { } -/*! - Destroy the repeater instance. All items it instantiated are also - destroyed. - */ QDeclarativeRepeater::~QDeclarativeRepeater() { } @@ -301,18 +289,12 @@ int QDeclarativeRepeater::count() const } -/*! - \internal - */ void QDeclarativeRepeater::componentComplete() { QDeclarativeItem::componentComplete(); regenerate(); } -/*! - \internal - */ QVariant QDeclarativeRepeater::itemChange(GraphicsItemChange change, const QVariant &value) { @@ -335,9 +317,6 @@ void QDeclarativeRepeater::clear() d->deletables.clear(); } -/*! - \internal - */ void QDeclarativeRepeater::regenerate() { Q_D(QDeclarativeRepeater); diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index e5ad743..f16af88 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -190,32 +190,6 @@ QSet QTextDocumentWithImageResources::errors; \sa {declarative/text/fonts}{Fonts example} */ - -/*! - \internal - \class QDeclarativeText - \qmlclass Text - - \brief The QDeclarativeText class provides a formatted text item that you can add to a QDeclarativeView. - - Text was designed for read-only text; it does not allow for any text editing. - It can display both plain and rich text. For example: - - \qml - Text { text: "Hello World!"; font.family: "Helvetica"; font.pointSize: 24; color: "red" } - Text { text: "Hello World!" } - \endqml - - \image text.png - - If height and width are not explicitly set, Text will attempt to determine how - much room is needed and set it accordingly. Unless \c wrapMode is set, it will always - prefer width to height (all text will be placed on a single line). - - The \c elide property can alternatively be used to fit a line of plain text to a set width. - - A QDeclarativeText object can be instantiated in QML using the tag \c Text. -*/ QDeclarativeText::QDeclarativeText(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeTextPrivate), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index b8e8726..b1c0fcd 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -103,23 +103,6 @@ TextEdit { \sa Text, TextInput, {declarative/text/textselection}{Text Selection example} */ -/*! - \internal - \class QDeclarativeTextEdit - \qmlclass TextEdit - - \brief The QDeclarativeTextEdit class provides an editable formatted text item that you can add to a QDeclarativeView. - - It can display both plain and rich text. - - \image declarative-textedit.png - - A QDeclarativeTextEdit object can be instantiated in QML using the tag \c <TextEdit>. -*/ - -/*! - Constructs a new QDeclarativeTextEdit. -*/ QDeclarativeTextEdit::QDeclarativeTextEdit(QDeclarativeItem *parent) : QDeclarativePaintedItem(*(new QDeclarativeTextEditPrivate), parent) { diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index b4f36f4..5604b82 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -437,8 +437,6 @@ void QDeclarativeTextInput::setCursorPosition(int cp) } /*! - \internal - Returns a Rect which encompasses the cursor, but which may be larger than is required. Ignores custom cursor delegates. */ diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp index 0bae0cd..2e0af2a 100644 --- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp +++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp @@ -116,9 +116,6 @@ void QDeclarativeTranslate::setY(qreal y) emit yChanged(); } -/*! - \internal -*/ void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const { Q_D(const QDeclarativeTranslate); diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 4e9e8d5..267642d 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -84,11 +84,6 @@ QT_BEGIN_NAMESPACE element directly will result in an error. */ -/*! - \class QDeclarativeAbstractAnimation - \internal -*/ - QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QObject *parent) : QObject(*(new QDeclarativeAbstractAnimationPrivate), parent) { @@ -574,12 +569,6 @@ void QDeclarativeAbstractAnimation::timelineComplete() \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ -/*! - \internal - \class QDeclarativePauseAnimation -*/ - - QDeclarativePauseAnimation::QDeclarativePauseAnimation(QObject *parent) : QDeclarativeAbstractAnimation(*(new QDeclarativePauseAnimationPrivate), parent) { @@ -659,11 +648,6 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation() \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ -/*! - \internal - \class QDeclarativeColorAnimation -*/ - QDeclarativeColorAnimation::QDeclarativeColorAnimation(QObject *parent) : QDeclarativePropertyAnimation(parent) { @@ -776,10 +760,6 @@ void QDeclarativeColorAnimation::setTo(const QColor &t) \sa StateChangeScript */ -/*! - \internal - \class QDeclarativeScriptAction -*/ QDeclarativeScriptAction::QDeclarativeScriptAction(QObject *parent) :QDeclarativeAbstractAnimation(*(new QDeclarativeScriptActionPrivate), parent) { @@ -933,10 +913,6 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation() \sa {QML Animation}, QtDeclarative */ -/*! - \internal - \class QDeclarativePropertyAction -*/ QDeclarativePropertyAction::QDeclarativePropertyAction(QObject *parent) : QDeclarativeAbstractAnimation(*(new QDeclarativePropertyActionPrivate), parent) { @@ -1185,12 +1161,6 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions, \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ - -/*! - \internal - \class QDeclarativeNumberAnimation -*/ - QDeclarativeNumberAnimation::QDeclarativeNumberAnimation(QObject *parent) : QDeclarativePropertyAnimation(parent) { @@ -1276,7 +1246,7 @@ void QDeclarativeNumberAnimation::setTo(qreal t) /*! \qmlclass Vector3dAnimation QDeclarativeVector3dAnimation - \ingroup qml-animation-transition + \ingroup qml-animation-transition \since 4.7 \inherits PropertyAnimation \brief The Vector3dAnimation element animates changes in QVector3d values. @@ -1291,12 +1261,6 @@ void QDeclarativeNumberAnimation::setTo(qreal t) \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ - -/*! - \internal - \class QDeclarativeVector3dAnimation -*/ - QDeclarativeVector3dAnimation::QDeclarativeVector3dAnimation(QObject *parent) : QDeclarativePropertyAnimation(parent) { @@ -1396,12 +1360,6 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ - -/*! - \internal - \class QDeclarativeRotationAnimation -*/ - QVariant _q_interpolateShortestRotation(qreal &f, qreal &t, qreal progress) { qreal newt = t; @@ -1702,11 +1660,6 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio \sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example} */ -/*! - \internal - \class QDeclarativeParallelAnimation -*/ - QDeclarativeParallelAnimation::QDeclarativeParallelAnimation(QObject *parent) : QDeclarativeAnimationGroup(parent) { @@ -2512,11 +2465,6 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions \sa {QML Animation}, {declarative/animation/basics}{Animation basics example} */ - -/*! - \internal - \class QDeclarativeParentAnimation -*/ QDeclarativeParentAnimation::QDeclarativeParentAnimation(QObject *parent) : QDeclarativeAnimationGroup(*(new QDeclarativeParentAnimationPrivate), parent) { diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp index 86d08f5..88b45ae 100644 --- a/src/declarative/util/qdeclarativebind.cpp +++ b/src/declarative/util/qdeclarativebind.cpp @@ -72,7 +72,7 @@ public: /*! \qmlclass Binding QDeclarativeBind - \ingroup qml-working-with-data + \ingroup qml-working-with-data \since 4.7 \brief The Binding element allows arbitrary property bindings to be created. @@ -95,18 +95,7 @@ public: immediately pushed onto the new target. \sa QtDeclarative - */ -/*! - \internal - \class QDeclarativeBind - \brief The QDeclarativeBind class allows arbitrary property bindings to be created. - - Simple bindings are usually earier to do in-place rather than creating a - QDeclarativeBind item. For that reason, QDeclarativeBind is usually used to transfer property information - from Qml to C++. - - \sa cppqml - */ +*/ QDeclarativeBind::QDeclarativeBind(QObject *parent) : QObject(*(new QDeclarativeBindPrivate), parent) { diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp index 293928e..15e5ac5 100644 --- a/src/declarative/util/qdeclarativeconnections.cpp +++ b/src/declarative/util/qdeclarativeconnections.cpp @@ -124,13 +124,6 @@ public: \sa QtDeclarative */ - -/*! - \internal - \class QDeclarativeConnections - \brief The QDeclarativeConnections class describes generalized connections to signals. - -*/ QDeclarativeConnections::QDeclarativeConnections(QObject *parent) : QObject(*(new QDeclarativeConnectionsPrivate), parent) { diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index c28ada3..e897458 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -127,12 +127,6 @@ QT_BEGIN_NAMESPACE */ /*! - \internal - \class QDeclarativePropertyChanges - \brief The QDeclarativePropertyChanges class describes new property values for a state. -*/ - -/*! \qmlproperty Object PropertyChanges::target This property holds the object which contains the properties to be changed. */ diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 6e17cf2..1ed7923 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -123,9 +123,6 @@ bool QDeclarativeActionEvent::override(QDeclarativeActionEvent *other) return false; } -/*! - \internal -*/ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent) : QObject(dd, parent) { @@ -164,20 +161,6 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje \sa {declarative/animation/states}{states example}, {qmlstates}{States}, {qdeclarativeanimation.html#transitions}{QML Transitions}, QtDeclarative */ - -/*! - \internal - \class QDeclarativeState - \brief The QDeclarativeState class allows you to define configurations of objects and properties. - - - QDeclarativeState allows you to specify a state as a set of batched changes from the default - configuration. - - \sa {states-transitions}{States and Transitions} -*/ - - QDeclarativeState::QDeclarativeState(QObject *parent) : QObject(*(new QDeclarativeStatePrivate), parent) { diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp index 21d7ded..478c7f4 100644 --- a/src/declarative/util/qdeclarativetransition.cpp +++ b/src/declarative/util/qdeclarativetransition.cpp @@ -99,12 +99,6 @@ QT_BEGIN_NAMESPACE \sa {QML Animation}, {declarative/animation/states}{states example}, {qmlstates}{States}, {QtDeclarative} */ -/*! - \internal - \class QDeclarativeTransition - \brief The QDeclarativeTransition class allows you to define animated transitions that occur on state changes. -*/ - //ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting //and disconnecting signals and slots frequently class ParallelAnimationWrapper : public QParallelAnimationGroup diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 02bf370..47b502d 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -498,11 +498,6 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty Date: Fri, 27 Aug 2010 15:11:39 +1000 Subject: Remove pointless \internal docs (that contain no information) --- .../graphicsitems/qdeclarativeanimatedimage.cpp | 5 ---- src/imports/particles/qdeclarativeparticles.cpp | 33 ---------------------- 2 files changed, 38 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp index e0a2149..a95e944 100644 --- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp @@ -54,11 +54,6 @@ QT_BEGIN_NAMESPACE /*! - \class QDeclarativeAnimatedImage - \internal -*/ - -/*! \qmlclass AnimatedImage QDeclarativeAnimatedImage \inherits Image \since 4.7 diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp index 5cd9c0c..edb69bc 100644 --- a/src/imports/particles/qdeclarativeparticles.cpp +++ b/src/imports/particles/qdeclarativeparticles.cpp @@ -165,14 +165,6 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle) It has no further properties. */ - -/*! - \internal - \class QDeclarativeParticleMotionLinear - \ingroup group_effects - \brief The QDeclarativeParticleMotionLinear class moves the particles linearly. -*/ - void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval) { p.x += interval * p.x_velocity; @@ -196,14 +188,6 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte */ /*! - \internal - \class QDeclarativeParticleMotionGravity - \ingroup group_effects - \brief The QDeclarativeParticleMotionGravity class moves the particles towards a point. - -*/ - -/*! \qmlproperty real ParticleMotionGravity::xattractor \qmlproperty real ParticleMotionGravity::yattractor These properties hold the x and y coordinates of the point attracting the particles. @@ -311,16 +295,6 @@ Rectangle { */ /*! - \internal - \class QDeclarativeParticleMotionWander - \ingroup group_effects - \brief The QDeclarativeParticleMotionWander class moves particles in a somewhat random fashion. - - The particles will continue roughly in the original direction, however will randomly - drift to each side. -*/ - -/*! \qmlproperty real ParticleMotionWander::xvariance \qmlproperty real ParticleMotionWander::yvariance @@ -709,13 +683,6 @@ Rectangle { \image particles.gif */ -/*! - \internal - \class QDeclarativeParticles - \ingroup group_effects - \brief The QDeclarativeParticles class generates and moves particles. -*/ - QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent) : QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent) { -- cgit v0.12 From 7f69818e7dcd5b029010e5f930abed519956a8ff Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 27 Aug 2010 15:44:20 +1000 Subject: Cleanup --- src/declarative/qml/qdeclarativecompiler.cpp | 9 +++++---- src/declarative/qml/qdeclarativecontext.cpp | 8 +++----- src/declarative/qml/qdeclarativeparser_p.h | 7 +++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 34d33bb..f044e1a 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -668,13 +668,14 @@ void QDeclarativeCompiler::compileTree(Object *tree) QString scriptCode = QString::fromUtf8(unit->scripts.at(ii).resource->data); Object::ScriptBlock::Pragmas pragmas = QDeclarativeScriptParser::extractPragmas(scriptCode); + Q_ASSERT(!importedScripts.contains(unit->scripts.at(ii).qualifier)); + if (!scriptCode.isEmpty()) { Object::ScriptBlock &scriptBlock = importedScripts[unit->scripts.at(ii).qualifier]; - scriptBlock.codes.append(scriptCode); - scriptBlock.lineNumbers.append(1); - scriptBlock.files.append(unit->scripts.at(ii).resource->url); - scriptBlock.pragmas.append(pragmas); + scriptBlock.code = scriptCode; + scriptBlock.file = unit->scripts.at(ii).resource->url; + scriptBlock.pragmas = pragmas; } } diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp index a3b16d9..de45a95 100644 --- a/src/declarative/qml/qdeclarativecontext.cpp +++ b/src/declarative/qml/qdeclarativecontext.cpp @@ -660,14 +660,12 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object if (!engine) return; - Q_ASSERT(script.codes.count() == 1); - QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine); QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine); - const QString &code = script.codes.at(0); - const QString &url = script.files.at(0); - const QDeclarativeParser::Object::ScriptBlock::Pragmas &pragmas = script.pragmas.at(0); + const QString &code = script.code; + const QString &url = script.file; + const QDeclarativeParser::Object::ScriptBlock::Pragmas &pragmas = script.pragmas; Q_ASSERT(!url.isEmpty()); diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h index d192f3a..c58aebc 100644 --- a/src/declarative/qml/qdeclarativeparser_p.h +++ b/src/declarative/qml/qdeclarativeparser_p.h @@ -183,10 +183,9 @@ namespace QDeclarativeParser }; Q_DECLARE_FLAGS(Pragmas, Pragma) - QStringList codes; - QStringList files; - QList lineNumbers; - QList pragmas; + QString code; + QString file; + Pragmas pragmas; }; // The bytes to cast instances by to get to the QDeclarativeParserStatus -- cgit v0.12 From 74a7c2e6d179e809c93422c8aa590c922be6b6e8 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 27 Aug 2010 10:21:03 +0300 Subject: Updated some URLs and required tools versions for Symbian Reviewed-by: Janne Koskinen --- doc/src/getting-started/installation.qdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 629d8b7..708f166 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -1211,9 +1211,9 @@ applications using Qt for Symbian can start right away.} Qt for the Symbian platform requires the following software installed on your development PC: \list - \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} + \o \l{http://www.forum.nokia.com/Library/Tools_and_downloads/Other/Carbide.c++/}{Carbide.c++ v2.3.0 or higher recommended}. \list - \o \bold{Note:} It may be necessary to update the Carbide compiler. + \o \bold{Note:} It may be necessary to update the Carbide compiler depending on Carbide version. See \l{http://pepper.troll.no/s60prereleases/patches/}{here} for instructions how to check your compiler version and how to patch it, if needed. \endlist @@ -1223,18 +1223,18 @@ applications using Qt for Symbian can start right away.} but that version is no longer available from ActiveState. However, Qt for Symbian has been successfully compiled using both 5.8.x and 5.10.x versions. \endlist - \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher} + \o \l{http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html}{S60 Platform SDK 3rd Edition FP1 or higher} \list \o \bold{Note:} Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special update. The update can be found \l{http://pepper.troll.no/s60prereleases/patches/}{here}. \endlist - \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}. + \o \l{http://www.forum.nokia.com/info/sw.nokia.com/id/91d89929-fb8c-4d66-bea0-227e42df9053/Open_C_SDK_Plug-In.html}{Open C/C++ v1.7.5 or higher}. Install this to all Symbian SDKs you plan to use Qt with. \o Building Qt tools from scratch requires \l{http://www.mingw.org/}{MinGW 3.4.5 or higher}, or another windows compiler. \list \o \bold{Note:} This is not required if you are using pre-built binary package. \endlist - \o Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} version 2.2 (build 686 or later), + \o Building Qt libraries requires \l{http://www.arm.com/products/tools/software-development-tools.php}{RVCT} version 2.2 (build 686 or later), which is not available free of charge. Usage of later versions of RVCT, including the 3.x and 4.x series, is not supported in this release. \endlist -- cgit v0.12 From a9500afc79d3f4b33b4506c15deeb21d2a910a44 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 27 Aug 2010 11:42:55 +0200 Subject: doc: Fixed numerous qdoc warnings. --- src/gui/graphicsview/qgraphicsitem.cpp | 39 +++++++++-------------------- src/gui/graphicsview/qgraphicstransform.cpp | 32 ++++++----------------- 2 files changed, 19 insertions(+), 52 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 0b3b164..57d1071 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7758,19 +7758,22 @@ void QGraphicsItemPrivate::resetHeight() } /*! - \property QGraphicsObject::children - \internal -*/ + \property QGraphicsObject::children + \since 4.7 + \internal + */ /*! - \property QGraphicsObject::width - \internal -*/ + \property QGraphicsObject::width + \since 4.7 + \internal + */ /*! - \property QGraphicsObject::height - \internal -*/ + \property QGraphicsObject::height + \since 4.7 + \internal + */ /*! \property QGraphicsObject::parent @@ -7985,24 +7988,6 @@ void QGraphicsItemPrivate::resetHeight() */ /*! - \property QGraphicsObject::children - \since 4.7 - \internal -*/ - -/*! - \property QGraphicsObject::width - \since 4.7 - \internal -*/ - -/*! - \property QGraphicsObject::height - \since 4.7 - \internal -*/ - -/*! \class QAbstractGraphicsShapeItem \brief The QAbstractGraphicsShapeItem class provides a common base for all path items. diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp index bd3f2ef..1f155c6 100644 --- a/src/gui/graphicsview/qgraphicstransform.cpp +++ b/src/gui/graphicsview/qgraphicstransform.cpp @@ -346,21 +346,24 @@ void QGraphicsScale::applyTo(QMatrix4x4 *matrix) const /*! \fn QGraphicsScale::xScaleChanged() + \since 4.7 - QGraphicsScale emits this signal when its xScale changes. + This signal is emitted whenever the \l xScale property changes. */ /*! \fn QGraphicsScale::yScaleChanged() + \since 4.7 - QGraphicsScale emits this signal when its yScale changes. + This signal is emitted whenever the \l yScale property changes. */ /*! \fn QGraphicsScale::zScaleChanged() + \since 4.7 - QGraphicsScale emits this signal when its zScale changes. -*/ + This signal is emitted whenever the \l zScale property changes. +*/ /*! \fn QGraphicsScale::scaleChanged() @@ -583,27 +586,6 @@ void QGraphicsRotation::applyTo(QMatrix4x4 *matrix) const \sa QGraphicsRotation::axis */ -/*! - \fn QGraphicsScale::xScaleChanged() - \since 4.7 - - This signal is emitted whenever the \l xScale property changes. -*/ - -/*! - \fn QGraphicsScale::yScaleChanged() - \since 4.7 - - This signal is emitted whenever the \l yScale property changes. -*/ - -/*! - \fn QGraphicsScale::zScaleChanged() - \since 4.7 - - This signal is emitted whenever the \l zScale property changes. -*/ - #include "moc_qgraphicstransform.cpp" QT_END_NAMESPACE -- cgit v0.12