From 9b0f381f2a6304467ec0dae019b356e1c63c0725 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 15 Mar 2012 12:52:49 +0000 Subject: QRegularExpression: various documentation improvements/fixes Change-Id: I683afb24f888ab6cf3c543fba8cd193a730709af Reviewed-by: Casper van Donderen --- src/corelib/tools/qregularexpression.cpp | 39 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 1db78519a3..eaa20b304a 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -135,7 +135,7 @@ QT_BEGIN_NAMESPACE \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 2 - The pattern() function returns the pattern that it's currently set for a + The pattern() function returns the pattern that is currently set for a QRegularExpression object: \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 3 @@ -342,9 +342,9 @@ QT_BEGIN_NAMESPACE string; however, the subpattern \c{def} matches the subject string completely, and therefore a complete match is reported. - In case multiple partial matches are found when matching (but no complete - match), then the QRegularExpressionMatch will report the first one that it - is found. For instance: + If multiple partial matches are found when matching (but no complete + match), then the QRegularExpressionMatch object will report the first one + that is found. For instance: \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 18 @@ -440,7 +440,7 @@ QT_BEGIN_NAMESPACE \section2 Exact matching - QRegExp::exactMatch in Qt 4 served for two purposes: it exactly matched + QRegExp::exactMatch() in Qt 4 served two purposes: it exactly matched a regular expression against a subject string, and it implemented partial matching. In fact, if an exact match was not found, one could still find out how much of the subject string was matched by the regular expression @@ -478,9 +478,20 @@ QT_BEGIN_NAMESPACE matching correctly (that is, like Perl does). In particular, patterns that can match 0 characters (like \c{"a*"}) are problematic. - QRegularExpression::globalMatch implements Perl global match correctly, and + QRegularExpression::globalMatch() implements Perl global match correctly, and the returned iterator can be used to examine each result. + \section2 Unicode properties support + + When using QRegExp, character classes such as \c{\w}, \c{\d}, etc. match + characters with the corresponding Unicode property: for instance, \c{\d} + matches any character with the Unicode Nd (decimal digit) property. + + Those character classes only match ASCII characters by default when using + QRegularExpression: for instance, \c{\d} matches exactly a character in the + \c{0-9} ASCII range. It is possible to change this behaviour by using the + UseUnicodePropertiesOption pattern option. + \section2 Wildcard matching There is no equivalent of wildcard matching in QRegularExpression. @@ -494,11 +505,11 @@ QT_BEGIN_NAMESPACE \section2 Minimal matching - QRegExp::setMinimal implemented minimal matching by simply reversing the + QRegExp::setMinimal() implemented minimal matching by simply reversing the greediness of the quantifiers (QRegExp did not support lazy quantifiers, like \c{*?}, \c{+?}, etc.). QRegularExpression instead does support greedy, lazy and possessive quantifiers. The InvertedGreedinessOption - pattern option can be useful to emulate the effects of QRegExp::setMinimal: + pattern option can be useful to emulate the effects of QRegExp::setMinimal(): if enabled, it inverts the greediness of quantifiers (greedy ones become lazy and vice versa). @@ -675,7 +686,7 @@ QT_BEGIN_NAMESPACE equivalent for this option in Perl regular expressions. \value UseUnicodePropertiesOption - The meaning of the \c{\w}, \c{\d}, etc., character types, as well as + The meaning of the \c{\w}, \c{\d}, etc., character classes, as well as the meaning of their counterparts (\c{\W}, \c{\D}, etc.), is changed from matching ASCII charaters only to matching any character with the corresponding Unicode property. For instance, \c{\d} is changed to @@ -1004,12 +1015,18 @@ class QPcreJitStackPointer Q_DISABLE_COPY(QPcreJitStackPointer); public: + /*! + \internal + */ QPcreJitStackPointer() { // The default JIT stack size in PCRE is 32K, // we allocate from 32K up to 512K. stack = pcre16_jit_stack_alloc(32*1024, 512*1024); } + /*! + \internal + */ ~QPcreJitStackPointer() { if (stack) @@ -1572,8 +1589,8 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const a backslash all characters in \a str, except for the characters in the \c{[A-Z]}, \c{[a-z]} and \c{[0-9]} ranges, as well as the underscore (\c{_}) character. The only difference with Perl is that a literal NUL - inside \a str is escaped with the sequence \c{"\\\\0"} (backslash + - \c{'0'}), instead of \c{"\\\\\\0"} (backslash + \c{NUL}). + inside \a str is escaped with the sequence \c{"\\0"} (backslash + + \c{'0'}), instead of \c{"\\\0"} (backslash + \c{NUL}). */ QString QRegularExpression::escape(const QString &str) { -- cgit v1.2.3 From c7fb7a678251a6fc090d851b897f67d561b66625 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Fri, 16 Mar 2012 15:09:18 +1000 Subject: Fix broken qWaitForWindowShown() behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qWaitForWindowShown() should check window->isActive() instead of window->isExposed() and return false if timeout. Add two new qWaitForWindowActive() and qWaitForWindowExposed() functions. Change-Id: Idd9601805c2e84b0d36ddd5471031b627d289953 Reviewed-by: Samuel Rødal --- src/testlib/qtestcase.cpp | 33 ++++++++++++++++++++++++++++++++- src/testlib/qtestsystem.h | 26 +++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 001a14a121..a26fa71eb4 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -862,7 +862,7 @@ QT_BEGIN_NAMESPACE /*! \fn bool QTest::qWaitForWindowShown(QWidget *window) \since 4.6 - Waits until the \a window is shown in the screen. This is mainly useful for + Waits until the \a window is shown on the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some time after being asked to show itself on the screen. Returns true. @@ -870,6 +870,37 @@ QT_BEGIN_NAMESPACE \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 24 */ +/*! \fn bool QTest::qWaitForWindowShown(QWindow *window, int timeout) + \since 5.0 + + Waits for \a timeout milliseconds or until the \a window is shown on the screen. + This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some + time after being asked to show itself on the screen. + + Returns true if \c window is show in \a timout milliseconds, otherwise returns false. + + \sa QTest::qWaitForWindowActive(), QTest::qWaitForWindowExposed() +*/ + +/*! \fn bool QTest::qWaitForWindowActive(QWindow *window, int timeout) + \since 5.0 + + Waits for \a timeout milliseconds or until the \a window is active. + + Returns true if \c window is active in \a timout milliseconds, otherwise returns false. + + \sa QTest::qWaitForWindowActive(), QTest::qWaitForWindowShown(), QWindow::isActive() +*/ + +/*! \fn bool QTest::qWaitForWindowExposed(QWindow *window, int timeout) + \since 5.0 + + Waits for \a timeout milliseconds or until the \a window is exposed. + Returns true if \c window is exposed in \a timout milliseconds, otherwise returns false. + + \sa QTest::qWaitForWindowShown(), QTest::qWaitForWindowExposed(), QWindow::isExposed() +*/ + /*! \class QTest::QTouchEventSequence \inmodule QtTest diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index ade5f4c8ac..095f791cac 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -76,19 +76,39 @@ namespace QTest return true; } - inline static bool qWaitForWindowShown(QWindow *window) + inline static bool qWaitForWindowActive(QWindow *window, int timeout = 1000) + { + QElapsedTimer timer; + timer.start(); + while (!window->isActive()) { + int remaining = timeout - int(timer.elapsed()); + if (remaining <= 0) + break; + QCoreApplication::processEvents(QEventLoop::AllEvents, remaining); + QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + QTest::qSleep(10); + } + return window->isActive(); + } + + inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 1000) { QElapsedTimer timer; timer.start(); while (!window->isExposed()) { - int remaining = int(timer.elapsed()) - 1000; + int remaining = timeout - int(timer.elapsed()); if (remaining <= 0) break; QCoreApplication::processEvents(QEventLoop::AllEvents, remaining); QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QTest::qSleep(10); } - return true; + return window->isExposed(); + } + + inline static bool qWaitForWindowShown(QWindow *window, int timeout = 1000) + { + return qWaitForWindowActive(window, timeout); } } -- cgit v1.2.3 From 4e5bfab52c65fd408209503e5512c35d44b4a82e Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Fri, 16 Mar 2012 10:15:10 +0100 Subject: Cocoa: Fix menu item activation. Handle the action message on the application delegate. Change-Id: I23686fd6e936a4dbbb141da3dd04a64cbf6a051a Reviewed-by: Bradley T. Hughes --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index fc600ebddd..e405c81726 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -354,7 +354,7 @@ static void cleanupCocoaApplicationDelegate() - (void)qtDispatcherToQAction:(id)sender { Q_UNUSED(sender); - //[[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender]; + [qtMenuLoader qtDispatcherToQAction:sender]; } @end -- cgit v1.2.3 From 932fdbf4dd91da9de20fdb46d21058df6f7cb14f Mon Sep 17 00:00:00 2001 From: Wolf-Michael Bolle Date: Thu, 15 Mar 2012 16:03:12 +0100 Subject: Removed move constructor. The provided implementation breaks backward compatiblity, and therefore has to disappear altogether. See also the discussion at http://codereview.qt-project.org/#change,19150 Change-Id: Idf6e4a2c4b623458217541485e4aab0837909d66 Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira --- src/dbus/qdbusunixfiledescriptor.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h index ad5d00ba0b..bfb2262a31 100644 --- a/src/dbus/qdbusunixfiledescriptor.h +++ b/src/dbus/qdbusunixfiledescriptor.h @@ -58,7 +58,6 @@ QT_BEGIN_NAMESPACE class QDBusUnixFileDescriptorPrivate; -template<> QExplicitlySharedDataPointer::~QExplicitlySharedDataPointer(); class Q_DBUS_EXPORT QDBusUnixFileDescriptor { @@ -80,8 +79,6 @@ public: static bool isSupported(); #if defined(Q_COMPILER_RVALUE_REFS) - QDBusUnixFileDescriptor(QDBusUnixFileDescriptor &&other) : d(static_cast(other.d)) - { } inline QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) { d.swap(other.d); return *this; } #endif -- cgit v1.2.3 From 389f2a076d3321c285fb9652177ccb3367019e51 Mon Sep 17 00:00:00 2001 From: Wolf-Michael Bolle Date: Thu, 15 Mar 2012 15:56:14 +0100 Subject: Removed move constructor. All C++-2011-specific constructors, operators and methods may be inline only in Qt. Since an implementation in the header file does not seem to be possible for QMimeType without breaking backward compatiblity the move constructor has to disappear altogether. See also the discussion at http://codereview.qt-project.org/#change,19150 Change-Id: If07347a51a1ae5bd4c2d292dac835592ede4b370 Reviewed-by: Thiago Macieira --- src/corelib/mimetypes/qmimetype.cpp | 19 ------------------- src/corelib/mimetypes/qmimetype.h | 2 -- 2 files changed, 21 deletions(-) diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp index ebf687bb4b..18ce5e5000 100644 --- a/src/corelib/mimetypes/qmimetype.cpp +++ b/src/corelib/mimetypes/qmimetype.cpp @@ -181,25 +181,6 @@ QMimeType &QMimeType::operator=(const QMimeType &other) return *this; } -#ifdef Q_COMPILER_RVALUE_REFS -/*! - \fn QMimeType::QMimeType(QMimeType &&other); - Constructs this QMimeType object by moving the data of the rvalue reference \a other. - */ -QMimeType::QMimeType(QMimeType &&other) : - d(std::move(other.d)) -{ - DBG() << "name():" << name(); - //DBG() << "aliases():" << aliases(); - //DBG() << "comment():" << comment(); - DBG() << "genericIconName():" << genericIconName(); - DBG() << "iconName():" << iconName(); - DBG() << "globPatterns():" << globPatterns(); - DBG() << "suffixes():" << suffixes(); - DBG() << "preferredSuffix():" << preferredSuffix(); -} -#endif - /*! \fn QMimeType::QMimeType(const QMimeTypePrivate &dd); Assigns the data of the QMimeTypePrivate \a dd to this QMimeType object, and returns a reference to this object. diff --git a/src/corelib/mimetypes/qmimetype.h b/src/corelib/mimetypes/qmimetype.h index 68d17caaba..172973e77a 100644 --- a/src/corelib/mimetypes/qmimetype.h +++ b/src/corelib/mimetypes/qmimetype.h @@ -59,8 +59,6 @@ public: QMimeType(const QMimeType &other); QMimeType &operator=(const QMimeType &other); #ifdef Q_COMPILER_RVALUE_REFS - QMimeType(QMimeType &&other); - QMimeType &operator=(QMimeType &&other) { qSwap(d, other.d); -- cgit v1.2.3 From 2ea976c3a713535c2419d936d575e0b24545f0fa Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 16 Mar 2012 11:13:55 +0200 Subject: Fix font cache check in QFontEngineFT::recalcAdvances() Cached font was used regardless of the format, resulting in incorrect advance in some cases when default format differed from the cached format. Task-number: QTBUG-24188 Change-Id: I39e4156bd9ba743afa7e106e934c90227fbf2b8b Reviewed-by: Jiang Jiang --- src/gui/text/qfontengine_ft.cpp | 4 +++- tests/auto/gui/painting/qpainter/qpainter.pro | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 8880eb7cb3..5dc757b6ce 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1564,7 +1564,9 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag (flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0; - if (g) { + // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph + GlyphFormat acceptableFormat = (defaultFormat != Format_None) ? defaultFormat : Format_Mono; + if (g && g->format == acceptableFormat) { glyphs->advances_x[i] = design ? QFixed::fromFixed(g->linearAdvance) : QFixed(g->advance); } else { if (!face) diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index 2cbd5b7e1c..15af82a9bd 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -4,8 +4,6 @@ TARGET = tst_qpainter QT += widgets widgets-private printsupport testlib SOURCES += tst_qpainter.cpp -mac*:CONFIG+=insignificant_test -win32:CONFIG += insignificant_test # QTBUG-24188 TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png -- cgit v1.2.3 From c0791b86ab4b006f9ab2b7f932d5c76a159f6c08 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 16 Mar 2012 12:17:26 +0100 Subject: allow the unix generator to run in windows host mode this is a complete bastardization of the concept and breaks the (unused) debugging feature to create proper unix makefiles under windows, but apparently it permits cross-compiling unix targets under windows. Change-Id: I4ee95a20e7d6a6b2063ec7aa22f52c1a97d78a77 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- qmake/generators/metamakefile.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index b855585500..c69d5a5812 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -520,6 +520,9 @@ MetaMakefileGenerator::modesForGenerator(const QString &gen, #ifdef Q_OS_MAC *host_mode = Option::HOST_MACX_MODE; *target_mode = Option::TARG_MACX_MODE; +#elif defined(Q_OS_WIN) + *host_mode = Option::HOST_WIN_MODE; + *target_mode = Option::TARG_UNIX_MODE; #else *host_mode = Option::HOST_UNIX_MODE; *target_mode = Option::TARG_UNIX_MODE; -- cgit v1.2.3 From b84ff8525cc9ec08de710a8c1fed8d88f44f6543 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 15 Mar 2012 23:20:53 -0700 Subject: Install fonts when not using fontconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When built without fontconfig support, the basic unix font database relies on fonts installed in libs/fonts to populate the database. Change-Id: Id1e54c5b032095470049210bb831cfe4c79b3569 Reviewed-by: Johannes Zellner Reviewed-by: Donald Carr Reviewed-by: Oswald Buddenhagen Reviewed-by: Samuel Rødal --- mkspecs/features/qpa/genericunixfontdatabase.prf | 5 +++++ mkspecs/features/qt_installs.prf | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/qpa/genericunixfontdatabase.prf b/mkspecs/features/qpa/genericunixfontdatabase.prf index 20b31a7e67..36a358271c 100644 --- a/mkspecs/features/qpa/genericunixfontdatabase.prf +++ b/mkspecs/features/qpa/genericunixfontdatabase.prf @@ -2,4 +2,9 @@ CONFIG += qpa/basicunixfontdatabase contains(QT_CONFIG, fontconfig) { DEFINES += Q_FONTCONFIGDATABASE LIBS += -lfontconfig +} else { + fonts.path = $$[QT_INSTALL_LIBS]/fonts + fonts.files = $$QT_SOURCE_TREE/lib/fonts/* + INSTALLS += fonts } + diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index 8b17aa90fb..97e52f670d 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -35,9 +35,3 @@ qt_install_headers { INSTALLS += private_headers } -embedded: equals(TARGET, QtGui) { - # install fonts for embedded - INSTALLS += fonts - fonts.path = $$[QT_INSTALL_LIBS]/fonts - fonts.files = $$QT_SOURCE_TREE/lib/fonts/* -} -- cgit v1.2.3 From 42a7eb8df61d280fed1f9cafe9588f7da6dd3f0e Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 16 Mar 2012 14:14:53 +0000 Subject: Ensure QMAKE_RFLAGSDIR is set correctly This patch ensures that additional runpaths passed to configure via the -R switch are added to the QMAKE_RFLAGSDIR variable. Previously, although runpaths provided in this way were appended to the linker options when building Qt itself, they were not appended to the QMAKE_RFLAGSDIR value written to mkspecs/qconfig.pri. This meant that the DT_RPATH attribute was set incorrectly in binaries built from projects other than Qt itself. ----------------------------------------------------------------------- Configure flags Expected value Value before this fix ----------------------------------------------------------------------- DEFAULT_RPATH DEFAULT_RPATH -no-rpath -R X DEFAULT_RPATH:X DEFAULT_RPATH -no-rpath -R X X -prefix Y Y/lib Y/lib -prefix Y -no-rpath -prefix Y -R X Y/lib:X Y/lib -prefix Y -no-rpath -R X X ----------------------------------------------------------------------- DEFAULT_RPATH = /usr/local/Qt-${QT_VERSION}/lib Change-Id: Iaf1809b528ebd249694cf41e004173e881ca48ad Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 93dda6fe6c..4a53773544 100755 --- a/configure +++ b/configure @@ -6294,8 +6294,8 @@ if [ -n "$CFG_SYSROOT" ]; then echo "}" >> "$QTCONFIG.tmp" echo >> "$QTCONFIG.tmp" fi -if [ "$CFG_RPATH" = "yes" ]; then - echo "QMAKE_RPATHDIR += \"$QT_INSTALL_LIBS\"" >> "$QTCONFIG.tmp" +if [ -n "$RPATH_FLAGS" ]; then + echo "QMAKE_RPATHDIR += $RPATH_FLAGS" >> "$QTCONFIG.tmp" fi if [ -n "$QT_GCC_MAJOR_VERSION" ]; then echo "QT_GCC_MAJOR_VERSION = $QT_GCC_MAJOR_VERSION" >> "$QTCONFIG.tmp" -- cgit v1.2.3 From 52c1df5a7c1a95b420c7cf65ffd092a787bf0779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 16 Mar 2012 09:01:50 +0100 Subject: Updated changes-5.0.0 with some information on the new QtGui classes. Change-Id: Idcdfdb506e75d74b3a89e6c2e914802ddfc11031 Reviewed-by: Casper van Donderen --- dist/changes-5.0.0 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 03dc414e7f..70e526cc28 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -335,6 +335,16 @@ QtGui information like capability flags, point-specific flags, velocity, and raw positions. +* A new set of enabler classes have been added, most importantly QWindow, QScreen, + QSurfaceFormat, and QOpenGLContext. + +* Most of the useful QtOpenGL classes have been polished and moved into + QtGui. See QOpenGLFramebufferObject, QOpenGLShaderProgram, + QOpenGLFunctions, etc. + +* QOpenGLPaintDevice has been added to be able to use QPainter to render into + the currently bound context. + QtWidgets --------- * QInputContext removed as well as related getters and setters on QWidget and QApplication. @@ -383,6 +393,11 @@ QtNetwork QtOpenGL -------- +* Most of the classes in this module (with the notable exception of QGLWidget) + now have equivalents in QtGui, along with the naming change QGL -> QOpenGL. + The classes in QtOpenGL that have equivalents in QtGui can now be considered + deprecated. + QtScript -------- -- cgit v1.2.3 From c227546d2e4077ff85ea3a830f9109ada28f12b9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 16 Mar 2012 09:50:39 +0100 Subject: qdoc: Structure the DITA map with a root node. Use the title from the index.html page for the navtitle, if there is a title on the index.html page. Otherwise use the project as the navtitle. Task-number: Mzilla bug - 7229 Change-Id: I25fc1f09b0bdff58c6340cec7d9d8a43d95845a2 Reviewed-by: Casper van Donderen --- src/tools/qdoc/ditaxmlgenerator.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 6b0c2dce88..f19f902c6b 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -5900,9 +5900,15 @@ void DitaXmlGenerator::writeDitaMap(const Tree *tree) writeEndTag(); // writeStartTag(DT_topicref); - xmlWriter().writeAttribute("navtitle",project); - if (rootPageNode) + if (rootPageNode) { + if (!rootPageNode->title().isEmpty()) + xmlWriter().writeAttribute("navtitle",rootPageNode->title()); + else + xmlWriter().writeAttribute("navtitle",project); xmlWriter().writeAttribute("href",fileName(rootPageNode)); + } + else + xmlWriter().writeAttribute("navtitle",project); writeTopicrefs(pageTypeMaps[Node::OverviewPage], "overviews"); writeTopicrefs(pageTypeMaps[Node::HowToPage], "howtos"); -- cgit v1.2.3 From 437da962c2b486b1a1722aac003bfa00b93ac204 Mon Sep 17 00:00:00 2001 From: Arnt Witteveen Date: Wed, 14 Mar 2012 14:53:32 +0100 Subject: Fix bug showing folder icons for files Fix an issue where the cache was updated with the folder icon, even though this is never used from the cache. This caused files to sometimes be shown with a folder icon: If a folder has an extension (e.g. a folder named 'folder.ext'), this means the folder icon will be written to the cache for the 'ext' extension, and from that point on all .ext files will be shown with the folder icon. The fix is to not save an icon in the cache for those cases where it will not be used from the cache anyway, by using the same condition for updating the cache as for reading it (which is in line 8 of the same function). Change-Id: I9ce8fca0718b2b62b9390fa64989acd54952a88e Reviewed-by: Girish Ramakrishnan Reviewed-by: Robin Burchell Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qfileiconprovider.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/widgets/itemviews/qfileiconprovider.cpp b/src/widgets/itemviews/qfileiconprovider.cpp index b6669c0784..5356b67f99 100644 --- a/src/widgets/itemviews/qfileiconprovider.cpp +++ b/src/widgets/itemviews/qfileiconprovider.cpp @@ -376,15 +376,16 @@ QIcon QFileIconProviderPrivate::getMacIcon(const QFileInfo &fi) const qt_mac_constructQIconFromIconRef(iconRef, 0, &retIcon); ReleaseIconRef(iconRef); - pixmap = retIcon.pixmap(16); - QPixmapCache::insert(keyBase + QLatin1String("16"), pixmap); - pixmap = retIcon.pixmap(32); - QPixmapCache::insert(keyBase + QLatin1String("32"), pixmap); - pixmap = retIcon.pixmap(64); - QPixmapCache::insert(keyBase + QLatin1String("64"), pixmap); - pixmap = retIcon.pixmap(128); - QPixmapCache::insert(keyBase + QLatin1String("128"), pixmap); - + if (fi.isFile() && !fi.isExecutable() && !fi.isSymLink()) { + pixmap = retIcon.pixmap(16); + QPixmapCache::insert(keyBase + QLatin1String("16"), pixmap); + pixmap = retIcon.pixmap(32); + QPixmapCache::insert(keyBase + QLatin1String("32"), pixmap); + pixmap = retIcon.pixmap(64); + QPixmapCache::insert(keyBase + QLatin1String("64"), pixmap); + pixmap = retIcon.pixmap(128); + QPixmapCache::insert(keyBase + QLatin1String("128"), pixmap); + } return retIcon; } #endif -- cgit v1.2.3 From b6bce2dd7565329b2ca2a95c316f81293a6a5fe7 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Fri, 16 Mar 2012 13:05:37 +0100 Subject: QCocoaClipboard: Make QClipboard::clear() clear. Change-Id: Ifb235d015f7831b335a9c3db92515a8d1cd49311 Reviewed-by: Bradley T. Hughes --- src/plugins/platforms/cocoa/qcocoaclipboard.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoaclipboard.mm b/src/plugins/platforms/cocoa/qcocoaclipboard.mm index 799fb85183..87c085457f 100644 --- a/src/plugins/platforms/cocoa/qcocoaclipboard.mm +++ b/src/plugins/platforms/cocoa/qcocoaclipboard.mm @@ -64,6 +64,10 @@ QMimeData *QCocoaClipboard::mimeData(QClipboard::Mode mode) void QCocoaClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) { if (QMacPasteboard *pasteBoard = pasteboardForMode(mode)) { + if (data == 0) { + pasteBoard->clear(); + } + pasteBoard->sync(); pasteBoard->setMimeData(data); emitChanged(mode); -- cgit v1.2.3 From 7c7e47493edec987569a60e12456de5a2c62a230 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 14 Mar 2012 14:55:08 +0100 Subject: Replace Q_WS_MAC with Q_OS_MAC in qshortcut.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This re-enables shortcut context matching for menubar actions. Change-Id: I0d9f2b3d4316a4611afe96eb1a2cf29cb9e91851 Reviewed-by: Morten Johan Sørvig --- src/widgets/kernel/qshortcut.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index 07c7a02d4d..92f6fbafba 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -114,7 +115,7 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context) static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window) { bool visible = w->isVisible(); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast(w)) visible = true; #endif @@ -177,7 +178,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsWidget *w, QWidget *active_window) { bool visible = w->isVisible(); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast(w)) visible = true; #endif -- cgit v1.2.3 From d823646db3e9f72569717dc656e5b2e4d3ce7709 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 29 Aug 2011 17:49:48 +0200 Subject: containers: add C++11-style c{begin,end}() as alias for const{Begin,End}() C++11 adds cbegin()/cend() functions for the same reason Qt has constBegin()/constEnd(). This patch adds these functions to the Qt containers with the same implementation as constBegin()/constEnd(). It also fixes the return types in the documentation of existing constFind() functions (documentation only). C++11 only adds cbegin()/cend() (and crbegin()/crend(), which Qt doesn't have). In particular, it doesn't add cfind(), so I didn't supply these, even though Qt comes with constFind(). This is a forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1365. Change-Id: Ida086b64246b24e25254eafbcb06c8e33388502b Reviewed-by: Olivier Goffart --- src/corelib/tools/qbytearray.cpp | 12 ++++++++++++ src/corelib/tools/qbytearray.h | 6 ++++++ src/corelib/tools/qhash.cpp | 20 +++++++++++++++++++- src/corelib/tools/qhash.h | 2 ++ src/corelib/tools/qlinkedlist.cpp | 18 ++++++++++++++++++ src/corelib/tools/qlinkedlist.h | 2 ++ src/corelib/tools/qlist.cpp | 18 ++++++++++++++++++ src/corelib/tools/qlist.h | 2 ++ src/corelib/tools/qmap.cpp | 20 +++++++++++++++++++- src/corelib/tools/qmap.h | 2 ++ src/corelib/tools/qset.h | 2 ++ src/corelib/tools/qset.qdoc | 18 ++++++++++++++++++ src/corelib/tools/qstring.cpp | 18 ++++++++++++++++++ src/corelib/tools/qstring.h | 6 ++++++ src/corelib/tools/qvarlengtharray.h | 2 ++ src/corelib/tools/qvarlengtharray.qdoc | 18 ++++++++++++++++++ src/corelib/tools/qvector.cpp | 18 ++++++++++++++++++ src/corelib/tools/qvector.h | 2 ++ tests/auto/corelib/tools/qmap/tst_qmap.cpp | 2 ++ tests/auto/corelib/tools/qset/tst_qset.cpp | 24 ++++++++++++------------ tests/auto/other/collections/tst_collections.cpp | 20 +++++++++++++++++++- 21 files changed, 217 insertions(+), 15 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index b6719c9536..db22a774f4 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -799,6 +799,12 @@ const QConstByteArrayData<1> QByteArray::shared_empty = { { Q_REFCOUNT_INITIALIZ \internal */ +/*! \fn QByteArray::const_iterator QByteArray::cbegin() const + \since 5.0 + + \internal +*/ + /*! \fn QByteArray::const_iterator QByteArray::constBegin() const \internal @@ -814,6 +820,12 @@ const QConstByteArrayData<1> QByteArray::shared_empty = { { Q_REFCOUNT_INITIALIZ \internal */ +/*! \fn QByteArray::const_iterator QByteArray::cend() const + \since 5.0 + + \internal +*/ + /*! \fn QByteArray::const_iterator QByteArray::constEnd() const \internal diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 09c43988fd..7711d7349e 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -358,9 +358,11 @@ public: typedef const_iterator ConstIterator; iterator begin(); const_iterator begin() const; + const_iterator cbegin() const; const_iterator constBegin() const; iterator end(); const_iterator end() const; + const_iterator cend() const; const_iterator constEnd() const; // stl compatibility @@ -492,12 +494,16 @@ inline QByteArray::iterator QByteArray::begin() { detach(); return d->data(); } inline QByteArray::const_iterator QByteArray::begin() const { return d->data(); } +inline QByteArray::const_iterator QByteArray::cbegin() const +{ return d->data(); } inline QByteArray::const_iterator QByteArray::constBegin() const { return d->data(); } inline QByteArray::iterator QByteArray::end() { detach(); return d->data() + d->size; } inline QByteArray::const_iterator QByteArray::end() const { return d->data() + d->size; } +inline QByteArray::const_iterator QByteArray::cend() const +{ return d->data() + d->size; } inline QByteArray::const_iterator QByteArray::constEnd() const { return d->data() + d->size; } inline QByteArray &QByteArray::operator+=(char c) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index d5703e8b2a..62fc6c5d86 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1045,6 +1045,15 @@ void QHashData::checkSanity() \overload */ +/*! \fn QHash::const_iterator QHash::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first item + in the hash. + + \sa begin(), cend() +*/ + /*! \fn QHash::const_iterator QHash::constBegin() const Returns a const \l{STL-style iterator} pointing to the first item @@ -1074,6 +1083,15 @@ void QHashData::checkSanity() \sa constBegin(), end() */ +/*! \fn QHash::const_iterator QHash::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the hash. + + \sa cbegin(), end() +*/ + /*! \fn QHash::iterator QHash::erase(iterator pos) Removes the (key, value) pair associated with the iterator \a pos @@ -1114,7 +1132,7 @@ void QHashData::checkSanity() \overload */ -/*! \fn QHash::iterator QHash::constFind(const Key &key) const +/*! \fn QHash::const_iterator QHash::constFind(const Key &key) const \since 4.1 Returns an iterator pointing to the item with the \a key in the diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 9e4007c26e..55fa788543 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -440,9 +440,11 @@ public: // STL style inline iterator begin() { detach(); return iterator(d->firstNode()); } inline const_iterator begin() const { return const_iterator(d->firstNode()); } + inline const_iterator cbegin() const { return const_iterator(d->firstNode()); } inline const_iterator constBegin() const { return const_iterator(d->firstNode()); } inline iterator end() { detach(); return iterator(e); } inline const_iterator end() const { return const_iterator(e); } + inline const_iterator cend() const { return const_iterator(e); } inline const_iterator constEnd() const { return const_iterator(e); } iterator erase(iterator it); diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp index b31ef3e5e9..50f6f447b2 100644 --- a/src/corelib/tools/qlinkedlist.cpp +++ b/src/corelib/tools/qlinkedlist.cpp @@ -330,6 +330,15 @@ const QLinkedListData QLinkedListData::shared_null = { \overload */ +/*! \fn QLinkedList::const_iterator QLinkedList::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first item + in the list. + + \sa begin(), cend() +*/ + /*! \fn QLinkedList::const_iterator QLinkedList::constBegin() const Returns a const \l{STL-style iterator} pointing to the first item @@ -351,6 +360,15 @@ const QLinkedListData QLinkedListData::shared_null = { \overload */ +/*! \fn QLinkedList::const_iterator QLinkedList::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the list. + + \sa cbegin(), end() +*/ + /*! \fn QLinkedList::const_iterator QLinkedList::constEnd() const Returns a const \l{STL-style iterator} pointing to the imaginary diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index 2e6d05ac35..2b23fc230c 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -180,9 +180,11 @@ public: // stl style inline iterator begin() { detach(); return e->n; } inline const_iterator begin() const { return e->n; } + inline const_iterator cbegin() const { return e->n; } inline const_iterator constBegin() const { return e->n; } inline iterator end() { detach(); return e; } inline const_iterator end() const { return e; } + inline const_iterator cend() const { return e; } inline const_iterator constEnd() const { return e; } iterator insert(iterator before, const T &t); iterator erase(iterator pos); diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 263045a25d..9b40e2d37a 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -921,6 +921,15 @@ void **QListData::erase(void **xi) \overload */ +/*! \fn QList::const_iterator QList::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first item + in the list. + + \sa begin(), cend() +*/ + /*! \fn QList::const_iterator QList::constBegin() const Returns a const \l{STL-style iterator} pointing to the first item @@ -942,6 +951,15 @@ void **QListData::erase(void **xi) \overload */ +/*! \fn QList::const_iterator QList::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the list. + + \sa cbegin(), end() +*/ + /*! \fn QList::const_iterator QList::constEnd() const Returns a const \l{STL-style iterator} pointing to the imaginary diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index bf6933732c..3d55b3002d 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -262,9 +262,11 @@ public: // stl style inline iterator begin() { detach(); return reinterpret_cast(p.begin()); } inline const_iterator begin() const { return reinterpret_cast(p.begin()); } + inline const_iterator cbegin() const { return reinterpret_cast(p.begin()); } inline const_iterator constBegin() const { return reinterpret_cast(p.begin()); } inline iterator end() { detach(); return reinterpret_cast(p.end()); } inline const_iterator end() const { return reinterpret_cast(p.end()); } + inline const_iterator cend() const { return reinterpret_cast(p.end()); } inline const_iterator constEnd() const { return reinterpret_cast(p.end()); } iterator insert(iterator before, const T &t); iterator erase(iterator pos); diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 103d074941..e0b53fc64e 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -682,6 +682,15 @@ void QMapData::dump() \overload */ +/*! \fn QMap::const_iterator QMap::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first item + in the map. + + \sa begin(), cend() +*/ + /*! \fn QMap::const_iterator QMap::constBegin() const Returns a const \l{STL-style iterator} pointing to the first item @@ -703,6 +712,15 @@ void QMapData::dump() \overload */ +/*! \fn QMap::const_iterator QMap::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the map. + + \sa cbegin(), end() +*/ + /*! \fn QMap::const_iterator QMap::constEnd() const Returns a const \l{STL-style iterator} pointing to the imaginary @@ -744,7 +762,7 @@ void QMapData::dump() \overload */ -/*! \fn QMap::iterator QMap::constFind(const Key &key) const +/*! \fn QMap::const_iterator QMap::constFind(const Key &key) const \since 4.1 Returns an const iterator pointing to the item with key \a key in the diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 515b60bea6..a00f9477f6 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -362,12 +362,14 @@ public: // STL style inline iterator begin() { detach(); return iterator(e->forward[0]); } inline const_iterator begin() const { return const_iterator(e->forward[0]); } + inline const_iterator cbegin() const { return const_iterator(e->forward[0]); } inline const_iterator constBegin() const { return const_iterator(e->forward[0]); } inline iterator end() { detach(); return iterator(e); } inline const_iterator end() const { return const_iterator(e); } + inline const_iterator cend() const { return const_iterator(e); } inline const_iterator constEnd() const { return const_iterator(e); } iterator erase(iterator it); diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 7750cd1147..e85c770d42 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -164,9 +164,11 @@ public: // STL style inline iterator begin() { return q_hash.begin(); } inline const_iterator begin() const { return q_hash.begin(); } + inline const_iterator cbegin() const { return q_hash.begin(); } inline const_iterator constBegin() const { return q_hash.constBegin(); } inline iterator end() { return q_hash.end(); } inline const_iterator end() const { return q_hash.end(); } + inline const_iterator cend() const { return q_hash.end(); } inline const_iterator constEnd() const { return q_hash.constEnd(); } iterator erase(iterator i) { return q_hash.erase(reinterpret_cast(i)); } diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index b33064e1b8..139b017966 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -343,6 +343,15 @@ item in the set. */ +/*! \fn QSet::const_iterator QSet::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} positioned at the first + item in the set. + + \sa begin(), cend() +*/ + /*! \fn QSet::const_iterator QSet::constBegin() const Returns a const \l{STL-style iterator} positioned at the first @@ -367,6 +376,15 @@ imaginary item after the last item in the set. */ +/*! \fn QSet::const_iterator QSet::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the set. + + \sa cbegin(), end() +*/ + /*! \fn QSet::const_iterator QSet::constEnd() const Returns a const \l{STL-style iterator} pointing to the imaginary diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 083abcbaad..57990c57ac 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -859,6 +859,15 @@ int QString::grow(int size) \overload begin() */ +/*! \fn QString::const_iterator QString::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first character + in the string. + + \sa begin(), cend() +*/ + /*! \fn QString::const_iterator QString::constBegin() const Returns a const \l{STL-style iterator} pointing to the first character @@ -880,6 +889,15 @@ int QString::grow(int size) \overload end() */ +/*! \fn QString::const_iterator QString::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the list. + + \sa cbegin(), end() +*/ + /*! \fn QString::const_iterator QString::constEnd() const Returns a const \l{STL-style iterator} pointing to the imaginary diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 4d02fbe66d..437e98b662 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -558,9 +558,11 @@ public: typedef const_iterator ConstIterator; iterator begin(); const_iterator begin() const; + const_iterator cbegin() const; const_iterator constBegin() const; iterator end(); const_iterator end() const; + const_iterator cend() const; const_iterator constEnd() const; // STL compatibility @@ -904,12 +906,16 @@ inline QString::iterator QString::begin() { detach(); return reinterpret_cast(d->data()); } inline QString::const_iterator QString::begin() const { return reinterpret_cast(d->data()); } +inline QString::const_iterator QString::cbegin() const +{ return reinterpret_cast(d->data()); } inline QString::const_iterator QString::constBegin() const { return reinterpret_cast(d->data()); } inline QString::iterator QString::end() { detach(); return reinterpret_cast(d->data() + d->size); } inline QString::const_iterator QString::end() const { return reinterpret_cast(d->data() + d->size); } +inline QString::const_iterator QString::cend() const +{ return reinterpret_cast(d->data() + d->size); } inline QString::const_iterator QString::constEnd() const { return reinterpret_cast(d->data() + d->size); } inline bool QString::contains(const QString &s, Qt::CaseSensitivity cs) const diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index a6613a3774..4e042f765e 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -160,9 +160,11 @@ public: inline iterator begin() { return ptr; } inline const_iterator begin() const { return ptr; } + inline const_iterator cbegin() const { return ptr; } inline const_iterator constBegin() const { return ptr; } inline iterator end() { return ptr + s; } inline const_iterator end() const { return ptr + s; } + inline const_iterator cend() const { return ptr + s; } inline const_iterator constEnd() const { return ptr + s; } iterator insert(iterator before, int n, const T &x); inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); } diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc index e1dc2bee9a..e92f91aa47 100644 --- a/src/corelib/tools/qvarlengtharray.qdoc +++ b/src/corelib/tools/qvarlengtharray.qdoc @@ -451,6 +451,15 @@ \overload */ +/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first item + in the array. + + \sa begin(), cend() +*/ + /*! \fn QVarLengthArray::const_iterator QVarLengthArray::constBegin() const \since 4.8 @@ -475,6 +484,15 @@ \overload */ +/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the array. + + \sa cbegin(), end() +*/ + /*! \fn QVarLengthArray::const_iterator QVarLengthArray::constEnd() const \since 4.8 diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 75c219bbc9..0f5c2d3cd9 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -698,6 +698,15 @@ int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive \overload */ +/*! \fn QVector::const_iterator QVector::cbegin() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the first item + in the vector. + + \sa begin(), cend() +*/ + /*! \fn QVector::const_iterator QVector::constBegin() const Returns a const \l{STL-style iterator} pointing to the first item @@ -719,6 +728,15 @@ int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive \overload */ +/*! \fn QVector::const_iterator QVector::cend() const + \since 5.0 + + Returns a const \l{STL-style iterator} pointing to the imaginary + item after the last item in the vector. + + \sa cbegin(), end() +*/ + /*! \fn QVector::const_iterator QVector::constEnd() const Returns a const \l{STL-style iterator} pointing to the imaginary diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 4230e55ff5..09aabe5d73 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -245,9 +245,11 @@ public: #endif inline iterator begin() { detach(); return p->array; } inline const_iterator begin() const { return p->array; } + inline const_iterator cbegin() const { return p->array; } inline const_iterator constBegin() const { return p->array; } inline iterator end() { detach(); return p->array + d->size; } inline const_iterator end() const { return p->array + d->size; } + inline const_iterator cend() const { return p->array + d->size; } inline const_iterator constEnd() const { return p->array + d->size; } iterator insert(iterator before, int n, const T &x); inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); } diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp index 79b0a931cb..7d0ef7d7e4 100644 --- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp +++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp @@ -285,6 +285,8 @@ void tst_QMap::beginEnd() QVERIFY( map.constBegin() == map.constEnd() ); map.insert( "0", "a" ); map.insert( "1", "b" ); + QVERIFY( map.constBegin() == map.cbegin() ); + QVERIFY( map.constEnd() == map.cend() ); // make a copy. const function shouldn't detach StringMap map2 = map; diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp index d7d8c99071..ee83339d50 100644 --- a/tests/auto/corelib/tools/qset/tst_qset.cpp +++ b/tests/auto/corelib/tools/qset/tst_qset.cpp @@ -393,9 +393,9 @@ void tst_QSet::begin() { QSet::const_iterator i = set1.constBegin(); - QSet::const_iterator j = set1.constBegin(); + QSet::const_iterator j = set1.cbegin(); QSet::const_iterator k = set2.constBegin(); - QSet::const_iterator ell = set2.constBegin(); + QSet::const_iterator ell = set2.cbegin(); QVERIFY(i == j); QVERIFY(k == ell); @@ -407,9 +407,9 @@ void tst_QSet::begin() { QSet::const_iterator i = set1.constBegin(); - QSet::const_iterator j = set1.constBegin(); + QSet::const_iterator j = set1.cbegin(); QSet::const_iterator k = set2.constBegin(); - QSet::const_iterator ell = set2.constBegin(); + QSet::const_iterator ell = set2.cbegin(); QVERIFY(i == j); QVERIFY(k == ell); @@ -421,9 +421,9 @@ void tst_QSet::begin() { QSet::const_iterator i = set1.constBegin(); - QSet::const_iterator j = set1.constBegin(); + QSet::const_iterator j = set1.cbegin(); QSet::const_iterator k = set2.constBegin(); - QSet::const_iterator ell = set2.constBegin(); + QSet::const_iterator ell = set2.cbegin(); QVERIFY(i == j); QVERIFY(k == ell); @@ -439,9 +439,9 @@ void tst_QSet::end() { QSet::const_iterator i = set1.constEnd(); - QSet::const_iterator j = set1.constEnd(); + QSet::const_iterator j = set1.cend(); QSet::const_iterator k = set2.constEnd(); - QSet::const_iterator ell = set2.constEnd(); + QSet::const_iterator ell = set2.cend(); QVERIFY(i == j); QVERIFY(k == ell); @@ -456,9 +456,9 @@ void tst_QSet::end() { QSet::const_iterator i = set1.constEnd(); - QSet::const_iterator j = set1.constEnd(); + QSet::const_iterator j = set1.cend(); QSet::const_iterator k = set2.constEnd(); - QSet::const_iterator ell = set2.constEnd(); + QSet::const_iterator ell = set2.cend(); QVERIFY(i == j); QVERIFY(k == ell); @@ -473,9 +473,9 @@ void tst_QSet::end() { QSet::const_iterator i = set1.constEnd(); - QSet::const_iterator j = set1.constEnd(); + QSet::const_iterator j = set1.cend(); QSet::const_iterator k = set2.constEnd(); - QSet::const_iterator ell = set2.constEnd(); + QSet::const_iterator ell = set2.cend(); QVERIFY(i == j); QVERIFY(k == ell); diff --git a/tests/auto/other/collections/tst_collections.cpp b/tests/auto/other/collections/tst_collections.cpp index dc6d7f4b55..973938594f 100644 --- a/tests/auto/other/collections/tst_collections.cpp +++ b/tests/auto/other/collections/tst_collections.cpp @@ -550,6 +550,10 @@ void tst_Collections::list() QList::const_iterator cit = list.constBegin(); QVERIFY((*cit).toLower() == "xello"); QVERIFY(cit->toUpper() == "XELLO"); + + cit = list.cbegin(); + QVERIFY((*cit).toLower() == "xello"); + QVERIFY(cit->toUpper() == "XELLO"); } { @@ -967,6 +971,10 @@ void tst_Collections::linkedList() QLinkedList::const_iterator cit = list.constBegin(); QVERIFY((*cit).toLower() == "xello"); QVERIFY(cit->toUpper() == "XELLO"); + + cit = list.cbegin(); + QVERIFY((*cit).toLower() == "xello"); + QVERIFY(cit->toUpper() == "XELLO"); } { @@ -1607,6 +1615,10 @@ void tst_Collections::hash() QHash::const_iterator cit = hash.constBegin(); QVERIFY((*cit).toLower() == "xello"); QVERIFY(cit->toUpper() == "XELLO"); + + cit = hash.cbegin(); + QVERIFY((*cit).toLower() == "xello"); + QVERIFY(cit->toUpper() == "XELLO"); } { @@ -1924,6 +1936,10 @@ void tst_Collections::map() QMap::const_iterator cit = map.constBegin(); QVERIFY((*cit).toLower() == "xello"); QVERIFY(cit->toUpper() == "XELLO"); + + cit = map.cbegin(); + QVERIFY((*cit).toLower() == "xello"); + QVERIFY(cit->toUpper() == "XELLO"); } { @@ -2902,7 +2918,7 @@ void tst_Collections::linkedlist_stl() QCOMPARE(int(stdList.size()), elements.size()); std::list::const_iterator it = stdList.begin(); - QLinkedList::const_iterator it2 = list.constBegin(); + QLinkedList::const_iterator it2 = list.cbegin(); for (uint j = 0; j < stdList.size(); ++j, ++it, ++it2) QCOMPARE(*it, *it2); @@ -3001,9 +3017,11 @@ void instantiateContainer() #ifndef QT_NO_STL typename ContainerType::const_iterator constIt; constIt = constContainer.begin(); + constIt = container.cbegin(); container.constBegin(); constIt = constContainer.end(); + constIt = constContainer.cend(); container.constEnd(); Q_UNUSED(constIt) #endif -- cgit v1.2.3 From 7f67d0810e6899290b50120ee7a22d0a8a8300ec Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Fri, 16 Mar 2012 12:08:51 +1000 Subject: Don't reject plugins that have empty meta-data Having an empty Json object ({}) should be valid meta-data but this check means that there needs to be at least one key-value pair or the plugin will be rejected. Change-Id: I578ccc35016af16fd30b3807e796fa63c0282f30 Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index cdc72cf35d..480bc0da74 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -175,8 +175,7 @@ void QFactoryLoader::update() QString iid = library->metaData.value(QLatin1String("IID")).toString(); if (iid == QLatin1String(d->iid.constData(), d->iid.size())) { QJsonObject object = library->metaData.value(QLatin1String("MetaData")).toObject(); - if (!object.isEmpty()) - metaDataOk = true; + metaDataOk = true; QJsonArray k = object.value(QLatin1String("Keys")).toArray(); for (int i = 0; i < k.size(); ++i) { -- cgit v1.2.3 From 1711bab7197eb0176e0c56fe3b8a50b6878ee1a3 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 7 Mar 2012 20:51:27 -0600 Subject: Add support for ICU on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needed by QtWebKit now. Change-Id: I177d8dcf6063a14501f7ba3081b43a29a48661c7 Reviewed-by: Tor Arne Vestbø Reviewed-by: Oswald Buddenhagen Reviewed-by: Simon Hausmann Reviewed-by: Lars Knoll --- tools/configure/configureapp.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 92fdd35f3c..5a6a04aee0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -264,6 +264,8 @@ Configure::Configure(int& argc, char** argv) dictionary[ "PCRE" ] = "auto"; + dictionary[ "ICU" ] = "auto"; + dictionary[ "GIF" ] = "auto"; dictionary[ "JPEG" ] = "auto"; dictionary[ "PNG" ] = "auto"; @@ -504,6 +506,12 @@ void Configure::parseCmdLine() dictionary[ "PCRE" ] = "system"; } + else if (configCmdLine.at(i) == "-icu") { + dictionary[ "ICU" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-icu") { + dictionary[ "ICU" ] = "no"; + } + // Image formats -------------------------------------------- else if (configCmdLine.at(i) == "-no-gif") dictionary[ "GIF" ] = "no"; @@ -1468,7 +1476,7 @@ bool Configure::displayHelp() "[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n" "[-no-script] [-script] [-no-scripttools] [-scripttools]\n" "[-no-webkit] [-webkit] [-webkit-debug]\n" - "[-no-directwrite] [-directwrite] [-qpa] [-no-widgets] \n\n", 0, 7); + "[-no-directwrite] [-directwrite] [-qpa] [-no-widgets] [-icu]\n\n", 0, 7); desc("Installation options:\n\n"); @@ -1565,6 +1573,9 @@ bool Configure::displayHelp() desc("PCRE", "qt", "-qt-pcre", "Use the PCRE library bundled with Qt."); desc("PCRE", "qt", "-system-pcre", "Use the PCRE library from the operating system.\nSee http://pcre.org/\n"); + desc("ICU", "yes", "-icu", "Use the ICU library."); + desc("ICU", "no", "-no-icu", "Do not use the ICU library.\nSee http://site.icu-project.org/\n"); + desc("GIF", "no", "-no-gif", "Do not compile GIF reading support."); desc("LIBPNG", "no", "-no-libpng", "Do not compile PNG support."); @@ -1811,6 +1822,9 @@ bool Configure::checkAvailability(const QString &part) else if (part == "PCRE") available = findFile("pcre.h"); + else if (part == "ICU") + available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h") && findFile("icuin.lib"); + else if (part == "LIBJPEG") available = findFile("jpeglib.h"); else if (part == "LIBPNG") @@ -1924,6 +1938,10 @@ void Configure::autoDetection() if (dictionary["PCRE"] == "auto") dictionary["PCRE"] = checkAvailability("PCRE") ? defaultTo("PCRE") : "qt"; + // ICU detection + if (dictionary["ICU"] == "auto") + dictionary["ICU"] = checkAvailability("ICU") ? "yes" : "no"; + // Image format detection if (dictionary["GIF"] == "auto") dictionary["GIF"] = defaultTo("GIF"); @@ -2118,6 +2136,10 @@ void Configure::generateOutputVars() if (dictionary[ "PCRE" ] == "qt") qmakeConfig += "pcre"; + // ICU --------------------------------------------------------- + if (dictionary[ "ICU" ] == "yes") + qtConfig += "icu"; + // Image formates ----------------------------------------------- if (dictionary[ "GIF" ] == "no") qtConfig += "no-gif"; @@ -3060,6 +3082,8 @@ void Configure::displayConfig() cout << " JPEG support............" << dictionary[ "JPEG" ] << endl; cout << " PNG support............." << dictionary[ "PNG" ] << endl; cout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl << endl; + cout << " PCRE support............" << dictionary[ "PCRE" ] << endl; + cout << " ICU support............." << dictionary[ "ICU" ] << endl; cout << "Styles:" << endl; cout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl; -- cgit v1.2.3 From 7b26a2cf2e8cc0b52d5f68ddbf43d5166be5ce22 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 15 Mar 2012 12:01:07 +0100 Subject: Add QWindowSystemInterface::tryHandleSynchronousShortcutEvent() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function sends a shortcut override through the shortcut system and returns the result of the event. This will be used in platform plugins (such as the Cocoa plugin) to make sure that shortcuts work when the user presses a dead-key combination that normally would go through an input method to produce text. An extended overload taking native scan code, virtual key, and modifiers has also been added. Change-Id: Ia3836229ab0c66d2fb6f310e72b6f4d6dfa9ead9 Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qwindowsysteminterface_qpa.cpp | 34 +++++++++++++++++++++++++++ src/gui/kernel/qwindowsysteminterface_qpa.h | 12 ++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index be9ac8e545..9ab91d65d5 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -41,6 +41,7 @@ #include "qwindowsysteminterface_qpa.h" #include "qwindowsysteminterface_qpa_p.h" #include "private/qguiapplication_p.h" +#include "private/qevent_p.h" #include "private/qtouchdevice_p.h" #include #include @@ -147,6 +148,39 @@ void QWindowSystemInterface::handleMouseEvent(QWindow *tlw, ulong timestamp, con QWindowSystemInterfacePrivate::queueWindowSystemEvent(e); } +bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods, + const QString & text, bool autorep, ushort count) +{ + unsigned long timestamp = QWindowSystemInterfacePrivate::eventTime.elapsed(); + return tryHandleSynchronousShortcutEvent(w, timestamp, k, mods, text, autorep, count); +} + +bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, + const QString & text, bool autorep, ushort count) +{ + QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count); + qevent.setTimestamp(timestamp); + return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent); +} + +bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods, + quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, + const QString &text, bool autorep, ushort count) +{ + unsigned long timestamp = QWindowSystemInterfacePrivate::eventTime.elapsed(); + return tryHandleSynchronousExtendedShortcutEvent(w, timestamp, k, mods, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count); +} + +bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, + quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, + const QString &text, bool autorep, ushort count) +{ + QKeyEventEx qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count, nativeScanCode, nativeVirtualKey, nativeModifiers); + qevent.setTimestamp(timestamp); + return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent); +} + + void QWindowSystemInterface::handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) { unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed(); handleKeyEvent(w, time, t, k, mods, text, autorep, count); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h index 6dae11ea81..4cdd33b49f 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa.h @@ -69,6 +69,18 @@ public: static void handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier); static void handleMouseEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier); + static bool tryHandleSynchronousShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods, + const QString & text = QString(), bool autorep = false, ushort count = 1); + static bool tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, + const QString & text = QString(), bool autorep = false, ushort count = 1); + + static bool tryHandleSynchronousExtendedShortcutEvent(QWindow *w, int k, Qt::KeyboardModifiers mods, + quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, + const QString & text = QString(), bool autorep = false, ushort count = 1); + static bool tryHandleSynchronousExtendedShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, + quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, + const QString & text = QString(), bool autorep = false, ushort count = 1); + static void handleKeyEvent(QWindow *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1); static void handleKeyEvent(QWindow *w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1); -- cgit v1.2.3 From 78e0ab3342c9b877c55cb74d19fd87c8c9a5385a Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Fri, 16 Mar 2012 16:05:09 -0700 Subject: QPointer: update its document and changes-5.0.0 QPointer has been un-deprecated and one behavior which slightly different from Qt4 has been fixed. see SHA: b8773165d76e0d5d46287d92f9d6bdbbd2110180 and SHA: 497622cafe235eadb5dd5056b196d8451ee89071 Change-Id: I4bae2cce3ebfebd8f59b18b5a6a7a7226b8353b9 Reviewed-by: Olivier Goffart Reviewed-by: Lars Knoll Reviewed-by: Casper van Donderen --- dist/changes-5.0.0 | 13 +++---------- src/corelib/kernel/qpointer.cpp | 8 +------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 70e526cc28..9852c24894 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -558,10 +558,9 @@ Qt for Windows CE - QPointer - * QPointer itself is now deprecated, and the implementation of QPointer - has been changed to use QWeakPointer. The old guard mechanism has been - removed. This causes two slight changes in behavior when using - QPointer: + * The implementation of QPointer has been changed to use QWeakPointer. The + old guard mechanism has been removed. This causes a slight change + in behavior when using QPointer: * When using QPointer on a QWidget (or a subclass of QWidget), previously the QPointer would be cleared by the QWidget destructor. Now, the QPointer @@ -569,12 +568,6 @@ Qt for Windows CE cleared). Any QPointers tracking a widget will NOT be cleared before the QWidget destructor destroys the children for the widget being tracked. - * When constructing a QSharedPointer to take ownership of an object after a - QPointer is already tracking the object. Previously, the shared pointer - construction would not be affected by the QPointer, but now that QPointer - is implemented using QWeakPoiner, constructing the QSharedPointer will - cause an abort(). - - QVariant diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp index f81451d906..e0e14e5b79 100644 --- a/src/corelib/kernel/qpointer.cpp +++ b/src/corelib/kernel/qpointer.cpp @@ -56,7 +56,7 @@ destroyed while you still hold a reference to it. You can safely test the pointer for validity. - Note that Qt 5 introduces two slight changes in behavior when using QPointer. + Note that Qt 5 introduces a slight change in behavior when using QPointer. \list @@ -66,12 +66,6 @@ cleared). Any QPointers tracking a widget will \b NOT be cleared before the QWidget destructor destroys the children for the widget being tracked. - \li When constructing a QSharedPointer to take ownership of an object after a - QPointer is already tracking the object. Previously, the shared pointer - construction would not be affected by the QPointer, but now that QPointer - is implemented using QWeakPoiner, constructing the QSharedPointer will - cause an \c abort(). - \endlist Qt also provides QSharedPointer, an implementation of a reference-counted -- cgit v1.2.3 From 5e497111dbd3e04380bee500364a5ee02065d193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 8 Mar 2012 15:49:55 +0100 Subject: Add new test cases to tst_QMetaType. Change-Id: I405ab5df9d9de3a0a0a71276b172a27ee01392e3 Reviewed-by: Stephen Kelly --- .../auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index a3959f6d33..d93e00eed8 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -629,18 +629,26 @@ FOR_EACH_CORE_METATYPE(RETURN_CREATE_COPY_FUNCTION) void tst_QMetaType::sizeOf_data() { QTest::addColumn("type"); - QTest::addColumn("size"); + QTest::addColumn("size"); #define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \ - QTest::newRow(#RealType) << QMetaType::MetaTypeName << int(QTypeInfo::sizeOf); + QTest::newRow(#RealType) << QMetaType::MetaTypeName << size_t(QTypeInfo::sizeOf); FOR_EACH_CORE_METATYPE(ADD_METATYPE_TEST_ROW) #undef ADD_METATYPE_TEST_ROW + + QTest::newRow("Whity") << static_cast(::qMetaTypeId >()) << sizeof(Whity); +QTest::newRow("Whity") << static_cast(::qMetaTypeId >()) << sizeof(Whity); + QTest::newRow("Testspace::Foo") << static_cast(::qMetaTypeId()) << sizeof(TestSpace::Foo); + + QTest::newRow("-1") << QMetaType::Type(-1) << size_t(0); + QTest::newRow("-124125534") << QMetaType::Type(-124125534) << size_t(0); + QTest::newRow("124125534") << QMetaType::Type(124125534) << size_t(0); } void tst_QMetaType::sizeOf() { QFETCH(QMetaType::Type, type); - QFETCH(int, size); - QCOMPARE(QMetaType::sizeOf(type), size); + QFETCH(size_t, size); + QCOMPARE(size_t(QMetaType::sizeOf(type)), size); } void tst_QMetaType::sizeOfStaticLess_data() @@ -651,8 +659,8 @@ void tst_QMetaType::sizeOfStaticLess_data() void tst_QMetaType::sizeOfStaticLess() { QFETCH(QMetaType::Type, type); - QFETCH(int, size); - QCOMPARE(QMetaType(type).sizeOf(), size); + QFETCH(size_t, size); + QCOMPARE(size_t(QMetaType(type).sizeOf()), size); } struct CustomMovable {}; -- cgit v1.2.3 From fbc251b364f9335be3c22df31ede449fb965d8d8 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 16 Mar 2012 12:59:09 -0500 Subject: Win32: Compile qmake when shadow-building Change-Id: I803c733f744372701c51e4d629ff797c6648f833 Reviewed-by: Oswald Buddenhagen --- qmake/Makefile.win32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 89444c9c3c..4e169f3270 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -159,7 +159,7 @@ $(OBJS): qmake_pch.obj $(QTOBJS): qmake_pch.obj qmake_pch.obj: - $(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP qmake_pch.h + $(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP $(QMKSRC)\qmake_pch.h {$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj:: $(CXX) $(CXXFLAGS) $< -- cgit v1.2.3 From 60c59b5cf57612216cb55fbfbe6e3ceebcda18e7 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 14 Mar 2012 15:06:39 +0100 Subject: Fix shortcut handling in the Cocoa plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit KeyPress events could be shortcuts or deadkeys, but we don't know which until we try. Shortcuts take precedence over deadkeys, so send them through QWindowSystemInterface::tryHandleSynchronousShortcutEvent() before passing it onto the input method. Change-Id: I479a3a7ff1c35e7c5692e8a17fb2173576dd0a29 Reviewed-by: Tasuku Suzuki Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qnsview.mm | 51 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index a28c5959ce..202ad6cc11 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -570,42 +570,43 @@ static QTouchDevice *touchDevice = 0; return qtMods; } -- (void)handleKeyEvent:(NSEvent *)theEvent eventType:(int)eventType +- (void)handleKeyEvent:(NSEvent *)nsevent eventType:(int)eventType { - NSTimeInterval timestamp = [theEvent timestamp]; + NSTimeInterval timestamp = [nsevent timestamp]; ulong qt_timestamp = timestamp * 1000; - QString characters = QString::fromUtf8([[theEvent characters] UTF8String]); - Qt::KeyboardModifiers modifiers = [self convertKeyModifiers : [theEvent modifierFlags]]; - QChar ch([[theEvent charactersIgnoringModifiers] characterAtIndex:0]); - int keyCode = [self convertKeyCode : ch]; + QString characters = QString::fromUtf8([[nsevent characters] UTF8String]); + Qt::KeyboardModifiers modifiers = [self convertKeyModifiers:[nsevent modifierFlags]]; + QChar ch([[nsevent charactersIgnoringModifiers] characterAtIndex:0]); + int keyCode = [self convertKeyCode:ch]; - QWindowSystemInterface::handleKeyEvent(m_window, qt_timestamp, QEvent::Type(eventType), keyCode, modifiers, characters); -} + if (eventType == QEvent::KeyPress) { + if (!m_keyEventsAccepted && m_composingText.isEmpty()) + m_keyEventsAccepted = QWindowSystemInterface::tryHandleSynchronousShortcutEvent(m_window, qt_timestamp, keyCode, modifiers, characters); -- (void)keyDown:(NSEvent *)theEvent -{ - QObject *fo = QGuiApplication::focusObject(); - m_keyEventsAccepted = false; - if (fo) { - QInputMethodQueryEvent queryEvent(Qt::ImHints); - if (QCoreApplication::sendEvent(fo, &queryEvent)) { - Qt::InputMethodHints hints = static_cast(queryEvent.value(Qt::ImHints).toUInt()); - if (!(hints & Qt::ImhDigitsOnly || hints & Qt::ImhFormattedNumbersOnly || hints & Qt::ImhHiddenText)) { - [self interpretKeyEvents:[NSArray arrayWithObject: theEvent]]; + QObject *fo = QGuiApplication::focusObject(); + if (!m_keyEventsAccepted && fo) { + QInputMethodQueryEvent queryEvent(Qt::ImHints); + if (QCoreApplication::sendEvent(fo, &queryEvent)) { + Qt::InputMethodHints hints = static_cast(queryEvent.value(Qt::ImHints).toUInt()); + if (!(hints & Qt::ImhDigitsOnly || hints & Qt::ImhFormattedNumbersOnly || hints & Qt::ImhHiddenText)) + [self interpretKeyEvents:[NSArray arrayWithObject:nsevent]]; } } } - if (!m_keyEventsAccepted && m_composingText.isEmpty()) { - [self handleKeyEvent : theEvent eventType :int(QEvent::KeyPress)]; - } + if (!m_keyEventsAccepted && m_composingText.isEmpty()) + QWindowSystemInterface::handleKeyEvent(m_window, qt_timestamp, QEvent::Type(eventType), keyCode, modifiers, characters); } -- (void)keyUp:(NSEvent *)theEvent +- (void)keyDown:(NSEvent *)nsevent { - if (!m_keyEventsAccepted && m_composingText.isEmpty()) { - [self handleKeyEvent : theEvent eventType :int(QEvent::KeyRelease)]; - } + m_keyEventsAccepted = false; + [self handleKeyEvent:nsevent eventType:int(QEvent::KeyPress)]; +} + +- (void)keyUp:(NSEvent *)nsevent +{ + [self handleKeyEvent:nsevent eventType:int(QEvent::KeyRelease)]; } - (void) doCommandBySelector:(SEL)aSelector -- cgit v1.2.3 From 4dbce2a469608194527188a136baa3e812caf361 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 16 Mar 2012 12:32:37 +0100 Subject: Cocoa: Fix function key handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cocoa sends function keys (e.g. arrow keys, backspace, F1-F35, etc.) as Unicode characters in the U+F700-U+F8FF range. Do not deliver text for events that contain a single control character (to match Qt 4 behavior). With this fix, keyboard navigation works again in Qt Creator when running against Qt 5. Change-Id: I5854bf713c2855dbc5ee491bace2f9dc1acd9426 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qnsview.mm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 202ad6cc11..3a697a3602 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -572,16 +572,21 @@ static QTouchDevice *touchDevice = 0; - (void)handleKeyEvent:(NSEvent *)nsevent eventType:(int)eventType { - NSTimeInterval timestamp = [nsevent timestamp]; - ulong qt_timestamp = timestamp * 1000; - QString characters = QString::fromUtf8([[nsevent characters] UTF8String]); + ulong timestamp = [nsevent timestamp] * 1000; Qt::KeyboardModifiers modifiers = [self convertKeyModifiers:[nsevent modifierFlags]]; - QChar ch([[nsevent charactersIgnoringModifiers] characterAtIndex:0]); + NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers]; + QChar ch([charactersIgnoringModifiers characterAtIndex:0]); int keyCode = [self convertKeyCode:ch]; + QString text; if (eventType == QEvent::KeyPress) { + // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when + // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) + if ([charactersIgnoringModifiers length] == 1 && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff)) + text = QString::fromUtf8([[nsevent characters] UTF8String]); + if (!m_keyEventsAccepted && m_composingText.isEmpty()) - m_keyEventsAccepted = QWindowSystemInterface::tryHandleSynchronousShortcutEvent(m_window, qt_timestamp, keyCode, modifiers, characters); + m_keyEventsAccepted = QWindowSystemInterface::tryHandleSynchronousShortcutEvent(m_window, timestamp, keyCode, modifiers, text); QObject *fo = QGuiApplication::focusObject(); if (!m_keyEventsAccepted && fo) { @@ -593,9 +598,8 @@ static QTouchDevice *touchDevice = 0; } } } - if (!m_keyEventsAccepted && m_composingText.isEmpty()) - QWindowSystemInterface::handleKeyEvent(m_window, qt_timestamp, QEvent::Type(eventType), keyCode, modifiers, characters); + QWindowSystemInterface::handleKeyEvent(m_window, timestamp, QEvent::Type(eventType), keyCode, modifiers, text); } - (void)keyDown:(NSEvent *)nsevent -- cgit v1.2.3 From 73b42378e7798046adbc2a508855b52462f406fe Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sat, 17 Mar 2012 10:49:36 -0700 Subject: configure: Fix iconv detection Makes no sense to disable iconv based on QPA. This change will make iconv as the "system" codec i.e the codec used for 8-bit locale dependent conversions. Change-Id: I4469e9c226b2411ac1338f61dabb84ec9c2ec603 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 4a53773544..a4d724efae 100755 --- a/configure +++ b/configure @@ -4389,7 +4389,7 @@ fi # auto-detect iconv(3) support if [ "$CFG_ICONV" != "no" ]; then - if [ "$XPLATFORM_MINGW" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then + if [ "$XPLATFORM_MINGW" = "yes" ]; then CFG_ICONV=no elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then CFG_ICONV=yes -- cgit v1.2.3 From 36513264daaa0748d32326421732b9e5f212c2b5 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 12 Mar 2012 15:36:31 +0100 Subject: Make copy and assign private for QAccessibleEvent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also make the handling of events in the test pointer based since mac-g++ doesn't seem to like const references the way they were before. Change-Id: I7fe39978d4729b8e586be30978b74aa51ca7cfe6 Reviewed-by: Jan-Arve Sæther --- src/gui/accessible/qaccessible.h | 6 ++- src/testlib/qtestaccessible.h | 8 +-- .../other/qaccessibility/tst_qaccessibility.cpp | 61 ++++++++++++++-------- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index ffdd3fe7ce..4d79fe78ee 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -430,6 +430,7 @@ private: class Q_GUI_EXPORT QAccessibleEvent { + Q_DISABLE_COPY(QAccessibleEvent) public: inline QAccessibleEvent(QAccessible::Event typ, QObject *obj, int chld = -1) : m_type(typ), m_object(obj), m_child(chld) @@ -446,7 +447,8 @@ public: QAccessibleInterface *accessibleInterface() const; -private: +protected: + QAccessible::Event m_type; QObject *m_object; int m_child; @@ -463,7 +465,7 @@ public: return m_changedStates; } -private: +protected: QAccessible::State m_changedStates; }; diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h index 807cc2f846..6d8d6125c1 100644 --- a/src/testlib/qtestaccessible.h +++ b/src/testlib/qtestaccessible.h @@ -98,18 +98,18 @@ public: } static void clearEvents() { eventList().clear(); } static EventList events() { return eventList(); } - static bool verifyEvent(const QAccessibleEvent& ev) + static bool verifyEvent(QAccessibleEvent *ev) { if (eventList().isEmpty()) return false; QAccessibleEvent *first = eventList().takeFirst(); - bool res = *first == ev; + bool res = *first == *ev; delete first; return res; } - static bool containsEvent(const QAccessibleEvent &event) { + static bool containsEvent(QAccessibleEvent *event) { Q_FOREACH (QAccessibleEvent *ev, eventList()) { - if (*ev == event) + if (*ev == *event) return true; } return false; diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index c984fedc86..a72dac1b81 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -369,18 +369,22 @@ void tst_QAccessibility::eventTest() button->setObjectName(QString("Olaf")); button->show(); - QVERIFY_EVENT(QAccessibleEvent(QAccessible::ObjectShow, button, -1)); + QAccessibleEvent showEvent(QAccessible::ObjectShow, button, -1); + QVERIFY_EVENT(&showEvent); button->setFocus(Qt::MouseFocusReason); QTestAccessibility::clearEvents(); QTest::mouseClick(button, Qt::LeftButton, 0); button->setAccessibleName("Olaf the second"); - QVERIFY_EVENT(QAccessibleEvent(QAccessible::NameChanged, button)); + QAccessibleEvent nameEvent(QAccessible::NameChanged, button); + QVERIFY_EVENT(&nameEvent); button->setAccessibleDescription("This is a button labeled Olaf"); - QVERIFY_EVENT(QAccessibleEvent(QAccessible::DescriptionChanged, button)); + QAccessibleEvent descEvent(QAccessible::DescriptionChanged, button); + QVERIFY_EVENT(&descEvent); button->hide(); - QVERIFY_EVENT(QAccessibleEvent(QAccessible::ObjectHide, button)); + QAccessibleEvent hideEvent(QAccessible::ObjectHide, button); + QVERIFY_EVENT(&hideEvent); delete button; } @@ -684,16 +688,20 @@ void tst_QAccessibility::hideShowTest() window->show(); QVERIFY(!state(window).invisible); QVERIFY(!state(child).invisible); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectShow, window))); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectShow, child))); + QAccessibleEvent show(QAccessible::ObjectShow, window); + QVERIFY(QTestAccessibility::containsEvent(&show)); + QAccessibleEvent showChild(QAccessible::ObjectShow, child); + QVERIFY(QTestAccessibility::containsEvent(&showChild)); QTestAccessibility::clearEvents(); // hide() and veryfy that both window and child are invisible and get ObjectHide events. window->hide(); QVERIFY(state(window).invisible); QVERIFY(state(child).invisible); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectHide, window))); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectHide, child))); + QAccessibleEvent hide(QAccessible::ObjectHide, window); + QVERIFY(QTestAccessibility::containsEvent(&hide)); + QAccessibleEvent hideChild(QAccessible::ObjectHide, child); + QVERIFY(QTestAccessibility::containsEvent(&hideChild)); QTestAccessibility::clearEvents(); delete window; @@ -774,7 +782,8 @@ void tst_QAccessibility::mainWindowTest() QLatin1String name = QLatin1String("I am the main window"); mw->setWindowTitle(name); QTest::qWaitForWindowShown(mw); - QVERIFY_EVENT(QAccessibleEvent(QAccessible::ObjectShow, mw)); + QAccessibleEvent show(QAccessible::ObjectShow, mw); + QVERIFY_EVENT(&show); QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(mw); QCOMPARE(interface->text(QAccessible::Name), name); @@ -934,9 +943,10 @@ void tst_QAccessibility::buttonTest() QVERIFY(checkBox.isChecked()); QAccessible::State st; st.checked = true; - QVERIFY_EVENT(QAccessibleStateChangeEvent(st, &checkBox)); + QAccessibleStateChangeEvent ev(st, &checkBox); + QVERIFY_EVENT(&ev); checkBox.setChecked(false); - QVERIFY_EVENT(QAccessibleStateChangeEvent(st, &checkBox)); + QVERIFY_EVENT(&ev); delete interface; } @@ -954,7 +964,8 @@ void tst_QAccessibility::buttonTest() QVERIFY(radio.isChecked()); QAccessible::State st; st.checked = true; - QVERIFY_EVENT(QAccessibleStateChangeEvent(st, &radio)); + QAccessibleStateChangeEvent ev(st, &radio); + QVERIFY_EVENT(&ev); delete interface; } @@ -1017,12 +1028,14 @@ void tst_QAccessibility::scrollBarTest() scrollBar->resize(200, 50); scrollBar->show(); QVERIFY(!scrollBarInterface->state().invisible); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectShow, scrollBar))); + QAccessibleEvent show(QAccessible::ObjectShow, scrollBar); + QVERIFY(QTestAccessibility::containsEvent(&show)); QTestAccessibility::clearEvents(); scrollBar->hide(); QVERIFY(scrollBarInterface->state().invisible); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::ObjectHide, scrollBar))); + QAccessibleEvent hide(QAccessible::ObjectHide, scrollBar); + QVERIFY(QTestAccessibility::containsEvent(&hide)); QTestAccessibility::clearEvents(); // Test that the left/right subcontrols are set to unavailable when the scrollBar is at the minimum/maximum. @@ -1463,7 +1476,7 @@ void tst_QAccessibility::spinBoxTest() QTest::keyPress(spinBox, Qt::Key_Up); QTest::qWait(200); QAccessibleEvent expectedEvent(QAccessible::ValueChanged, spinBox); - QVERIFY(QTestAccessibility::containsEvent(expectedEvent)); + QVERIFY(QTestAccessibility::containsEvent(&expectedEvent)); delete spinBox; QTestAccessibility::clearEvents(); } @@ -1733,7 +1746,8 @@ void tst_QAccessibility::lineEditTest() le->setFocus(Qt::TabFocusReason); QTestAccessibility::clearEvents(); le2->setFocus(Qt::TabFocusReason); - QTRY_VERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Focus, le2))); + QAccessibleEvent ev(QAccessible::Focus, le2); + QTRY_VERIFY(QTestAccessibility::containsEvent(&ev)); le->setText(QLatin1String("500")); le->setValidator(new QIntValidator()); @@ -1753,7 +1767,8 @@ void tst_QAccessibility::lineEditTest() le3->deselect(); le3->setCursorPosition(3); QCOMPARE(textIface->cursorPosition(), 3); - QTRY_VERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::TextCaretMoved, le3))); + QAccessibleEvent caretEvent(QAccessible::TextCaretMoved, le3); + QTRY_VERIFY(QTestAccessibility::containsEvent(&caretEvent)); QCOMPARE(textIface->selectionCount(), 0); QTestAccessibility::clearEvents(); @@ -2124,11 +2139,15 @@ void tst_QAccessibility::listTest() // Check for events QTest::mouseClick(listView->viewport(), Qt::LeftButton, 0, listView->visualItemRect(listView->item(1)).center()); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Selection, listView, 2))); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Focus, listView, 2))); + QAccessibleEvent selectList2(QAccessible::Selection, listView, 2); + QVERIFY(QTestAccessibility::containsEvent(&selectList2)); + QAccessibleEvent focusList2(QAccessible::Focus, listView, 2); + QVERIFY(QTestAccessibility::containsEvent(&focusList2)); QTest::mouseClick(listView->viewport(), Qt::LeftButton, 0, listView->visualItemRect(listView->item(2)).center()); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Selection, listView, 3))); - QVERIFY(QTestAccessibility::containsEvent(QAccessibleEvent(QAccessible::Focus, listView, 3))); + QAccessibleEvent selectList3(QAccessible::Selection, listView, 3); + QVERIFY(QTestAccessibility::containsEvent(&selectList3)); + QAccessibleEvent focusList3(QAccessible::Focus, listView, 3); + QVERIFY(QTestAccessibility::containsEvent(&focusList3)); listView->addItem("Munich"); QCOMPARE(iface->childCount(), 4); -- cgit v1.2.3 From 0f929bfa9aa76d7db54a62c6a571e97224384ec1 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Mon, 12 Mar 2012 14:24:02 +1000 Subject: Fixed benchmarks to work from install directory - Changed benchmarks to use TESTDATA and QFINDTESTDATA - Fixed up targets all use tst_bench_ syntax Change-Id: I5c2936702e248478f5df225ce38893158ee22d7f Reviewed-by: Jason McDonald Reviewed-by: Rohan McGovern --- .../benchmarks/corelib/codecs/qtextcodec/main.cpp | 8 ++- .../corelib/codecs/qtextcodec/qtextcodec.pro | 6 +- tests/benchmarks/corelib/io/qdir/10000/10000.pro | 2 +- tests/benchmarks/corelib/json/json.pro | 2 + tests/benchmarks/corelib/json/test.json | 66 ++++++++++++++++++++++ .../corelib/json/tst_bench_qtbinaryjson.cpp | 12 +++- .../corelib/kernel/qmetatype/qmetatype.pro | 2 +- .../corelib/tools/qalgorithms/qalgorithms.pro | 2 +- tests/benchmarks/corelib/tools/qlist/qlist.pro | 2 +- tests/benchmarks/corelib/tools/qstring/main.cpp | 4 +- tests/benchmarks/corelib/tools/qstring/qstring.pro | 6 +- tests/benchmarks/corelib/tools/qvector/qvector.pro | 2 +- .../gui/itemviews/qheaderview/qheaderview.pro | 2 +- tests/benchmarks/gui/painting/qtbench/qtbench.pro | 2 +- tests/benchmarks/gui/text/qtext/main.cpp | 4 +- tests/benchmarks/gui/text/qtext/qtext.pro | 2 +- .../benchmarks/plugins/imageformats/jpeg/jpeg.cpp | 4 +- .../benchmarks/plugins/imageformats/jpeg/jpeg.pro | 8 +-- 18 files changed, 104 insertions(+), 32 deletions(-) create mode 100644 tests/benchmarks/corelib/json/test.json diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp b/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp index f75848556c..7e546baa91 100644 --- a/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp +++ b/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp @@ -129,7 +129,9 @@ void tst_QTextCodec::fromUnicode_data() const void tst_QTextCodec::fromUnicode() const { QFETCH(QTextCodec*, codec); - QFile file(SRCDIR "utf-8.txt"); + QString testFile = QFINDTESTDATA("utf-8.txt"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file utf-8.txt!"); + QFile file(testFile); if (!file.open(QFile::ReadOnly)) { qFatal("Cannot open input file"); return; @@ -156,7 +158,9 @@ void tst_QTextCodec::toUnicode_data() const void tst_QTextCodec::toUnicode() const { QFETCH(QTextCodec*, codec); - QFile file(SRCDIR "utf-8.txt"); + QString testFile = QFINDTESTDATA("utf-8.txt"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file utf-8.txt!"); + QFile file(testFile); QVERIFY(file.open(QFile::ReadOnly)); QByteArray data = file.readAll(); const char *d = data.constData(); diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro index c13c714543..5ee577c256 100644 --- a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro +++ b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro @@ -2,9 +2,5 @@ TARGET = tst_bench_qtextcodec QT = core testlib SOURCES += main.cpp -wince*:{ - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} +TESTDATA = utf-8.txt diff --git a/tests/benchmarks/corelib/io/qdir/10000/10000.pro b/tests/benchmarks/corelib/io/qdir/10000/10000.pro index 196b3b5b30..2e83dad071 100644 --- a/tests/benchmarks/corelib/io/qdir/10000/10000.pro +++ b/tests/benchmarks/corelib/io/qdir/10000/10000.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = bench_qdir_10000 +TARGET = tst_bench_qdir_10000 SOURCES += bench_qdir_10000.cpp diff --git a/tests/benchmarks/corelib/json/json.pro b/tests/benchmarks/corelib/json/json.pro index 1694d61d94..004f4b123e 100644 --- a/tests/benchmarks/corelib/json/json.pro +++ b/tests/benchmarks/corelib/json/json.pro @@ -3,3 +3,5 @@ QT = core testlib CONFIG -= app_bundle SOURCES += tst_bench_qtbinaryjson.cpp + +TESTDATA = numbers.json test.json diff --git a/tests/benchmarks/corelib/json/test.json b/tests/benchmarks/corelib/json/test.json new file mode 100644 index 0000000000..7c935fffc8 --- /dev/null +++ b/tests/benchmarks/corelib/json/test.json @@ -0,0 +1,66 @@ +[ + "JSON Test Pattern pass1", + {"object with 1 member":["array with 1 element"]}, + {}, + [], + -42, + true, + false, + null, + { + "integer": 1234567890, + "real": -9876.543210, + "e": 0.123456789e-12, + "E": 1.234567890E+34, + "": 23456789012E66, + "zero": 0, + "one": 1, + "space": " ", + "quote": "\"", + "backslash": "\\", + "controls": "\b\f\n\r\t", + "slash": "/ & \/", + "alpha": "abcdefghijklmnopqrstuvwxyz", + "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + "digit": "0123456789", + "0123456789": "digit", + "special": "`1~!@#$%^&*()_+-={\':[,]}|;.?", + "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", + "true": true, + "false": false, + "null": null, + "array":[ ], + "object":{ }, + "address": "50 St. James Street", + "url": "http://www.JSON.org/", + "comment": "// /* */": " ", + " s p a c e d " :[1,2 , 3 + +, + +4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], + "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", + "quotes": "" \u0022 %22 0x22 034 "", + "\/\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?" : "A key can be any string" + }, + 0.5 ,98.6 +, +99.44 +, + +1066, +1e1, +0.1e1, +1e-1, +1e00, +2e+00, +2e-00, +"rosebud", +{"foo": "bar"}, +{"classification":{"relevancyScore":1000,"searchUrl":{"value":"http://www.bizrate.com/iphone-cases/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"}},"products":{"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$4,833.99","integral":483399}},"product":[{"type":"PRODUCT","title":"Silicone case for iPhone 3G/ 3GS","description":"Elite Horizontal Leather Pouch for Apple iPhone 3G/3Gs - Premium quality horizontal case for your Apple iPhone 3G/3Gs. This pouch is ideal for the style conscious on the go. This great looking case is made from high-quality leather with classic black...","manufacturer":"Apple","url":{"value":"http://www.bizrate.com/silicone-case-for-iphone-3g-3gs--pid1968262863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1968262863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1968262863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1968262863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1968262863","xsize":400,"ysize":400}]},"relevancy":310711221747712.000000,"priceSet":{"minPrice":{"value":"$1.56","integral":156},"maxPrice":{"value":"$29.99","integral":2999},"stores":14},"id":1968262863,"categoryId":8515},{"type":"PRODUCT","title":"Nonslip Checkered Silicone Skin Soft Case for iPhone 4 4G","description":"Specification:Product Name Silicone Skin Case Model for Apple iPhone 4 Color Black Material Soft Silicone Skin Weight 26g Package 1 x Case for Apple iPhone 4 Description:This is a non-OEM product.Accessory Only, Phone is not included.","manufacturer":"H&B","url":{"value":"http://www.bizrate.com/nonslip-checkered-silicone-skin-soft-case-for-iphone-4-4g--pid2534935499/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2534935499","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2534935499","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2534935499","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2534935499","xsize":400,"ysize":400}]},"relevancy":175580930637824.000000,"priceSet":{"minPrice":{"value":"$0.45","integral":45},"maxPrice":{"value":"$194.95","integral":19495},"stores":34},"id":2534935499,"categoryId":8515},{"type":"PRODUCT","title":"Plastic Case for iPhone 4 - Black","description":"Description:Detachable Windmill Type Matte Hard Plastic Case Cover for iPhone 4 (Black / Magenta)Customised your iPhone with this wonderful Plastic Case which is a accessory for your iPhone 4 which is made of high quality and durable plastic, protect","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/plastic-case-for-iphone-4-black--pid2305624670/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2305624670","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2305624670","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2305624670","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2305624670","xsize":400,"ysize":400}]},"relevancy":132488642953216.000000,"priceSet":{"minPrice":{"value":"$0.99","integral":99},"maxPrice":{"value":"$303.68","integral":30368},"stores":33},"id":2305624670,"categoryId":8515},{"type":"PRODUCT","title":"Protective Silicone Case for iPhone 4","description":"Made of high quality PVC material Protects your iPhone 4 from any scratch and dirt Easy to install and remove, no any tool needed Cut-out design allows user can access all keypad / button and slot without having to remove the case","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/protective-silicone-case-for-iphone-4--pid2120981405/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2120981405","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2120981405","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2120981405","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2120981405","xsize":400,"ysize":400}]},"relevancy":108614681362432.000000,"priceSet":{"minPrice":{"value":"$1.70","integral":170},"maxPrice":{"value":"$99.99","integral":9999},"stores":11},"id":2120981405,"categoryId":8515},{"type":"PRODUCT","title":"Iphone® 4 Aerosport Case","description":"Do more than just protect your iPhone 4 with this case bundle from rooCASE. This 3 in 1 bundle include a snap-on case, screen protector and a Nike+ sensor shoe pouch that can be use on most running shoes. Color: Purple Design: Love Provides protection...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/iphone-4-aerosport-case--pid2203798762/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2203798762","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2203798762","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2203798762","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2203798762","xsize":400,"ysize":400}]},"relevancy":96203484168192.000000,"priceSet":{"minPrice":{"value":"$2.49","integral":249},"maxPrice":{"value":"$79.95","integral":7995},"stores":16},"id":2203798762,"categoryId":8515},{"type":"PRODUCT","title":"Case Reflect For Iphone 3G","description":"NCAA iPhone 3G faceplate features the schools primary logo silk screened on the front of the case.","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/case-reflect-for-iphone-3g--pid1114627445/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1114627445","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1114627445","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1114627445","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1114627445","xsize":400,"ysize":400}]},"relevancy":84727583211520.000000,"priceSet":{"minPrice":{"value":"$0.69","integral":69},"maxPrice":{"value":"$75.52","integral":7552},"stores":59},"id":1114627445,"categoryId":8515},{"type":"PRODUCT","title":"Infuse Protector Case for iPhone 4 Black","description":"Protect and personalize your iPhone 4 with this front and back image design Protector Case. Form-fitting front and back hard plastic covers Protects your cell phone without adding a lot of bulk Smooth glossy finish Snaps on to the front edges, sides...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/infuse-protector-case-for-iphone-4-black--pid2557462717/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2557462717","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2557462717","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2557462717","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2557462717","xsize":400,"ysize":400}]},"relevancy":80831066406912.000000,"priceSet":{"minPrice":{"value":"$0.59","integral":59},"maxPrice":{"value":"$79.00","integral":7900},"stores":24},"id":2557462717,"categoryId":8515},{"type":"PRODUCT","title":"Dragonfly iPhone 4 Kream Case - Black","description":"DF-0030219 - White, Kream Case for iPhone 4 by Dragon-Fly","url":{"value":"http://www.bizrate.com/dragonfly-iphone-4-kream-case-black--pid2442061740/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2442061740","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2442061740","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2442061740","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2442061740","xsize":400,"ysize":400}]},"relevancy":70900229603328.000000,"priceSet":{"minPrice":{"value":"$1.05","integral":105},"maxPrice":{"value":"$94.49","integral":9449},"stores":30},"id":2442061740,"categoryId":8515},{"type":"PRODUCT","title":"Apple iPhone 3G/3GS Silicone Case (Black)","description":"Snap on Apple iPhone 3G 3GS Synthetic Leather Hardshell Case! Premium Qualtiy Synthetic Leather cover provides style, comfort, and protection to your iPhone 3G & 3GS. It also adds a sophisticated elegance and cool to your fashion. The case allows Quick...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/apple-iphone-3g3gs-silicone-case-black--pid2004746863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2004746863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2004746863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2004746863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2004746863","xsize":400,"ysize":400}]},"relevancy":65194915004416.000000,"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$414.99","integral":41499},"stores":39},"id":2004746863,"categoryId":8515},{"type":"PRODUCT","title":"Otterbox iPhone 4 Defender Case - Black","description":"Your iPhone 4 has become a big part of your life. With FaceTime video, retina display, multitasking, HD video recording and more - you've got a lot to lose. You won't find a tougher case than the OtterBox Defender Series for iPhone 4. This three-layer...","manufacturer":"Universal","url":{"value":"http://www.bizrate.com/otterbox-iphone-4-defender-case-black--pid2584611575/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2584611575","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2584611575","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2584611575","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2584611575","xsize":400,"ysize":400}]},"relevancy":61515478597632.000000,"priceSet":{"minPrice":{"value":"$3.28","integral":328},"maxPrice":{"value":"$110.65","integral":11065},"stores":25},"id":2584611575,"categoryId":8515}],"includedResults":10,"totalResults":2000}}, +{"classification":{"relevancyScore":1000,"searchUrl":{"value":"http://www.bizrate.com/iphone-cases/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"}},"products":{"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$4,833.99","integral":483399}},"product":[{"type":"PRODUCT","title":"Silicone case for iPhone 3G/ 3GS","description":"Elite Horizontal Leather Pouch for Apple iPhone 3G/3Gs - Premium quality horizontal case for your Apple iPhone 3G/3Gs. This pouch is ideal for the style conscious on the go. This great looking case is made from high-quality leather with classic black...","manufacturer":"Apple","url":{"value":"http://www.bizrate.com/silicone-case-for-iphone-3g-3gs--pid1968262863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1968262863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1968262863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1968262863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1968262863","xsize":400,"ysize":400}]},"relevancy":310711221747712.000000,"priceSet":{"minPrice":{"value":"$1.56","integral":156},"maxPrice":{"value":"$29.99","integral":2999},"stores":14},"id":1968262863,"categoryId":8515},{"type":"PRODUCT","title":"Nonslip Checkered Silicone Skin Soft Case for iPhone 4 4G","description":"Specification:Product Name Silicone Skin Case Model for Apple iPhone 4 Color Black Material Soft Silicone Skin Weight 26g Package 1 x Case for Apple iPhone 4 Description:This is a non-OEM product.Accessory Only, Phone is not included.","manufacturer":"H&B","url":{"value":"http://www.bizrate.com/nonslip-checkered-silicone-skin-soft-case-for-iphone-4-4g--pid2534935499/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2534935499","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2534935499","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2534935499","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2534935499","xsize":400,"ysize":400}]},"relevancy":175580930637824.000000,"priceSet":{"minPrice":{"value":"$0.45","integral":45},"maxPrice":{"value":"$194.95","integral":19495},"stores":34},"id":2534935499,"categoryId":8515},{"type":"PRODUCT","title":"Plastic Case for iPhone 4 - Black","description":"Description:Detachable Windmill Type Matte Hard Plastic Case Cover for iPhone 4 (Black / Magenta)Customised your iPhone with this wonderful Plastic Case which is a accessory for your iPhone 4 which is made of high quality and durable plastic, protect","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/plastic-case-for-iphone-4-black--pid2305624670/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2305624670","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2305624670","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2305624670","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2305624670","xsize":400,"ysize":400}]},"relevancy":132488642953216.000000,"priceSet":{"minPrice":{"value":"$0.99","integral":99},"maxPrice":{"value":"$303.68","integral":30368},"stores":33},"id":2305624670,"categoryId":8515},{"type":"PRODUCT","title":"Protective Silicone Case for iPhone 4","description":"Made of high quality PVC material Protects your iPhone 4 from any scratch and dirt Easy to install and remove, no any tool needed Cut-out design allows user can access all keypad / button and slot without having to remove the case","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/protective-silicone-case-for-iphone-4--pid2120981405/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2120981405","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2120981405","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2120981405","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2120981405","xsize":400,"ysize":400}]},"relevancy":108614681362432.000000,"priceSet":{"minPrice":{"value":"$1.70","integral":170},"maxPrice":{"value":"$99.99","integral":9999},"stores":11},"id":2120981405,"categoryId":8515},{"type":"PRODUCT","title":"Iphone® 4 Aerosport Case","description":"Do more than just protect your iPhone 4 with this case bundle from rooCASE. This 3 in 1 bundle include a snap-on case, screen protector and a Nike+ sensor shoe pouch that can be use on most running shoes. Color: Purple Design: Love Provides protection...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/iphone-4-aerosport-case--pid2203798762/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2203798762","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2203798762","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2203798762","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2203798762","xsize":400,"ysize":400}]},"relevancy":96203484168192.000000,"priceSet":{"minPrice":{"value":"$2.49","integral":249},"maxPrice":{"value":"$79.95","integral":7995},"stores":16},"id":2203798762,"categoryId":8515},{"type":"PRODUCT","title":"Case Reflect For Iphone 3G","description":"NCAA iPhone 3G faceplate features the schools primary logo silk screened on the front of the case.","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/case-reflect-for-iphone-3g--pid1114627445/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1114627445","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1114627445","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1114627445","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1114627445","xsize":400,"ysize":400}]},"relevancy":84727583211520.000000,"priceSet":{"minPrice":{"value":"$0.69","integral":69},"maxPrice":{"value":"$75.52","integral":7552},"stores":59},"id":1114627445,"categoryId":8515},{"type":"PRODUCT","title":"Infuse Protector Case for iPhone 4 Black","description":"Protect and personalize your iPhone 4 with this front and back image design Protector Case. Form-fitting front and back hard plastic covers Protects your cell phone without adding a lot of bulk Smooth glossy finish Snaps on to the front edges, sides...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/infuse-protector-case-for-iphone-4-black--pid2557462717/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2557462717","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2557462717","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2557462717","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2557462717","xsize":400,"ysize":400}]},"relevancy":80831066406912.000000,"priceSet":{"minPrice":{"value":"$0.59","integral":59},"maxPrice":{"value":"$79.00","integral":7900},"stores":24},"id":2557462717,"categoryId":8515},{"type":"PRODUCT","title":"Dragonfly iPhone 4 Kream Case - Black","description":"DF-0030219 - White, Kream Case for iPhone 4 by Dragon-Fly","url":{"value":"http://www.bizrate.com/dragonfly-iphone-4-kream-case-black--pid2442061740/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2442061740","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2442061740","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2442061740","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2442061740","xsize":400,"ysize":400}]},"relevancy":70900229603328.000000,"priceSet":{"minPrice":{"value":"$1.05","integral":105},"maxPrice":{"value":"$94.49","integral":9449},"stores":30},"id":2442061740,"categoryId":8515},{"type":"PRODUCT","title":"Apple iPhone 3G/3GS Silicone Case (Black)","description":"Snap on Apple iPhone 3G 3GS Synthetic Leather Hardshell Case! Premium Qualtiy Synthetic Leather cover provides style, comfort, and protection to your iPhone 3G & 3GS. It also adds a sophisticated elegance and cool to your fashion. The case allows Quick...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/apple-iphone-3g3gs-silicone-case-black--pid2004746863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2004746863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2004746863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2004746863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2004746863","xsize":400,"ysize":400}]},"relevancy":65194915004416.000000,"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$414.99","integral":41499},"stores":39},"id":2004746863,"categoryId":8515},{"type":"PRODUCT","title":"Otterbox iPhone 4 Defender Case - Black","description":"Your iPhone 4 has become a big part of your life. With FaceTime video, retina display, multitasking, HD video recording and more - you've got a lot to lose. You won't find a tougher case than the OtterBox Defender Series for iPhone 4. This three-layer...","manufacturer":"Universal","url":{"value":"http://www.bizrate.com/otterbox-iphone-4-defender-case-black--pid2584611575/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2584611575","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2584611575","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2584611575","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2584611575","xsize":400,"ysize":400}]},"relevancy":61515478597632.000000,"priceSet":{"minPrice":{"value":"$3.28","integral":328},"maxPrice":{"value":"$110.65","integral":11065},"stores":25},"id":2584611575,"categoryId":8515}],"includedResults":10,"totalResults":2000}}, +{"classification":{"relevancyScore":1000,"searchUrl":{"value":"http://www.bizrate.com/iphone-cases/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"}},"products":{"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$4,833.99","integral":483399}},"product":[{"type":"PRODUCT","title":"Silicone case for iPhone 3G/ 3GS","description":"Elite Horizontal Leather Pouch for Apple iPhone 3G/3Gs - Premium quality horizontal case for your Apple iPhone 3G/3Gs. This pouch is ideal for the style conscious on the go. This great looking case is made from high-quality leather with classic black...","manufacturer":"Apple","url":{"value":"http://www.bizrate.com/silicone-case-for-iphone-3g-3gs--pid1968262863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1968262863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1968262863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1968262863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1968262863","xsize":400,"ysize":400}]},"relevancy":310711221747712.000000,"priceSet":{"minPrice":{"value":"$1.56","integral":156},"maxPrice":{"value":"$29.99","integral":2999},"stores":14},"id":1968262863,"categoryId":8515},{"type":"PRODUCT","title":"Nonslip Checkered Silicone Skin Soft Case for iPhone 4 4G","description":"Specification:Product Name Silicone Skin Case Model for Apple iPhone 4 Color Black Material Soft Silicone Skin Weight 26g Package 1 x Case for Apple iPhone 4 Description:This is a non-OEM product.Accessory Only, Phone is not included.","manufacturer":"H&B","url":{"value":"http://www.bizrate.com/nonslip-checkered-silicone-skin-soft-case-for-iphone-4-4g--pid2534935499/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2534935499","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2534935499","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2534935499","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2534935499","xsize":400,"ysize":400}]},"relevancy":175580930637824.000000,"priceSet":{"minPrice":{"value":"$0.45","integral":45},"maxPrice":{"value":"$194.95","integral":19495},"stores":34},"id":2534935499,"categoryId":8515},{"type":"PRODUCT","title":"Plastic Case for iPhone 4 - Black","description":"Description:Detachable Windmill Type Matte Hard Plastic Case Cover for iPhone 4 (Black / Magenta)Customised your iPhone with this wonderful Plastic Case which is a accessory for your iPhone 4 which is made of high quality and durable plastic, protect","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/plastic-case-for-iphone-4-black--pid2305624670/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2305624670","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2305624670","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2305624670","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2305624670","xsize":400,"ysize":400}]},"relevancy":132488642953216.000000,"priceSet":{"minPrice":{"value":"$0.99","integral":99},"maxPrice":{"value":"$303.68","integral":30368},"stores":33},"id":2305624670,"categoryId":8515},{"type":"PRODUCT","title":"Protective Silicone Case for iPhone 4","description":"Made of high quality PVC material Protects your iPhone 4 from any scratch and dirt Easy to install and remove, no any tool needed Cut-out design allows user can access all keypad / button and slot without having to remove the case","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/protective-silicone-case-for-iphone-4--pid2120981405/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2120981405","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2120981405","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2120981405","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2120981405","xsize":400,"ysize":400}]},"relevancy":108614681362432.000000,"priceSet":{"minPrice":{"value":"$1.70","integral":170},"maxPrice":{"value":"$99.99","integral":9999},"stores":11},"id":2120981405,"categoryId":8515},{"type":"PRODUCT","title":"Iphone® 4 Aerosport Case","description":"Do more than just protect your iPhone 4 with this case bundle from rooCASE. This 3 in 1 bundle include a snap-on case, screen protector and a Nike+ sensor shoe pouch that can be use on most running shoes. Color: Purple Design: Love Provides protection...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/iphone-4-aerosport-case--pid2203798762/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2203798762","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2203798762","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2203798762","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2203798762","xsize":400,"ysize":400}]},"relevancy":96203484168192.000000,"priceSet":{"minPrice":{"value":"$2.49","integral":249},"maxPrice":{"value":"$79.95","integral":7995},"stores":16},"id":2203798762,"categoryId":8515},{"type":"PRODUCT","title":"Case Reflect For Iphone 3G","description":"NCAA iPhone 3G faceplate features the schools primary logo silk screened on the front of the case.","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/case-reflect-for-iphone-3g--pid1114627445/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1114627445","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1114627445","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1114627445","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1114627445","xsize":400,"ysize":400}]},"relevancy":84727583211520.000000,"priceSet":{"minPrice":{"value":"$0.69","integral":69},"maxPrice":{"value":"$75.52","integral":7552},"stores":59},"id":1114627445,"categoryId":8515},{"type":"PRODUCT","title":"Infuse Protector Case for iPhone 4 Black","description":"Protect and personalize your iPhone 4 with this front and back image design Protector Case. Form-fitting front and back hard plastic covers Protects your cell phone without adding a lot of bulk Smooth glossy finish Snaps on to the front edges, sides...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/infuse-protector-case-for-iphone-4-black--pid2557462717/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2557462717","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2557462717","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2557462717","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2557462717","xsize":400,"ysize":400}]},"relevancy":80831066406912.000000,"priceSet":{"minPrice":{"value":"$0.59","integral":59},"maxPrice":{"value":"$79.00","integral":7900},"stores":24},"id":2557462717,"categoryId":8515},{"type":"PRODUCT","title":"Dragonfly iPhone 4 Kream Case - Black","description":"DF-0030219 - White, Kream Case for iPhone 4 by Dragon-Fly","url":{"value":"http://www.bizrate.com/dragonfly-iphone-4-kream-case-black--pid2442061740/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2442061740","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2442061740","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2442061740","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2442061740","xsize":400,"ysize":400}]},"relevancy":70900229603328.000000,"priceSet":{"minPrice":{"value":"$1.05","integral":105},"maxPrice":{"value":"$94.49","integral":9449},"stores":30},"id":2442061740,"categoryId":8515},{"type":"PRODUCT","title":"Apple iPhone 3G/3GS Silicone Case (Black)","description":"Snap on Apple iPhone 3G 3GS Synthetic Leather Hardshell Case! Premium Qualtiy Synthetic Leather cover provides style, comfort, and protection to your iPhone 3G & 3GS. It also adds a sophisticated elegance and cool to your fashion. The case allows Quick...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/apple-iphone-3g3gs-silicone-case-black--pid2004746863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2004746863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2004746863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2004746863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2004746863","xsize":400,"ysize":400}]},"relevancy":65194915004416.000000,"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$414.99","integral":41499},"stores":39},"id":2004746863,"categoryId":8515},{"type":"PRODUCT","title":"Otterbox iPhone 4 Defender Case - Black","description":"Your iPhone 4 has become a big part of your life. With FaceTime video, retina display, multitasking, HD video recording and more - you've got a lot to lose. You won't find a tougher case than the OtterBox Defender Series for iPhone 4. This three-layer...","manufacturer":"Universal","url":{"value":"http://www.bizrate.com/otterbox-iphone-4-defender-case-black--pid2584611575/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2584611575","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2584611575","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2584611575","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2584611575","xsize":400,"ysize":400}]},"relevancy":61515478597632.000000,"priceSet":{"minPrice":{"value":"$3.28","integral":328},"maxPrice":{"value":"$110.65","integral":11065},"stores":25},"id":2584611575,"categoryId":8515}],"includedResults":10,"totalResults":2000}}, +{"classification":{"relevancyScore":1000,"searchUrl":{"value":"http://www.bizrate.com/iphone-cases/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"}},"products":{"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$4,833.99","integral":483399}},"product":[{"type":"PRODUCT","title":"Silicone case for iPhone 3G/ 3GS","description":"Elite Horizontal Leather Pouch for Apple iPhone 3G/3Gs - Premium quality horizontal case for your Apple iPhone 3G/3Gs. This pouch is ideal for the style conscious on the go. This great looking case is made from high-quality leather with classic black...","manufacturer":"Apple","url":{"value":"http://www.bizrate.com/silicone-case-for-iphone-3g-3gs--pid1968262863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1968262863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1968262863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1968262863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1968262863","xsize":400,"ysize":400}]},"relevancy":310711221747712.000000,"priceSet":{"minPrice":{"value":"$1.56","integral":156},"maxPrice":{"value":"$29.99","integral":2999},"stores":14},"id":1968262863,"categoryId":8515},{"type":"PRODUCT","title":"Nonslip Checkered Silicone Skin Soft Case for iPhone 4 4G","description":"Specification:Product Name Silicone Skin Case Model for Apple iPhone 4 Color Black Material Soft Silicone Skin Weight 26g Package 1 x Case for Apple iPhone 4 Description:This is a non-OEM product.Accessory Only, Phone is not included.","manufacturer":"H&B","url":{"value":"http://www.bizrate.com/nonslip-checkered-silicone-skin-soft-case-for-iphone-4-4g--pid2534935499/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2534935499","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2534935499","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2534935499","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2534935499","xsize":400,"ysize":400}]},"relevancy":175580930637824.000000,"priceSet":{"minPrice":{"value":"$0.45","integral":45},"maxPrice":{"value":"$194.95","integral":19495},"stores":34},"id":2534935499,"categoryId":8515},{"type":"PRODUCT","title":"Plastic Case for iPhone 4 - Black","description":"Description:Detachable Windmill Type Matte Hard Plastic Case Cover for iPhone 4 (Black / Magenta)Customised your iPhone with this wonderful Plastic Case which is a accessory for your iPhone 4 which is made of high quality and durable plastic, protect","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/plastic-case-for-iphone-4-black--pid2305624670/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2305624670","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2305624670","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2305624670","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2305624670","xsize":400,"ysize":400}]},"relevancy":132488642953216.000000,"priceSet":{"minPrice":{"value":"$0.99","integral":99},"maxPrice":{"value":"$303.68","integral":30368},"stores":33},"id":2305624670,"categoryId":8515},{"type":"PRODUCT","title":"Protective Silicone Case for iPhone 4","description":"Made of high quality PVC material Protects your iPhone 4 from any scratch and dirt Easy to install and remove, no any tool needed Cut-out design allows user can access all keypad / button and slot without having to remove the case","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/protective-silicone-case-for-iphone-4--pid2120981405/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2120981405","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2120981405","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2120981405","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2120981405","xsize":400,"ysize":400}]},"relevancy":108614681362432.000000,"priceSet":{"minPrice":{"value":"$1.70","integral":170},"maxPrice":{"value":"$99.99","integral":9999},"stores":11},"id":2120981405,"categoryId":8515},{"type":"PRODUCT","title":"Iphone® 4 Aerosport Case","description":"Do more than just protect your iPhone 4 with this case bundle from rooCASE. This 3 in 1 bundle include a snap-on case, screen protector and a Nike+ sensor shoe pouch that can be use on most running shoes. Color: Purple Design: Love Provides protection...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/iphone-4-aerosport-case--pid2203798762/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2203798762","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2203798762","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2203798762","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2203798762","xsize":400,"ysize":400}]},"relevancy":96203484168192.000000,"priceSet":{"minPrice":{"value":"$2.49","integral":249},"maxPrice":{"value":"$79.95","integral":7995},"stores":16},"id":2203798762,"categoryId":8515},{"type":"PRODUCT","title":"Case Reflect For Iphone 3G","description":"NCAA iPhone 3G faceplate features the schools primary logo silk screened on the front of the case.","manufacturer":"Griffin","url":{"value":"http://www.bizrate.com/case-reflect-for-iphone-3g--pid1114627445/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=1114627445","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=1114627445","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=1114627445","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=1114627445","xsize":400,"ysize":400}]},"relevancy":84727583211520.000000,"priceSet":{"minPrice":{"value":"$0.69","integral":69},"maxPrice":{"value":"$75.52","integral":7552},"stores":59},"id":1114627445,"categoryId":8515},{"type":"PRODUCT","title":"Infuse Protector Case for iPhone 4 Black","description":"Protect and personalize your iPhone 4 with this front and back image design Protector Case. Form-fitting front and back hard plastic covers Protects your cell phone without adding a lot of bulk Smooth glossy finish Snaps on to the front edges, sides...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/infuse-protector-case-for-iphone-4-black--pid2557462717/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2557462717","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2557462717","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2557462717","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2557462717","xsize":400,"ysize":400}]},"relevancy":80831066406912.000000,"priceSet":{"minPrice":{"value":"$0.59","integral":59},"maxPrice":{"value":"$79.00","integral":7900},"stores":24},"id":2557462717,"categoryId":8515},{"type":"PRODUCT","title":"Dragonfly iPhone 4 Kream Case - Black","description":"DF-0030219 - White, Kream Case for iPhone 4 by Dragon-Fly","url":{"value":"http://www.bizrate.com/dragonfly-iphone-4-kream-case-black--pid2442061740/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2442061740","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2442061740","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2442061740","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2442061740","xsize":400,"ysize":400}]},"relevancy":70900229603328.000000,"priceSet":{"minPrice":{"value":"$1.05","integral":105},"maxPrice":{"value":"$94.49","integral":9449},"stores":30},"id":2442061740,"categoryId":8515},{"type":"PRODUCT","title":"Apple iPhone 3G/3GS Silicone Case (Black)","description":"Snap on Apple iPhone 3G 3GS Synthetic Leather Hardshell Case! Premium Qualtiy Synthetic Leather cover provides style, comfort, and protection to your iPhone 3G & 3GS. It also adds a sophisticated elegance and cool to your fashion. The case allows Quick...","manufacturer":"Luxmo","url":{"value":"http://www.bizrate.com/apple-iphone-3g3gs-silicone-case-black--pid2004746863/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2004746863","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2004746863","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2004746863","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2004746863","xsize":400,"ysize":400}]},"relevancy":65194915004416.000000,"priceSet":{"minPrice":{"value":"$0.01","integral":1},"maxPrice":{"value":"$414.99","integral":41499},"stores":39},"id":2004746863,"categoryId":8515},{"type":"PRODUCT","title":"Otterbox iPhone 4 Defender Case - Black","description":"Your iPhone 4 has become a big part of your life. With FaceTime video, retina display, multitasking, HD video recording and more - you've got a lot to lose. You won't find a tougher case than the OtterBox Defender Series for iPhone 4. This three-layer...","manufacturer":"Universal","url":{"value":"http://www.bizrate.com/otterbox-iphone-4-defender-case-black--pid2584611575/compareprices__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--50085__af_placement_id--1.html"},"images":{"image":[{"value":"http://image10.bizrate-images.com/resize?sq=60&uid=2584611575","xsize":60,"ysize":60},{"value":"http://image10.bizrate-images.com/resize?sq=100&uid=2584611575","xsize":100,"ysize":100},{"value":"http://image10.bizrate-images.com/resize?sq=160&uid=2584611575","xsize":160,"ysize":160},{"value":"http://image10.bizrate-images.com/resize?sq=400&uid=2584611575","xsize":400,"ysize":400}]},"relevancy":61515478597632.000000,"priceSet":{"minPrice":{"value":"$3.28","integral":328},"maxPrice":{"value":"$110.65","integral":11065},"stores":25},"id":2584611575,"categoryId":8515}],"includedResults":10,"totalResults":2000}} +] + diff --git a/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp b/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp index 8f3e2cc8c6..2253d00778 100644 --- a/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp +++ b/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp @@ -87,7 +87,9 @@ void BenchmarkQtBinaryJson::cleanup() void BenchmarkQtBinaryJson::parseNumbers() { - QFile file(QLatin1String("numbers.json")); + QString testFile = QFINDTESTDATA("numbers.json"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file numbers.json!"); + QFile file(testFile); file.open(QFile::ReadOnly); QByteArray testJson = file.readAll(); @@ -99,7 +101,9 @@ void BenchmarkQtBinaryJson::parseNumbers() void BenchmarkQtBinaryJson::parseJson() { - QFile file(QLatin1String("../../../auto/corelib/json/test.json")); + QString testFile = QFINDTESTDATA("test.json"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!"); + QFile file(testFile); file.open(QFile::ReadOnly); QByteArray testJson = file.readAll(); @@ -111,7 +115,9 @@ void BenchmarkQtBinaryJson::parseJson() void BenchmarkQtBinaryJson::parseJsonToVariant() { - QFile file(QLatin1String("../../../auto/corelib/json/test.json")); + QString testFile = QFINDTESTDATA("test.json"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!"); + QFile file(testFile); file.open(QFile::ReadOnly); QByteArray testJson = file.readAll(); diff --git a/tests/benchmarks/corelib/kernel/qmetatype/qmetatype.pro b/tests/benchmarks/corelib/kernel/qmetatype/qmetatype.pro index 5555e5cd14..83d0708b60 100644 --- a/tests/benchmarks/corelib/kernel/qmetatype/qmetatype.pro +++ b/tests/benchmarks/corelib/kernel/qmetatype/qmetatype.pro @@ -1,6 +1,6 @@ QT = core testlib TEMPLATE = app -TARGET = tst_qmetatype +TARGET = tst_bench_qmetatype SOURCES += tst_qmetatype.cpp diff --git a/tests/benchmarks/corelib/tools/qalgorithms/qalgorithms.pro b/tests/benchmarks/corelib/tools/qalgorithms/qalgorithms.pro index 00b63f9863..f54f8320d4 100644 --- a/tests/benchmarks/corelib/tools/qalgorithms/qalgorithms.pro +++ b/tests/benchmarks/corelib/tools/qalgorithms/qalgorithms.pro @@ -1,3 +1,3 @@ -TARGET = tst_qalgorithms +TARGET = tst_bench_qalgorithms QT = core testlib SOURCES = tst_qalgorithms.cpp diff --git a/tests/benchmarks/corelib/tools/qlist/qlist.pro b/tests/benchmarks/corelib/tools/qlist/qlist.pro index bb69d7651d..c83bc455d2 100644 --- a/tests/benchmarks/corelib/tools/qlist/qlist.pro +++ b/tests/benchmarks/corelib/tools/qlist/qlist.pro @@ -1,4 +1,4 @@ -TARGET = tst_qlist +TARGET = tst_bench_qlist QT = core testlib SOURCES += main.cpp diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index 9d5c43c290..9b10e97f2b 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -1408,7 +1408,9 @@ void tst_QString::ucstrncmp() const void tst_QString::fromUtf8() const { - QFile file(SRCDIR "utf-8.txt"); + QString testFile = QFINDTESTDATA("utf-8.txt"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file utf-8.txt!"); + QFile file(testFile); if (!file.open(QFile::ReadOnly)) { qFatal("Cannot open input file"); return; diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/tools/qstring/qstring.pro index 72300de9da..cf2ee24c6d 100644 --- a/tests/benchmarks/corelib/tools/qstring/qstring.pro +++ b/tests/benchmarks/corelib/tools/qstring/qstring.pro @@ -3,11 +3,7 @@ QT -= gui QT += core-private testlib SOURCES += main.cpp data.cpp fromlatin1.cpp fromutf8.cpp -wince*:{ - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} +TESTDATA = utf-8.txt sse4:QMAKE_CXXFLAGS += -msse4 else:ssse3:QMAKE_FLAGS += -mssse3 diff --git a/tests/benchmarks/corelib/tools/qvector/qvector.pro b/tests/benchmarks/corelib/tools/qvector/qvector.pro index 78a56adcd6..e24b16230a 100644 --- a/tests/benchmarks/corelib/tools/qvector/qvector.pro +++ b/tests/benchmarks/corelib/tools/qvector/qvector.pro @@ -1,4 +1,4 @@ -TARGET = tst_vector +TARGET = tst_bench_vector QT = core testlib INCLUDEPATH += . SOURCES += main.cpp outofline.cpp diff --git a/tests/benchmarks/gui/itemviews/qheaderview/qheaderview.pro b/tests/benchmarks/gui/itemviews/qheaderview/qheaderview.pro index 12cb5d5f03..7e8415e495 100644 --- a/tests/benchmarks/gui/itemviews/qheaderview/qheaderview.pro +++ b/tests/benchmarks/gui/itemviews/qheaderview/qheaderview.pro @@ -1,7 +1,7 @@ QT += widgets testlib TEMPLATE = app -TARGET = bench_qheaderview +TARGET = tst_bench_qheaderview SOURCES += qheaderviewbench.cpp diff --git a/tests/benchmarks/gui/painting/qtbench/qtbench.pro b/tests/benchmarks/gui/painting/qtbench/qtbench.pro index 06c77a93c0..ab3f040033 100644 --- a/tests/benchmarks/gui/painting/qtbench/qtbench.pro +++ b/tests/benchmarks/gui/painting/qtbench/qtbench.pro @@ -1,7 +1,7 @@ QT += widgets testlib TEMPLATE = app -TARGET = tst_qtbench +TARGET = tst_bench_qtbench SOURCES += tst_qtbench.cpp diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp index d4acfce821..5a4745fbc7 100644 --- a/tests/benchmarks/gui/text/qtext/main.cpp +++ b/tests/benchmarks/gui/text/qtext/main.cpp @@ -129,7 +129,9 @@ void tst_QText::shaping_data() QTest::newRow("lorem") << m_lorem; QTest::newRow("short") << QString::fromLatin1("Lorem ipsum dolor sit amet"); - QFile file(QString::fromLatin1(SRCDIR) + QLatin1String("/bidi.txt")); + QString testFile = QFINDTESTDATA("bidi.txt"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file bidi.txt!"); + QFile file(testFile); QVERIFY(file.open(QFile::ReadOnly)); QByteArray data = file.readAll(); QVERIFY(data.count() > 1000); diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro index ef91a97493..084cf858fd 100644 --- a/tests/benchmarks/gui/text/qtext/qtext.pro +++ b/tests/benchmarks/gui/text/qtext/qtext.pro @@ -6,4 +6,4 @@ TARGET = tst_bench_QText SOURCES += main.cpp -DEFINES += SRCDIR=\\\"$$PWD/\\\" +TESTDATA = bidi.txt diff --git a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp index a3644efd53..761fbcc7a7 100644 --- a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp +++ b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp @@ -59,7 +59,9 @@ void tst_jpeg::jpegDecodingQtWebkitStyle() { // QtWebkit currently calls size() to get the image size for layouting purposes. // Then when it is in the viewport (we assume that here) it actually gets decoded. - QFile inputJpeg(SRCDIR "n900.jpeg"); + QString testFile = QFINDTESTDATA("n900.jpeg"); + QVERIFY2(!testFile.isEmpty(), "cannot find test file n900.jpeg!"); + QFile inputJpeg(testFile); QVERIFY(inputJpeg.exists()); inputJpeg.open(QIODevice::ReadOnly); QByteArray imageData = inputJpeg.readAll(); diff --git a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro index d278e9e721..281e79f585 100644 --- a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro +++ b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.pro @@ -3,10 +3,6 @@ TARGET = jpeg QT += testlib CONFIG += release -wince*: { - DEFINES += SRCDIR=\\\"\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} - SOURCES += jpeg.cpp + +TESTDATA = n900.jpeg -- cgit v1.2.3 From 25e004bfe493e18be255b057ae5c132a5ec5458b Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Mon, 19 Mar 2012 13:32:31 +1000 Subject: Set RPATH_FLAGS on Mac too Without this, QMAKE_RPATHDIR is empty and qt_module.prf's logic to turn on absolute_library_soname fails, causing some modules to build without absolute paths (eg. qtjsbackend's QtV8 framework). Change-Id: If03136ca60a5d8a96a589e2d1034e5884fd6a1ac Reviewed-by: Michael Brasser --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index a4d724efae..8164badeba 100755 --- a/configure +++ b/configure @@ -5722,6 +5722,8 @@ fi if [ "$PLATFORM_MAC" = "yes" ]; then if [ "$CFG_RPATH" = "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname" + # set the default rpath to the library installation directory + RPATH_FLAGS="\"$QT_INSTALL_LIBS\" $RPATH_FLAGS" fi elif [ -z "`getXQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then if [ -n "$RPATH_FLAGS" ]; then -- cgit v1.2.3