From 9bf93f3e7307447ed9eb46f275bd9f92c8e0baaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 8 Apr 2013 12:26:05 +0200 Subject: Clear the WA_QuitOnClose flag from EvalMessageBox. The evaluation message box caused the QtWebProcess to quit due to the fact that the process has no other windows and EvalMessageBox was both set to be closed on quit and ended up being the last window in the process. Change-Id: Iad6461d014258fdc5fade7dafe48da33903377bb Reviewed-by: Simon Hausmann Reviewed-by: Andy Shaw Reviewed-by: Jocelyn Turcotte --- src/corelib/kernel/qtcore_eval.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp index ab575371c8..e9ff786074 100644 --- a/src/corelib/kernel/qtcore_eval.cpp +++ b/src/corelib/kernel/qtcore_eval.cpp @@ -496,6 +496,7 @@ public: setParent(parentWidget(), Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); QTimer::singleShot(7000, this, SLOT(close())); setAttribute(Qt::WA_DeleteOnClose); + setAttribute(Qt::WA_QuitOnClose, false); } setFixedSize(sizeHint()); -- cgit v1.2.3 From faa390dc4f37127f343a377c03ab3673b77e9e49 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 20 Feb 2013 17:24:22 +0100 Subject: Fix compilation with QT_NO_ACCESSIBILITY. Task-number: QTBUG-27860 Change-Id: I561b0b0b1a098556f9de909241b448307a271985 Reviewed-by: Konstantin Ritt (cherry picked from commit 8b29c7539d87a387854cf06782a7b078dce63612) Reviewed-by: Kai Koehne Reviewed-by: Friedemann Kleint --- src/widgets/styles/qwindowsvistastyle.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 48d2027834..a621cab04d 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -520,7 +520,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt } break; case PE_Frame: { +#ifndef QT_NO_ACCESSIBILITY if (QStyleHelper::isInstanceOf(option->styleObject, QAccessible::EditableText)) { +#else + if (false) { +#endif painter->save(); int stateId = ETS_NORMAL; if (!(state & State_Enabled)) -- cgit v1.2.3 From 967c18d29694fdeab858691a80cb8400fd02ec33 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 8 Apr 2013 10:57:22 +0200 Subject: Update changes log for 5.0.2 Change-Id: I01321d4d2074a04e48e90580a4ec38f0af2f23c6 Reviewed-by: Akseli Salovaara Reviewed-by: Iikka Eklund --- dist/changes-5.0.2 | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/dist/changes-5.0.2 b/dist/changes-5.0.2 index a9d715d1e6..209f963c65 100644 --- a/dist/changes-5.0.2 +++ b/dist/changes-5.0.2 @@ -22,18 +22,12 @@ information about a particular change. General Improvements -------------------- -Third party components ----------------------- - -Legal ------ - + - Lots of fixes to enable static builds on Windows, Linux and Mac. **************************************************************************** * Library * **************************************************************************** - QtCore ----- @@ -44,29 +38,35 @@ QtCore QtGui ----- + - [QTBUG-14766] Fixed potential access violation in QPixmap::copy() for <32 bit pixmaps. + - [QTBUG-24762] Fixed dashes being rendered differently depending on system clip. + - [QTBUG-25036] Fixed artifacts when drawing same line with different clips. + - [QTBUG-29643] Fixed crashes when using QImage in combination with QCoreApplication. + QtWidgets --------- -- [QTBUG-28817] Fixed QColorDialog::setOption(), QFontDialog::setOption(). + - [QTBUG-28817] Fixed QColorDialog::setOption(), QFontDialog::setOption(). + - [QTBUG-29680] Fix mouse double click events not bubbling up to parent widgets. QtNetwork --------- -QtDBus ------- + - [QTBUG-29103] Toggle on demand loading of root certs properly. QtConcurrent ------------ -QtOpenGL --------- - -QtTest ------- + - [QTBUG-28984] Fix compilation of Qt Concurrent with gcc 4.3. QtSql ----- + - Fix QSqlTableModel:revert() for OnFieldChange. + - [QTBUG-29102] Support refreshing inserted rows with auto columns. + - [QTBUG-29108] Fix QSqlTableModel::headerData() for empty query with inserted row. + - [QTBUG-29217] Fix QSqlTableModel::setData() for non-change detection. + **************************************************************************** * Database Drivers * **************************************************************************** @@ -84,16 +84,23 @@ postgres Qt for Linux/X11 ---------------- + - Fix focus handling of native child widgets in xcb. + - Fixed crash when VNCing and trying to use non-present XFixes extension. + Qt for Windows -------------- - - [QTBUG-30185] Fixed adding of suffixes in Window native file save dialog. + - [QTBUG-28439] Implement QPlatformWindow::isExposed() on Windows. - [QTBUG-29010, QTBUG-28531] Fixed handling of layered windows required for translucent or non-opaque windows. + - [QTBUG-30185] Fixed adding of suffixes in Window native file save dialog. Qt for Mac OS X --------------- + - [QTBUG-29389] Fix transient scroll bar appearance before the proper one. + - [QTBUG-25297, QTBUG-29434] Add QMdiSubWindow size grip back. + Qt for BlackBerry ----------------- @@ -103,11 +110,14 @@ Qt for Embedded Linux Qt for Windows CE ----------------- + - Removed User32.dll usage. + - Fix compilation with QT_NO_CURSOR. **************************************************************************** * Compiler Specific Changes * **************************************************************************** + - [QTBUG-29099] Fix gcc OOM error when compiling in release mode. **************************************************************************** * Tools * -- cgit v1.2.3 From 4d7f0ce8d096370f464493d9d0ceff1eace93f14 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Sun, 7 Apr 2013 16:35:17 +0100 Subject: Android: Backslash workarounds for Unix Makefile generator If mingw32-make.exe encounters a backslash as the last character on a line it interprets this as signifying line continuation. When building Android Qt on Windows via cmd.exe, this happens as backslashes are used on Windows as directory separators. The workarounds are to make sure that a comment appears directly after the definition of DESTDIR and that a space ends such $(MOVE) command lines. Change-Id: I7f93b655e004edaadac41d0d96bca23e1ba3a85c Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 9cb63ce539..2a99b5dd34 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -221,7 +221,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) do_incremental = false; t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << endl; t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; - t << "DESTDIR = " << var("DESTDIR") << endl; + // The comment is important for mingw32-make.exe on Windows as otherwise trailing slashes + // would be interpreted as line continuation. The lack of spacing between the value and the + // comment is also important as otherwise quoted use of "$(DESTDIR)" would include this + // spacing. + t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak" << endl; if(project->isActiveConfig("compile_libtool")) t << "TARGETL = " << var("TARGET_la") << endl; t << "TARGET = " << escapeFilePath(var("TARGET")) << endl; @@ -546,7 +550,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << var("QMAKE_LINK_SHLIB_CMD"); if(!destdir.isEmpty()) t << "\n\t" - << "-$(MOVE) $(TARGET) " << destdir; + << "-$(MOVE) $(TARGET) " << destdir << " "; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; @@ -579,10 +583,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "-$(DEL_FILE) " << destdir << "$(TARGET0)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET1)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET2)\n\t" - << "-$(MOVE) $(TARGET) " << destdir << "\n\t" - << "-$(MOVE) $(TARGET0) " << destdir << "\n\t" - << "-$(MOVE) $(TARGET1) " << destdir << "\n\t" - << "-$(MOVE) $(TARGET2) " << destdir << "\n\t"; + << "-$(MOVE) $(TARGET) " << destdir << " \n\t" + << "-$(MOVE) $(TARGET0) " << destdir << " \n\t" + << "-$(MOVE) $(TARGET1) " << destdir << " \n\t" + << "-$(MOVE) $(TARGET2) " << destdir << " \n\t"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; @@ -595,8 +599,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET0)\n\t" - << "-$(MOVE) $(TARGET) " << destdir << "\n\t" - << "-$(MOVE) $(TARGET0) " << destdir << "\n\t"; + << "-$(MOVE) $(TARGET) " << destdir << " \n\t" + << "-$(MOVE) $(TARGET0) " << destdir << " \n\t"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; @@ -635,7 +639,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t" << "$(RANLIB) $(TARGET)" << "\n"; if(!destdir.isEmpty()) t << "\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)" << "\n" - << "\t" << "-$(MOVE) $(TARGET) " << destdir << "\n"; + << "\t" << "-$(MOVE) $(TARGET) " << destdir << " \n"; } else { int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt(); ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"), @@ -666,7 +670,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t" << "$(RANLIB) " << (*libit) << "\n"; if(!destdir.isEmpty()) t << "\t" << "-$(DEL_FILE) " << destdir << (*libit) << "\n" - << "\t" << "-$(MOVE) " << (*libit) << " " << destdir << "\n"; + << "\t" << "-$(MOVE) " << (*libit) << " " << destdir << " \n"; } } t << endl << endl; -- cgit v1.2.3 From f0425e115e5fe5d29191f0752659a28e9a4b6757 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 8 Apr 2013 11:25:08 -0300 Subject: QNX: Adjust rotation according to initial orientation Task-number: QTBUG-29201 Change-Id: I37e82904e0f3d8b372b31ee7d1379e61c788c622 Reviewed-by: Thomas McGuire Reviewed-by: Kevin Krammer --- src/plugins/platforms/qnx/qqnxintegration.cpp | 1 + src/plugins/platforms/qnx/qqnxscreen.cpp | 12 ++++++++++++ src/plugins/platforms/qnx/qqnxscreen.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 5ea4fef698..4cbbfa4da8 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -486,6 +486,7 @@ void QQnxIntegration::createDisplay(screen_display_t display, bool isPrimary) QQnxScreen *screen = new QQnxScreen(m_screenContext, display, isPrimary); m_screens.append(screen); screenAdded(screen); + screen->adjustOrientation(); QObject::connect(m_screenEventHandler, SIGNAL(newWindowCreated(void*)), screen, SLOT(newWindowCreated(void*))); diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 7614abdc6a..2b81559ab6 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -498,6 +498,18 @@ void QQnxScreen::onWindowPost(QQnxWindow *window) } } +void QQnxScreen::adjustOrientation() +{ + if (!m_primaryScreen) + return; + + bool ok = false; + const int rotation = qgetenv("ORIENTATION").toInt(&ok); + + if (ok) + setRotation(rotation); +} + QPlatformCursor * QQnxScreen::cursor() const { return m_cursor; diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index 41dc675599..98f2a90fbc 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -92,6 +92,7 @@ public: void updateHierarchy(); void onWindowPost(QQnxWindow *window); + void adjustOrientation(); QSharedPointer rootWindow() const; -- cgit v1.2.3 From 2c5188f0777f4a0723b4cb9fd36354a357145519 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 9 Apr 2013 13:45:10 -0700 Subject: Don't use UNAME_MACHINE on Linux We don't need it. Let linux-g++ be the default on all Linux builds, period. Task-number: QTBUG-30590 Change-Id: I26c73bf4f054684763b64ef5651b3488363ea7a1 Reviewed-by: Oswald Buddenhagen --- configure | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/configure b/configure index f55e2f622b..6d68ed2682 100755 --- a/configure +++ b/configure @@ -2565,14 +2565,7 @@ if [ -z "$PLATFORM" ]; then " ;; Linux:*) - case "$UNAME_MACHINE" in - x86_64|s390x|ppc64) - PLATFORM=linux-g++-64 - ;; - *) - PLATFORM=linux-g++ - ;; - esac + PLATFORM=linux-g++ PLATFORM_NOTES=" - Also available for Linux: linux-kcc linux-icc linux-cxx " -- cgit v1.2.3 From b5b6d6f5fc6918d328cc99a9a0e3d63c2ab23577 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 25 Mar 2013 17:10:15 +0100 Subject: Windows: Dont use black as clear color on opengl windows Perhaps this made sense when all our open gl examples were black, but with components and I would assume the majority of use cases we should use the default window background color to fill exposed window background during a resize. Change-Id: Ia439a7c3919243efa6026e2e07bee62c25557df0 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowscontext.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 545484de8d..f2ee33d327 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -417,10 +417,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL) if (icon) cname += QStringLiteral("Icon"); - HBRUSH brush = 0; - if (!isGL) - brush = GetSysColorBrush(COLOR_WINDOW); - return registerWindowClass(cname, qWindowsWndProc, style, brush, icon); + return registerWindowClass(cname, qWindowsWndProc, style, GetSysColorBrush(COLOR_WINDOW), icon); } QString QWindowsContext::registerWindowClass(QString cname, -- cgit v1.2.3 From f29b7935087f0fcc31f29652e27a45e0b51f573d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 12:48:54 +0200 Subject: Use CMake facility for verbose makefiles instead of an env var. It should also have an effect for Visual Studio project files, not just makefile generators. Change-Id: I395071f09b29a6e8967a3d44e41d30480ae783f7 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/ctest_testcase.prf | 6 ++---- src/corelib/Qt5CTestMacros.cmake | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf index 7faf738d6e..9e24e1c6c2 100644 --- a/mkspecs/features/ctest_testcase.prf +++ b/mkspecs/features/ctest_testcase.prf @@ -53,9 +53,6 @@ isEmpty(CMAKE_VERSION) { dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST dependentmodules = $$cmakeModuleList($$dependentmodules) - SET = set - equals(QMAKE_DIR_SEP, "/"):SET = export - CMAKE_MODULE_VERSIONS = CMAKE_MODULES_UNDER_TEST = for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) { @@ -69,8 +66,9 @@ isEmpty(CMAKE_VERSION) { CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;) check.commands = \ - $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && $$SET VERBOSE=1 && \ + $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \ cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR \ + -DCMAKE_VERBOSE_MAKEFILE=1 \ $$CMAKE_MODULE_DEFINES \ -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} \ -DCMAKE_PREFIX_PATH=$$CMAKE_PREFIX_PATH \ diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index e507c8009e..ebf134f7d0 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -19,6 +19,10 @@ if (CMAKE_TOOLCHAIN_FILE) list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") endif() +if (CMAKE_VERBOSE_MAKEFILE) + list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_VERBOSE_MAKEFILE=1") +endif() + if (NO_WIDGETS) list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True") endif() -- cgit v1.2.3 From aeaab5210ff4599026fe4324956350a6ef1aeec0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 15:01:23 +0200 Subject: Generate Win64 code when testing 64bit Qt on Windows. This should fix the issue reported here: http://thread.gmane.org/gmane.comp.lib.qt.devel/10746 From: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6590/focus=6593 Change-Id: I523de5c1a89f08bd832a684fcff7c57565ebc5c9 Reviewed-by: Laszlo Papp Reviewed-by: Frederik Gladhorn --- mkspecs/features/ctest_testcase.prf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf index 9e24e1c6c2..c88fc961cf 100644 --- a/mkspecs/features/ctest_testcase.prf +++ b/mkspecs/features/ctest_testcase.prf @@ -38,6 +38,10 @@ isEmpty(CMAKE_VERSION) { CMAKE_BUILD_TYPE = Debug CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release win32-g++*:CMAKE_GENERATOR = -G \"MinGW Makefiles\" + win32:equals(QT_ARCH, x86_64) { + win32-msvc2010:CMAKE_GENERATOR = -G \"Visual Studio 10 Win64\" + win32-msvc2012:CMAKE_GENERATOR = -G \"Visual Studio 11 Win64\" + } BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP) -- cgit v1.2.3 From 9f7bc42b7d6466b8422c7cc3900a7eb3bfa60bf9 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 5 Apr 2013 16:20:15 +0300 Subject: Fix QFontconfigDatabase unable to fallback to a localized family When populating the font database, FcPatternGetString(FC_FAMILY) gets a localized font family name; but, in fallbacksForFamily, it gets a non-localized font family name, so it unable to find the proper font to fallback. Simply register all family name variants as aliases to localized name and make sure they are checked when getting fallback families. Task-number: QTBUG-28806 Task-number: QTBUG-30415 Change-Id: I71c03ae9b51a28736c2576f3442f1bbdb3497c09 Reviewed-by: Friedemann Kleint Reviewed-by: jian liang Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 20 +++++++------------- src/gui/text/qfontdatabase_qpa.cpp | 3 +-- .../fontdatabases/fontconfig/qfontconfigdatabase.cpp | 5 +++++ 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index e3270b430f..86a5bed15d 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -344,6 +344,7 @@ struct QtFontFamily bool askedForFallback; unsigned char writingSystems[QFontDatabase::WritingSystemsCount]; + bool matchesFamilyName(const QString &familyName) const; QtFontFoundry *foundry(const QString &f, bool = false); }; @@ -383,6 +384,11 @@ QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create) return foundries[count++]; } +bool QtFontFamily::matchesFamilyName(const QString &familyName) const +{ + return name.compare(familyName, Qt::CaseInsensitive) == 0 || aliases.contains(familyName, Qt::CaseInsensitive); +} + class QFontDatabasePrivate { @@ -852,19 +858,7 @@ static bool matchFamilyName(const QString &familyName, QtFontFamily *f) { if (familyName.isEmpty()) return true; - - if (f->name.compare(familyName, Qt::CaseInsensitive) == 0) - return true; - - QStringList::const_iterator it = f->aliases.constBegin(); - while (it != f->aliases.constEnd()) { - if ((*it).compare(familyName, Qt::CaseInsensitive) == 0) - return true; - - ++it; - } - - return false; + return f->matchesFamilyName(familyName); } /*! diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index be42e892fa..32580ada7a 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -110,8 +110,7 @@ static QStringList fallbackFamilies(const QString &family, QFont::Style style, Q for (i = retList.begin(); i != retList.end(); ++i) { bool contains = false; for (int j = 0; j < db->count; j++) { - QtFontFamily *qtFamily = db->families[j]; - if (!(i->compare(qtFamily->name,Qt::CaseInsensitive))) { + if (db->families[j]->matchesFamilyName(*i)) { contains = true; break; } diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 6ba71d112e..0d57b71f46 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -370,6 +370,8 @@ static bool isSymbolFont(FontFile *fontFile) return hasSymbolMap; } +Q_GUI_EXPORT void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias); + void QFontconfigDatabase::populateFontDatabase() { FcFontSet *fonts; @@ -511,6 +513,9 @@ void QFontconfigDatabase::populateFontDatabase() QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile); // qDebug() << familyName << (const char *)foundry_value << weight << style << &writingSystems << scalable << true << pixel_size; + + for (int k = 1; FcPatternGetString(fonts->fonts[i], FC_FAMILY, k, &value) == FcResultMatch; ++k) + qt_registerAliasToFontFamily(familyName, QString::fromUtf8((const char *)value)); } FcFontSetDestroy (fonts); -- cgit v1.2.3 From c0300eed194e742d3d802b742379f83018be7bfa Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 9 Apr 2013 16:02:30 +0300 Subject: QFreetypeFace: Fix getFace() uses UTF-8 paths on non UTF-8 locales QFontEngine::FaceId::filename is intended to be local8Bit-encoded but QFreetypeFace::getFace() always treats it like UTF-8-encoded. Also replace explicit (to|from)Local8Bit and toLatin FaceId::filename conversions with QFile::(en|de)codeName, where appropriate. Change-Id: Ic7beabf0a160f2f02f1667bcb8e6067adaba1c16 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft.cpp | 2 +- src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp | 2 +- src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp | 4 ++-- src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp | 2 +- src/plugins/platforms/windows/qwindowsfontengine.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 19b4411b47..10225febcb 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -232,7 +232,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id, QScopedPointer newFreetype(new QFreetypeFace); FT_Face face; if (!face_id.filename.isEmpty()) { - QString fileName = QString::fromUtf8(face_id.filename); + QString fileName = QFile::decodeName(face_id.filename); if (face_id.filename.startsWith(":qmemoryfonts/")) { // from qfontdatabase.cpp QByteArray idx = face_id.filename; diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp index 49440c8566..9b87418846 100644 --- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp @@ -123,7 +123,7 @@ QFontEngine *QBasicFontDatabase::fontEngine(const QFontDef &fontDef, QChar::Scri QFontEngineFT *engine; FontFile *fontfile = static_cast (usrPtr); QFontEngine::FaceId fid; - fid.filename = fontfile->fileName.toLocal8Bit(); + fid.filename = QFile::encodeName(fontfile->fileName); fid.index = fontfile->indexValue; engine = new QFontEngineFT(fontDef); diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 0d57b71f46..8d6f415fba 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -356,7 +356,7 @@ static bool isSymbolFont(FontFile *fontFile) return false; QFontEngine::FaceId id; - id.filename = fontFile->fileName.toLocal8Bit(); + id.filename = QFile::encodeName(fontFile->fileName); id.index = fontFile->indexValue; QFreetypeFace *f = QFreetypeFace::getFace(id); @@ -567,7 +567,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFontDef &f, QChar::Script sc QFontEngineFT *engine; FontFile *fontfile = static_cast (usrPtr); QFontEngine::FaceId fid; - fid.filename = fontfile->fileName.toLocal8Bit(); + fid.filename = QFile::encodeName(fontfile->fileName); fid.index = fontfile->indexValue; bool antialias = !(fontDef.styleStrategy & QFont::NoAntialias); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index 98b4e7af62..7f97d58be4 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -285,7 +285,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet, return false; if (!QDir::isAbsolutePath(value)) - value.prepend(QString::fromLocal8Bit(qgetenv("windir") + "\\Fonts\\")); + value.prepend(QFile::decodeName(qgetenv("windir") + "\\Fonts\\")); QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index)); diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index c402f00453..5757bcad4e 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -190,7 +190,7 @@ void QWindowsFontEngine::getCMap() unitsPerEm = otm->otmEMSquare; x_height = (int)otm->otmsXHeight; loadKerningPairs(designToDevice); - _faceId.filename = QString::fromWCharArray((wchar_t *)((char *)otm + (quintptr)otm->otmpFullName)).toLatin1(); + _faceId.filename = QFile::encodeName(QString::fromWCharArray((wchar_t *)((char *)otm + (quintptr)otm->otmpFullName))); lineWidth = otm->otmsUnderscoreSize; fsType = otm->otmfsType; free(otm); -- cgit v1.2.3 From b8cd54a92ff63b0eb063ba1282014a64d383563b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 17:49:24 +0200 Subject: Make the umbrella Qt5 CMake Config file find components only in the parent directory. Similar to 70420ec3 (Look for cmake package dependents only in the parent directory., 2013-04-02), make sure cmake only searches for sibling packages as components. Change-Id: I9e0c13dfcdba28a9fd6892828b0f509dd63e6604 Reviewed-by: Brad King Reviewed-by: Alexander Neundorf Reviewed-by: Stephen Kelly --- src/corelib/Qt5Config.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/Qt5Config.cmake.in b/src/corelib/Qt5Config.cmake.in index 408dd64496..a7e9a042e8 100644 --- a/src/corelib/Qt5Config.cmake.in +++ b/src/corelib/Qt5Config.cmake.in @@ -18,7 +18,7 @@ if (Qt5_FIND_QUIETLY) set(_Qt5_FIND_PARTS_QUIET QUIET) endif() -get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) +get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/..\" ABSOLUTE) set(_Qt5_NOTFOUND_MESSAGE) @@ -30,9 +30,9 @@ foreach(module ${Qt5_FIND_COMPONENTS}) ) if (NOT Qt5${module}_FOUND) if (Qt5_FIND_REQUIRED_${module}) - set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake\\\"\\n\") + set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\\\"\\n\") elseif(NOT Qt5_FIND_QUIETLY) - message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake\\\"\") + message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\\\"\") endif() endif() endforeach() -- cgit v1.2.3 From 1b32185a7a4d55c68d8accfa9b463dbe0d4bef57 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 17:28:27 +0200 Subject: Make qt5_use_modules find dependents only in the parent directory. Similar to 70420ec3 (Look for cmake package dependents only in the parent directory., 2013-04-02), make sure this cmake function only searches for sibling packages as dependencies. Change-Id: Icab23d333fa6a750ee262b592fae39f0ba334fee Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreMacros.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index e3115db8ee..b6124b40cd 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -215,6 +215,7 @@ function(QT5_ADD_RESOURCES outfiles ) set(${outfiles} ${${outfiles}} PARENT_SCOPE) endfunction() +set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..") if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) macro(qt5_use_modules _target _link_type) @@ -234,7 +235,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) foreach(_module ${_qt5_modules}) if (NOT Qt5${_module}_FOUND) - find_package(Qt5${_module} PATHS ${_qt5Core_install_prefix} NO_DEFAULT_PATH) + find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH) if (NOT Qt5${_module}_FOUND) message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") endif() -- cgit v1.2.3 From 26da8c34bbc7bccd61ef64a91f99896780ba6707 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 10 Apr 2013 13:37:14 +0200 Subject: Stabilize tst_qcombobox. - Remove member variable testWidget and instantiate on the stack to ensure tests do not interfere. - Move widgets away from taskbar areas. - Fix windows geometry warnings by making small windows frameless. - Fix wrong target widget for key click in keyBoardNavigationWithMouse(). Task-number: QTBUG-30573 Change-Id: I6d9fad0f212814a67367baf446750e9bed0ebdb2 Reviewed-by: Frederik Gladhorn --- .../widgets/widgets/qcombobox/tst_qcombobox.cpp | 173 +++++++++++++++------ 1 file changed, 127 insertions(+), 46 deletions(-) diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 7c468fcaed..36b83eefda 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -74,19 +74,23 @@ #include #include +static inline void setFrameless(QWidget *w) +{ + Qt::WindowFlags flags = w->windowFlags(); + flags |= Qt::FramelessWindowHint; + flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); + w->setWindowFlags(flags); +} + class tst_QComboBox : public QObject { Q_OBJECT public: - tst_QComboBox(); - ~tst_QComboBox(); + tst_QComboBox() {} public slots: - void initTestCase(); - void cleanupTestCase(); void init(); - void cleanup(); private slots: void getSetCheck(); @@ -156,11 +160,6 @@ private slots: void maxVisibleItems(); void task_QTBUG_10491_currentIndexAndModelColumn(); void highlightedSignal(); - -private: - QComboBox *testWidget; - QWidget *parent; - QPushButton* ok; }; class MyAbstractItemDelegate : public QAbstractItemDelegate @@ -373,53 +372,40 @@ typedef QList IconList; Q_DECLARE_METATYPE(QComboBox::InsertPolicy) -tst_QComboBox::tst_QComboBox() -{ - parent = 0; -} - -tst_QComboBox::~tst_QComboBox() +class TestWidget : public QWidget { -} +public: + TestWidget() : QWidget(0, Qt::Window), m_comboBox(new QComboBox(this)) + { + setObjectName("parent"); + move(200, 200); + resize(400, 400); + m_comboBox->setGeometry(0, 0, 100, 100); + m_comboBox->setObjectName("testObject"); + m_comboBox->setEditable(false); + } + QComboBox *comboBox() const { return m_comboBox; } -void tst_QComboBox::initTestCase() -{ - // Create the test class - parent = new QWidget(0, Qt::Window); - parent->setObjectName("parent"); - parent->resize(400, 400); - testWidget = new QComboBox(parent); - testWidget->setObjectName("testObject"); - testWidget->setGeometry(0, 0, 100, 100); - parent->show(); -} +private: + QComboBox *m_comboBox; -void tst_QComboBox::cleanupTestCase() -{ - delete parent; - parent = 0; -} +}; void tst_QComboBox::init() { - // all tests starts with a clean non-editable combobox - testWidget->setEditable(false); - testWidget->clear(); #ifdef Q_OS_WINCE //disable magic for WindowsCE qApp->setAutoMaximizeThreshold(-1); #endif } -void tst_QComboBox::cleanup() -{ - //nothing -} - - void tst_QComboBox::setEditable() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); // make sure we have no lineedit QVERIFY(!testWidget->lineEdit()); // test setEditable(true) @@ -442,10 +428,14 @@ void tst_QComboBox::setEditable() void tst_QComboBox::setPalette() { #ifdef Q_OS_MAC - if (testWidget->style()->inherits("QMacStyle")) { + if (QApplication::style()->inherits("QMacStyle")) { QSKIP("This test doesn't make sense for pixmap-based styles"); } #endif + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); QPalette pal = testWidget->palette(); pal.setColor(QPalette::Base, Qt::red); testWidget->setPalette(pal); @@ -477,6 +467,10 @@ void tst_QComboBox::setPalette() void tst_QComboBox::sizeAdjustPolicy() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); // test that adding new items will not change the sizehint for AdjustToContentsOnFirstShow QVERIFY(!testWidget->count()); QVERIFY(testWidget->sizeAdjustPolicy() == QComboBox::AdjustToContentsOnFirstShow); @@ -537,6 +531,10 @@ void tst_QComboBox::sizeAdjustPolicy() void tst_QComboBox::clear() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); // first non editable combobox testWidget->addItem("foo"); testWidget->addItem("bar"); @@ -711,6 +709,10 @@ void tst_QComboBox::insertPolicy() QFETCH(QString, userInput); QFETCH(QStringList, result); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->clear(); testWidget->setInsertPolicy(insertPolicy); testWidget->addItems(initialEntries); @@ -740,6 +742,10 @@ void tst_QComboBox::insertPolicy() // Apps running with valgrind are not fast enough. void tst_QComboBox::virtualAutocompletion() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->clear(); testWidget->setAutoCompletion(true); testWidget->addItem("Foo"); @@ -792,9 +798,13 @@ void tst_QComboBox::autoCompletionCaseSensitivity() { //we have put the focus because the completer //is only used when the widget actually has the focus + TestWidget topLevel; + topLevel.show(); + QComboBox *testWidget = topLevel.comboBox(); + qApp->setActiveWindow(&topLevel); testWidget->setFocus(); - qApp->setActiveWindow(testWidget); - QTRY_COMPARE(qApp->focusWidget(), (QWidget *)testWidget); + QVERIFY(QTest::qWaitForWindowActive(&topLevel)); + QCOMPARE(qApp->focusWidget(), (QWidget *)testWidget); testWidget->clear(); testWidget->setAutoCompletion(true); @@ -886,6 +896,10 @@ void tst_QComboBox::autoCompletionCaseSensitivity() void tst_QComboBox::hide() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->addItem("foo"); testWidget->showPopup(); //allow combobox effect to complete @@ -1101,6 +1115,10 @@ void tst_QComboBox::currentIndex() QFETCH(QString, expectedCurrentText); QFETCH(int, expectedSignalCount); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); // test both editable/non-editable combobox for (int edit = 0; edit < 2; ++edit) { testWidget->clear(); @@ -1196,6 +1214,10 @@ void tst_QComboBox::insertItems() QFETCH(int, insertIndex); QFETCH(int, expectedIndex); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->insertItems(0, initialItems); QCOMPARE(testWidget->count(), initialItems.count()); @@ -1234,6 +1256,10 @@ void tst_QComboBox::insertItem() QFETCH(int, expectedIndex); QFETCH(bool, editable); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->insertItems(0, initialItems); QCOMPARE(testWidget->count(), initialItems.count()); @@ -1251,6 +1277,10 @@ void tst_QComboBox::insertItem() void tst_QComboBox::insertOnCurrentIndex() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->setEditable(true); testWidget->addItem("first item"); testWidget->setCurrentIndex(0); @@ -1308,6 +1338,10 @@ void tst_QComboBox::textpixmapdata() QVERIFY(text.count() == icons.count() && text.count() == variant.count()); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); for (int i = 0; iinsertItem(i, text.at(i)); testWidget->setItemIcon(i, icons.at(i)); @@ -1333,6 +1367,10 @@ void tst_QComboBox::textpixmapdata() void tst_QComboBox::setCurrentIndex() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); QCOMPARE(testWidget->count(), 0); testWidget->addItem("foo"); testWidget->addItem("bar"); @@ -1360,6 +1398,10 @@ void tst_QComboBox::setCurrentText() { QFETCH(bool, editable); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); QCOMPARE(testWidget->count(), 0); testWidget->addItems(QStringList() << "foo" << "bar"); QCOMPARE(testWidget->count(), 2); @@ -1411,6 +1453,10 @@ void tst_QComboBox::currentTextChanged() { QFETCH(bool, editable); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); QCOMPARE(testWidget->count(), 0); testWidget->addItems(QStringList() << "foo" << "bar"); QCOMPARE(testWidget->count(), 2); @@ -1455,6 +1501,10 @@ void tst_QComboBox::currentTextChanged() void tst_QComboBox::editTextChanged() { + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); QCOMPARE(testWidget->count(), 0); testWidget->addItem("foo"); testWidget->addItem("bar"); @@ -1677,6 +1727,7 @@ public: void tst_QComboBox::ensureReturnIsIgnored() { ReturnClass r; + r.move(200, 200); r.show(); QTest::keyClick(r.edit, Qt::Key_Return); @@ -1716,6 +1767,10 @@ void tst_QComboBox::findText() QFETCH(QString, search); QFETCH(int, result); + TestWidget topLevel; + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + QComboBox *testWidget = topLevel.comboBox(); testWidget->clear(); testWidget->addItems(items); @@ -1824,6 +1879,7 @@ void tst_QComboBox::flaggedItems() QFETCH(int, expectedIndex); QComboBox comboBox; + setFrameless(&comboBox); QListWidget listWidget; listWidget.addItems(itemList); @@ -1836,6 +1892,7 @@ void tst_QComboBox::flaggedItems() comboBox.setModel(listWidget.model()); comboBox.setView(&listWidget); + comboBox.move(200, 200); comboBox.show(); QApplication::setActiveWindow(&comboBox); comboBox.activateWindow(); @@ -1987,6 +2044,8 @@ void tst_QComboBox::itemListPosition() //we test QFontComboBox because it has the specific behaviour to set a fixed size //to the list view QWidget topLevel; + topLevel.resize(200, 200); + topLevel.move(100, 100); QFontComboBox combo(&topLevel); //the code to get the available screen space is copied from QComboBox code @@ -2047,6 +2106,8 @@ void tst_QComboBox::task190351_layout() QApplication::setStyle(QStyleFactory::create(QLatin1String("Fusion"))); QComboBox listCombo; + listCombo.move(200, 200); + setFrameless(&listCombo); QListWidget *list = new QListWidget(); listCombo.setModel(list->model()); listCombo.setView(list); @@ -2111,7 +2172,10 @@ void tst_QComboBox::task191329_size() const QString oldStyle = QApplication::style()->objectName(); QApplication::setStyle(QStyleFactory::create(QLatin1String("Fusion"))); + QComboBox tableCombo; + setFrameless(&tableCombo); + tableCombo.move(200, 200); int rows; if (QApplication::desktop()->screenGeometry().height() < 480) rows = 8; @@ -2159,6 +2223,8 @@ void tst_QComboBox::task190205_setModelAdjustToContents() finalContent << "bar" << "foooooooobar"; QComboBox box; + setFrameless(&box); + box.move(100, 100); box.setSizeAdjustPolicy(QComboBox::AdjustToContents); box.addItems(initialContent); box.show(); @@ -2169,6 +2235,9 @@ void tst_QComboBox::task190205_setModelAdjustToContents() box.setModel(new QStringListModel(finalContent)); QComboBox correctBox; + setFrameless(&correctBox); + correctBox.move(400, 100); + correctBox.addItems(finalContent); correctBox.show(); @@ -2210,6 +2279,8 @@ void tst_QComboBox::task248169_popupWithMinimalSize() void tst_QComboBox::task247863_keyBoardSelection() { QComboBox combo; + setFrameless(&combo); + combo.move(200, 200); combo.setEditable(false); combo.addItem( QLatin1String("111")); combo.addItem( QLatin1String("222")); @@ -2230,6 +2301,8 @@ void tst_QComboBox::task247863_keyBoardSelection() void tst_QComboBox::task220195_keyBoardSelection2() { QComboBox combo; + setFrameless(&combo); + combo.move(200, 200); combo.setEditable(false); combo.addItem( QLatin1String("foo1")); combo.addItem( QLatin1String("foo2")); @@ -2315,6 +2388,7 @@ void tst_QComboBox::noScrollbar() QWidget topLevel; QComboBox comboBox(&topLevel); comboBox.addItems(initialContent); + topLevel.move(200, 200); topLevel.show(); comboBox.resize(200, comboBox.height()); QTRY_VERIFY(comboBox.isVisible()); @@ -2331,6 +2405,7 @@ void tst_QComboBox::noScrollbar() QComboBox comboBox; comboBox.setModel(table->model()); comboBox.setView(table); + comboBox.move(200, 200); comboBox.show(); QTRY_VERIFY(comboBox.isVisible()); comboBox.resize(200, comboBox.height()); @@ -2447,6 +2522,7 @@ void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup() QComboBox comboBox; comboBox.setStyle(&style); comboBox.addItem("Item 1"); + comboBox.move(200, 200); comboBox.show(); QTRY_VERIFY(comboBox.isVisible()); @@ -2511,8 +2587,11 @@ void tst_QComboBox::keyBoardNavigationWithMouse() { QComboBox combo; combo.setEditable(false); + setFrameless(&combo); + combo.move(200, 200); for (int i = 0; i < 80; i++) combo.addItem( QString::number(i)); + combo.show(); QApplication::setActiveWindow(&combo); QVERIFY(QTest::qWaitForWindowActive(&combo)); @@ -2523,7 +2602,7 @@ void tst_QComboBox::keyBoardNavigationWithMouse() combo.setFocus(); QTRY_VERIFY(combo.hasFocus()); - QTest::keyClick(testWidget->lineEdit(), Qt::Key_Space); + QTest::keyClick(combo.lineEdit(), Qt::Key_Space); QTest::qWait(30); QTRY_VERIFY(combo.view()); QTRY_VERIFY(combo.view()->isVisible()); @@ -2568,6 +2647,7 @@ void tst_QComboBox::keyBoardNavigationWithMouse() void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated() { QWidget w; + w.move(200, 200); QVBoxLayout layout(&w); QComboBox cb; cb.setEditable(true); @@ -2603,6 +2683,7 @@ void tst_QComboBox::maxVisibleItems() content += QString::number(i); comboBox.addItems(content); + comboBox.move(200, 200); comboBox.show(); comboBox.resize(200, comboBox.height()); QTRY_VERIFY(comboBox.isVisible()); -- cgit v1.2.3 From 0b12cf613f855278c6fb6fefbdcd05ff6948a5e0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 9 Apr 2013 11:09:43 +0200 Subject: QVector: Fix signedness warning in assert. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-30331 Change-Id: I91b346b36162e8146a05babd24afa4bfb7259bec Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qvector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index a06fb7b4eb..816e1f15f6 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -493,7 +493,7 @@ void QVector::reallocData(const int asize, const int aalloc, QArrayData::Allo } x->capacityReserved = d->capacityReserved; } else { - Q_ASSERT(d->alloc == aalloc); // resize, without changing allocation size + Q_ASSERT(int(d->alloc) == aalloc); // resize, without changing allocation size Q_ASSERT(isDetached()); // can be done only on detached d Q_ASSERT(x == d); // in this case we do not need to allocate anything if (asize <= d->size) { -- cgit v1.2.3 From 3a3e9b74ebdeef6a1bfcf87a47a23d12ad471105 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Wed, 10 Apr 2013 12:03:39 +0200 Subject: Do not show the warning if queryAI() returns an invalid interface. We should only warn about missing a11y plugins if iface is 0, since we obviously have the plugin otherwise. This got triggered by that a visible widget got destructed, which in turn called hide(), which ultimately ended up calling QAccessible::updateAccessibility(QAccessible::ObjectHide). When QAccessibleEvent::accessibleInterface() then called queryAccessibleInterface(), QAI::isValid() would return false because the widget was in its destructor. Change-Id: If655e00e7bb3737a39e24e26dbd1e23edd515bf5 Reviewed-by: Friedemann Kleint Reviewed-by: Frederik Gladhorn --- src/gui/accessible/qaccessible.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 7487aabde5..4fd595ed5a 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -1507,7 +1507,7 @@ QAccessibleInterface *QAccessibleEvent::accessibleInterface() const QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object); if (!iface || !iface->isValid()) { static bool hasWarned = false; - if (!hasWarned) { + if (!iface && !hasWarned) { qWarning() << "Problem creating accessible interface for: " << m_object << endl << "Make sure to deploy Qt with accessibility plugins."; hasWarned = true; -- cgit v1.2.3 From ac4474900c59d6d17d12f10dae154117af757b46 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 15 Mar 2013 14:55:46 +0100 Subject: Call QString::normalized when it is constructed via the native API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a string comes from the native APIs then it may need to be normalized. Task-number: QTBUG-14787 Change-Id: I5164e80efcd1d99a50263c72bcf97d7fb31b38f7 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 1e9acd79ed..7093d27efe 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -211,7 +211,7 @@ static QString strippedText(QString s) - (void)closePanel { - *mCurrentSelection = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]); + *mCurrentSelection = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]).normalized(QString::NormalizationForm_C); if ([mSavePanel respondsToSelector:@selector(close)]) [mSavePanel close]; if ([mSavePanel isSheet]) @@ -376,11 +376,11 @@ static QString strippedText(QString s) QStringList result; NSArray* array = [mOpenPanel URLs]; for (NSUInteger i=0; i<[array count]; ++i) - result << QCFString::toQString([[array objectAtIndex:i] path]); + result << QCFString::toQString([[array objectAtIndex:i] path]).normalized(QString::NormalizationForm_C); return result; } else { QStringList result; - QString filename = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]); + QString filename = QT_PREPEND_NAMESPACE(QCFString::toQString)([[mSavePanel URL] path]).normalized(QString::NormalizationForm_C); result << filename.remove(QLatin1String("___qt_very_unlikely_prefix_")); return result; } @@ -586,7 +586,7 @@ QString QCocoaFileDialogHelper::directory() const { QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast(mDelegate); if (delegate) - return QCFString::toQString([[delegate->mSavePanel directoryURL] path]); + return QCFString::toQString([[delegate->mSavePanel directoryURL] path]).normalized(QString::NormalizationForm_C); return QString(); } -- cgit v1.2.3 From dd567c68825e32f10f5079bc85e62384389aca16 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 10 Apr 2013 07:55:46 +0200 Subject: Write two missing linker options to the vcxproj file Both the /NXCOMPAT and /DYNAMICBASE options were handled by qmake but never written to the vcxproj file even if they were set in the pro file. Change-Id: I4ca26fb312648944c25d3a24cdc8c640c9de619d Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_objectmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 2a9e657304..6fdd2f4bd2 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -87,6 +87,7 @@ const char _CompileOnly[] = "CompileOnly"; const char _ConfigurationType[] = "ConfigurationType"; const char _Culture[] = "Culture"; const char _DLLDataFileName[] = "DLLDataFileName"; +const char _DataExecutionPrevention[] = "DataExecutionPrevention"; const char _DebugInformationFormat[] = "DebugInformationFormat"; const char _DefaultCharIsUnsigned[] = "DefaultCharIsUnsigned"; const char _DefaultCharType[] = "DefaultCharType"; @@ -179,6 +180,7 @@ const char _ProgramDatabase[] = "ProgramDatabase"; const char _ProgramDataBaseFileName[] = "ProgramDataBaseFileName"; const char _ProgramDatabaseFile[] = "ProgramDatabaseFile"; const char _ProxyFileName[] = "ProxyFileName"; +const char _RandomizedBaseAddress[] = "RandomizedBaseAddress"; const char _RedirectOutputAndErrors[] = "RedirectOutputAndErrors"; const char _RegisterOutput[] = "RegisterOutput"; const char _RelativePath[] = "RelativePath"; @@ -2560,6 +2562,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool) << attrX(_AdditionalOptions, tool.AdditionalOptions, " ") << attrX(_AddModuleNamesToAssembly, tool.AddModuleNamesToAssembly) << attrS(_BaseAddress, tool.BaseAddress) + << attrT(_DataExecutionPrevention, tool.DataExecutionPrevention) << attrX(_DelayLoadDLLs, tool.DelayLoadDLLs) << attrE(_EnableCOMDATFolding, tool.EnableCOMDATFolding, /*ifNot*/ optFoldingDefault) << attrS(_EntryPointSymbol, tool.EntryPointSymbol) @@ -2590,6 +2593,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool) << attrE(_OptimizeReferences, tool.OptimizeReferences, /*ifNot*/ optReferencesDefault) << attrS(_OutputFile, tool.OutputFile) << attr(_ProgramDatabaseFile, tool.ProgramDatabaseFile) + << attrT(_RandomizedBaseAddress, tool.RandomizedBaseAddress) << attrT(_RegisterOutput, tool.RegisterOutput) << attrT(_ResourceOnlyDLL, tool.ResourceOnlyDLL) << attrT(_SetChecksum, tool.SetChecksum) -- cgit v1.2.3 From 6823f43bbcad6ed888b5138761ec4c37d7bc1905 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 10 Apr 2013 10:17:30 +0200 Subject: Android: Remove qdevice.pri warning in configure step Use the appropriate way to load the .pri file which also checks for its existence before loading it. Change-Id: I7d36da1593bb7fa1b5f6fd4d10b69e20c6aaa836 Reviewed-by: Oswald Buddenhagen --- mkspecs/android-g++/qmake.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf index e12bb03560..c780e2f0d5 100644 --- a/mkspecs/android-g++/qmake.conf +++ b/mkspecs/android-g++/qmake.conf @@ -6,10 +6,11 @@ QMAKE_COMPILER = gcc CONFIG += android_install DEFINES += QT_NO_PRINTDIALOG -include(../qdevice.pri) include(../common/linux.conf) include(../common/gcc-base-unix.conf) +load(device_config) + # Passing in -win32 to qmake (from NQTC) causes this condition to pass, however # qmake complains that -win32 is deprecated; should find another way, Q_OS_WIN # should really be all QMAKE_HOST.os needs to depend on? -- cgit v1.2.3 From d6d2f60137861b40b65d29f979968c82e53b7c36 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 11 Apr 2013 11:18:38 +0200 Subject: Minimize the contents of the INTERFACE_INCLUDE_DIRECTORIES The property only needs to contain the direct include dirs of a target. For example, Qt5::Gui does not need to contain the include/QtCore directory because it already has Qt5::Core in its LINK_INTERFACE_LIBRARIES. Change-Id: I69612f42c29e6056b3d15399498d041d43a0dd6b Reviewed-by: Brad King Reviewed-by: Stephen Kelly --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 65ba03d44c..d88f6e1224 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -45,22 +45,23 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !no_module_headers !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) - set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\") + set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\") set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}/$${MODULE_INCNAME}\" ) !!ELSE - set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\") + set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\") set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}\" \"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}/$${MODULE_INCNAME}\" ) !!ENDIF !!ELSE - set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS) + set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS) set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) !!ENDIF + set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS}) set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE}) set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINE}) @@ -122,7 +123,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!ENDIF set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS}) + INTERFACE_INCLUDE_DIRECTORIES ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS}) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE}) -- cgit v1.2.3 From 6acbe287fbe690c5b31dc49e60ede8240fd63ed0 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Wed, 10 Apr 2013 22:02:10 +0200 Subject: INSTALL: Fix URL of Installing Qt documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also removing qt-embedded-install.html link because it doesn't exist anymore and it references to a non-existing html page. Change-Id: Iad9bad20544cf6398c096a4df7662abdf5be5644 Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- INSTALL | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/INSTALL b/INSTALL index 5004e75947..400f6fab14 100644 --- a/INSTALL +++ b/INSTALL @@ -1,12 +1,10 @@ INSTALLING Qt Source Package Version %VERSION%. For full installation instructions for each supported platform, please -see http://qt-project.org/doc/qt-%SHORTVERSION%/installation.html, the file -doc/html/installation.html in this package, or follow one of the following -links: +see http://qt-project.org/doc/qt-%SHORTVERSION%/qtdoc/installation.html, +or follow one of these links: -Embedded Linux: http://qt-project.org/doc/qt-%SHORTVERSION%/qt-embedded-install.html -Mac OS X: http://qt-project.org/doc/qt-%SHORTVERSION%/install-mac.html -Windows: http://qt-project.org/doc/qt-%SHORTVERSION%/install-win.html -Windows CE: http://qt-project.org/doc/qt-%SHORTVERSION%/install-wince.html -X11 Platforms: http://qt-project.org/doc/qt-%SHORTVERSION%/install-x11.html +Mac OS X: http://qt-project.org/doc/qt-%SHORTVERSION%/qtdoc/install-mac.html +Windows: http://qt-project.org/doc/qt-%SHORTVERSION%/qtdoc/install-win.html +Windows CE: http://qt-project.org/doc/qt-%SHORTVERSION%/qtdoc/install-wince.html +X11 Platforms: http://qt-project.org/doc/qt-%SHORTVERSION%/qtdoc/install-x11.html -- cgit v1.2.3 From e81446141fe40e8c83b15bcb37a1a4fc6ac7948f Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 11 Apr 2013 20:43:42 +1000 Subject: ANGLE: Use rtti_off in CONFIG only for release ANGLE uses dynamic_cast in debug.h for debug builds which require RTTI. Change-Id: I0e2fea7ed751dc87624d7e76d179023accb9c126 Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint --- src/angle/src/config.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri index 923a40597e..465bcf6a1e 100644 --- a/src/angle/src/config.pri +++ b/src/angle/src/config.pri @@ -54,12 +54,13 @@ angle_d3d11 { CONFIG(debug, debug|release) { DEFINES += _DEBUG } else { + CONFIG += rtti_off DEFINES += NDEBUG } # c++11 is needed by MinGW to get support for unordered_map. CONFIG -= qt -CONFIG += stl rtti_off exceptions c++11 +CONFIG += stl exceptions c++11 contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release contains(QT_CONFIG, build_all):CONFIG += build_all -- cgit v1.2.3 From e9760f1559361c39f269fb89f1ebd01f6ee8378d Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Mon, 11 Mar 2013 14:41:52 +0100 Subject: Fix the check if mouse events should be synthesized from touch events In QGuiApplication only Qt::AA_SynthesizeMouseForUnhandledTouchEvents is taken into account when synthesizing mouse from touch events, in QApplication only the PlatformIntegration syle hint QPlatformIntegration::SynthesizeMouseFromTouchEvents. With this patch both attributes are checked. Furthermore the check was moved out of translateTouchToMouse in QApplication in order not to influence the result which is returned to the user, when mouse events are not be synthesized. Change-Id: I87ac7299f0a9fbf0a083eff9c547f0dbfab75dfb Reviewed-by: Fabian Bumberger Reviewed-by: Shawn Rutledge --- src/gui/kernel/qguiapplication.cpp | 8 +++++++- src/gui/kernel/qguiapplication_p.h | 2 ++ src/widgets/kernel/qapplication.cpp | 8 ++------ tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 6 ++++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c2e19ca2a8..432929fec5 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -602,6 +602,12 @@ bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blocking return false; } +bool QGuiApplicationPrivate::synthesizeMouseFromTouchEventsEnabled() +{ + return QCoreApplication::testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents) + && QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool(); +} + /*! Returns the QWindow that receives events tied to focus, such as key events. @@ -2054,7 +2060,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To } QGuiApplication::sendSpontaneousEvent(w, &touchEvent); - if (!e->synthetic && !touchEvent.isAccepted() && qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)) { + if (!e->synthetic && !touchEvent.isAccepted() && synthesizeMouseFromTouchEventsEnabled()) { // exclude touchpads as those generate their own mouse events if (touchEvent.device()->type() != QTouchDevice::TouchPad) { Qt::MouseButtons b = eventType == QEvent::TouchEnd ? Qt::NoButton : Qt::LeftButton; diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 22d95b2121..376890ef47 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -191,6 +191,8 @@ public: static void updateBlockedStatus(QWindow *window); virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const; + static bool synthesizeMouseFromTouchEventsEnabled(); + static Qt::MouseButtons buttons; static ulong mousePressTime; static Qt::MouseButton mousePressButton; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index ac25d3ed7f..02fcfde59e 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3210,7 +3210,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) res = acceptTouchEvents && d->notify_helper(widget, touchEvent); // If the touch event wasn't accepted, synthesize a mouse event and see if the widget wants it. - if (!touchEvent->isAccepted()) + if (!touchEvent->isAccepted() && QGuiApplicationPrivate::synthesizeMouseFromTouchEventsEnabled()) res = d->translateTouchToMouse(widget, touchEvent); break; } @@ -3237,7 +3237,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) res = acceptTouchEvents && d->notify_helper(widget, touchEvent); // If the touch event wasn't accepted, synthesize a mouse event and see if the widget wants it. - if (!touchEvent->isAccepted()) { + if (!touchEvent->isAccepted() && QGuiApplicationPrivate::synthesizeMouseFromTouchEventsEnabled()) { res = d->translateTouchToMouse(widget, touchEvent); eventAccepted = touchEvent->isAccepted(); if (eventAccepted) @@ -3801,10 +3801,6 @@ private: bool QApplicationPrivate::translateTouchToMouse(QWidget *widget, QTouchEvent *event) { - // Check if the platform wants synthesized mouse events. - if (!QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool()) - return false; - Q_FOREACH (const QTouchEvent::TouchPoint &p, event->touchPoints()) { const QEvent::Type eventType = (p.state() & Qt::TouchPointPressed) ? QEvent::MouseButtonPress : (p.state() & Qt::TouchPointReleased) ? QEvent::MouseButtonRelease diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index b67920737e..29c72cc02e 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -41,6 +41,8 @@ #include #include +#include +#include #include @@ -484,6 +486,8 @@ void tst_QWindow::testInputEvents() void tst_QWindow::touchToMouseTranslation() { + if (!QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool()) + QSKIP("Mouse events are synthesized by the system on this platform."); InputTestWindow window; window.ignoreTouch = true; window.setGeometry(80, 80, 40, 40); @@ -684,6 +688,8 @@ void tst_QWindow::touchCancel() void tst_QWindow::touchCancelWithTouchToMouse() { + if (!QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool()) + QSKIP("Mouse events are synthesized by the system on this platform."); InputTestWindow window; window.ignoreTouch = true; window.setGeometry(80, 80, 40, 40); -- cgit v1.2.3 From 6a11dd166985d7804b6861662193093aa84cdd0c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 21 Mar 2013 14:22:46 -0700 Subject: Remove unused private members [tools] Apple Clang 4.2 caught private members that aren't used in a class with no friends. Since this code is in a tool, there's no binary compatibility requirement. databaseinfo.h:71:13: error: private field 'driver' is not used [-Werror,-Wunused-private-field] quoter.h:86:10: error: private field 'validRegExp' is not used [-Werror,-Wunused-private-field] qmlvisitor.h:123:11: error: private field 'tree' is not used [-Werror,-Wunused-private-field] Change-Id: Iba9995f28ddef983c9ffc1dc551f042539252704 Reviewed-by: Alan Alpert Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/tools/qdoc/qmlvisitor.h | 1 - src/tools/qdoc/quoter.h | 1 - src/tools/uic/databaseinfo.cpp | 3 +-- src/tools/uic/databaseinfo.h | 3 +-- src/tools/uic/uic.cpp | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h index cc00ccbe6c..2c3ff341d6 100644 --- a/src/tools/qdoc/qmlvisitor.h +++ b/src/tools/qdoc/qmlvisitor.h @@ -120,7 +120,6 @@ private: QSet commands; QSet topics; QSet usedComments; - Tree *tree; InnerNode *current; }; diff --git a/src/tools/qdoc/quoter.h b/src/tools/qdoc/quoter.h index 223fdd96b3..622e225421 100644 --- a/src/tools/qdoc/quoter.h +++ b/src/tools/qdoc/quoter.h @@ -83,7 +83,6 @@ private: int unindent = 0); bool silent; - bool validRegExp; QStringList plainLines; QStringList markedLines; Location codeLocation; diff --git a/src/tools/uic/databaseinfo.cpp b/src/tools/uic/databaseinfo.cpp index 9832f332db..a052cdf55a 100644 --- a/src/tools/uic/databaseinfo.cpp +++ b/src/tools/uic/databaseinfo.cpp @@ -46,8 +46,7 @@ QT_BEGIN_NAMESPACE -DatabaseInfo::DatabaseInfo(Driver *drv) - : driver(drv) +DatabaseInfo::DatabaseInfo() { } diff --git a/src/tools/uic/databaseinfo.h b/src/tools/uic/databaseinfo.h index 043407d4f7..db60a1b0ff 100644 --- a/src/tools/uic/databaseinfo.h +++ b/src/tools/uic/databaseinfo.h @@ -53,7 +53,7 @@ class Driver; class DatabaseInfo : public TreeWalker { public: - DatabaseInfo(Driver *driver); + DatabaseInfo(); void acceptUI(DomUI *node); void acceptWidget(DomWidget *node); @@ -68,7 +68,6 @@ public: { return m_fields.value(connection); } private: - Driver *driver; QStringList m_connections; QMap m_cursors; QMap m_fields; diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp index 1afa19b321..be4df64696 100644 --- a/src/tools/uic/uic.cpp +++ b/src/tools/uic/uic.cpp @@ -67,7 +67,6 @@ Uic::Uic(Driver *d) : drv(d), out(d->output()), opt(d->option()), - info(d), externalPix(true) { } -- cgit v1.2.3 From 89e6183a197f4745ef934395cfa51067107d5dc5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 23:41:42 +0200 Subject: Only test cmake module versions if available for test. The expected versions are only set if the cmake tests are set up by qmake by running qmake && make check If instead someone uses cmake directly: mkdir build && cd build && cmake .. && ctest the expected versions are not known, and the test fails without this patch. So, don't test the versions if they are not known. Change-Id: I2e8a4f651a69a8817c819d881be75ca07bc1bfd4 Reviewed-by: Stephen Kelly --- src/corelib/Qt5CTestMacros.cmake | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index ebf134f7d0..126a348b47 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -114,24 +114,29 @@ function(test_module_includes) "${packages_string} find_package(Qt5${qtmodule} 5.0.0 REQUIRED) include_directories(\${Qt5${qtmodule}_INCLUDE_DIRS}) - add_definitions(\${Qt5${qtmodule}_DEFINITIONS}) - - if(NOT \"\${Qt5${qtmodule}_VERSION}\" VERSION_EQUAL ${CMAKE_MODULE_VERSION}) - message(SEND_ERROR \"Qt5${qtmodule}_VERSION variable was not ${CMAKE_MODULE_VERSION}. Got \${Qt5${qtmodule}_VERSION} instead.\") - endif() - if(NOT \"\${Qt5${qtmodule}_VERSION_MAJOR}\" VERSION_EQUAL ${CMAKE_${qtmodule}_MODULE_MAJOR_VERSION}) - message(SEND_ERROR \"Qt5${qtmodule}_VERSION_MAJOR variable was not ${CMAKE_${qtmodule}_MODULE_MAJOR_VERSION}. Got \${Qt5${qtmodule}_VERSION_MAJOR} instead.\") - endif() - if(NOT \"\${Qt5${qtmodule}_VERSION_MINOR}\" VERSION_EQUAL ${CMAKE_${qtmodule}_MODULE_MINOR_VERSION}) - message(SEND_ERROR \"Qt5${qtmodule}_VERSION_MINOR variable was not ${CMAKE_${qtmodule}_MODULE_MINOR_VERSION}. Got \${Qt5${qtmodule}_VERSION_MINOR} instead.\") - endif() - if(NOT \"\${Qt5${qtmodule}_VERSION_PATCH}\" VERSION_EQUAL ${CMAKE_${qtmodule}_MODULE_PATCH_VERSION}) - message(SEND_ERROR \"Qt5${qtmodule}_VERSION_PATCH variable was not ${CMAKE_${qtmodule}_MODULE_PATCH_VERSION}. Got \${Qt5${qtmodule}_VERSION_PATCH} instead.\") - endif() - if(NOT \"\${Qt5${qtmodule}_VERSION_STRING}\" VERSION_EQUAL ${CMAKE_MODULE_VERSION}) - message(SEND_ERROR \"Qt5${qtmodule}_VERSION_STRING variable was not ${CMAKE_MODULE_VERSION}. Got \${Qt5${qtmodule}_VERSION_STRING} instead.\") - endif()\n" - ) + add_definitions(\${Qt5${qtmodule}_DEFINITIONS})\n") + + list(FIND CMAKE_MODULES_UNDER_TEST ${qtmodule} _findIndex) + if (NOT _findIndex STREQUAL -1) + set(packages_string + "${packages_string} + if(NOT \"\${Qt5${qtmodule}_VERSION}\" VERSION_EQUAL ${CMAKE_MODULE_VERSION}) + message(SEND_ERROR \"Qt5${qtmodule}_VERSION variable was not ${CMAKE_MODULE_VERSION}. Got \${Qt5${qtmodule}_VERSION} instead.\") + endif() + if(NOT \"\${Qt5${qtmodule}_VERSION_MAJOR}\" VERSION_EQUAL ${CMAKE_${qtmodule}_MODULE_MAJOR_VERSION}) + message(SEND_ERROR \"Qt5${qtmodule}_VERSION_MAJOR variable was not ${CMAKE_${qtmodule}_MODULE_MAJOR_VERSION}. Got \${Qt5${qtmodule}_VERSION_MAJOR} instead.\") + endif() + if(NOT \"\${Qt5${qtmodule}_VERSION_MINOR}\" VERSION_EQUAL ${CMAKE_${qtmodule}_MODULE_MINOR_VERSION}) + message(SEND_ERROR \"Qt5${qtmodule}_VERSION_MINOR variable was not ${CMAKE_${qtmodule}_MODULE_MINOR_VERSION}. Got \${Qt5${qtmodule}_VERSION_MINOR} instead.\") + endif() + if(NOT \"\${Qt5${qtmodule}_VERSION_PATCH}\" VERSION_EQUAL ${CMAKE_${qtmodule}_MODULE_PATCH_VERSION}) + message(SEND_ERROR \"Qt5${qtmodule}_VERSION_PATCH variable was not ${CMAKE_${qtmodule}_MODULE_PATCH_VERSION}. Got \${Qt5${qtmodule}_VERSION_PATCH} instead.\") + endif() + if(NOT \"\${Qt5${qtmodule}_VERSION_STRING}\" VERSION_EQUAL ${CMAKE_MODULE_VERSION}) + message(SEND_ERROR \"Qt5${qtmodule}_VERSION_STRING variable was not ${CMAKE_MODULE_VERSION}. Got \${Qt5${qtmodule}_VERSION_STRING} instead.\") + endif()\n" + ) + endif() set(libraries_string "${libraries_string} Qt5::${qtmodule}") endwhile() -- cgit v1.2.3 From fc06df5c77e9ea08a3b2572f048e47fb7865954a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 10 Apr 2013 23:59:03 +0200 Subject: Warn if mouse event occurs outside target window in tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This class of bug seems to occur in 'flaky' CI tests, so give more information about what the problem is. Found here: https://codereview.qt-project.org/#change,44210 Change-Id: I73908e309bdecf1fd3bc323dd4e8febe47c1239a Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Stephen Kelly --- src/testlib/qtestmouse.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h index ea57ac5b8c..4d70aff27e 100644 --- a/src/testlib/qtestmouse.h +++ b/src/testlib/qtestmouse.h @@ -84,6 +84,9 @@ namespace QTest QTEST_ASSERT(window); extern int Q_TESTLIB_EXPORT defaultMouseDelay(); + if (!window->geometry().contains(pos)) + QTest::qWarn("Mouse event occurs outside of target window."); + static Qt::MouseButton lastButton = Qt::NoButton; if (delay == -1 || delay < defaultMouseDelay()) -- cgit v1.2.3 From 289120f8dd25ff8b04331187dccc30b2bf88eedb Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 18 Mar 2013 16:19:17 +0100 Subject: Enable qDebug to console when desired on Android. Change-Id: I91906c5fc2a5b406f416c296c124a01795e69b8a Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/global/qlogging.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index f95e1e9447..c8293beb4e 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -876,7 +876,13 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con #if defined(QT_USE_SLOG2) slog2_default_handler(type, logMessage.toLocal8Bit().constData()); #elif defined(Q_OS_ANDROID) - android_default_message_handler(type, context, logMessage); + static bool logToAndroid = qEnvironmentVariableIsEmpty("QT_ANDROID_PLAIN_LOG"); + if (logToAndroid) { + android_default_message_handler(type, context, logMessage); + } else { + fprintf(stderr, "%s", logMessage.toLocal8Bit().constData()); + fflush(stderr); + } #else fprintf(stderr, "%s", logMessage.toLocal8Bit().constData()); fflush(stderr); -- cgit v1.2.3 From b3dae6848dfbc46e5574a5289ea44019eb2dafd7 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 7 Apr 2013 16:29:22 +0300 Subject: Fix leaking of QFontEngineData QFontCache now references QFontEngineData-s it maintains, so that QFont instances not freed prior to calling ~QFontCache() would destroy QFontEngineData on their own. Task-number: QTBUG-25434 Change-Id: Ia7679d64de436841f09ac7be62ceb570e50cce5b Reviewed-by: Friedemann Kleint Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: jian liang --- src/gui/text/qfont.cpp | 23 ++++++++++++++--------- src/gui/text/qfont_p.h | 3 +++ src/gui/text/qfontdatabase.cpp | 3 +-- tests/auto/gui/text/qfont/tst_qfont.cpp | 11 +++++++---- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index fc694dc497..1d6cf3ceca 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -191,8 +191,8 @@ QFontPrivate::QFontPrivate(const QFontPrivate &other) QFontPrivate::~QFontPrivate() { - if (engineData) - engineData->ref.deref(); + if (engineData && !engineData->ref.deref()) + delete engineData; engineData = 0; if (scFont && scFont != this) scFont->ref.deref(); @@ -210,7 +210,8 @@ QFontEngine *QFontPrivate::engineForScript(int script) const script = QChar::Script_Common; if (engineData && engineData->fontCache != QFontCache::instance()) { // throw out engineData that came from a different thread - engineData->ref.deref(); + if (!engineData->ref.deref()) + delete engineData; engineData = 0; } if (!engineData || !QT_FONT_ENGINE_FROM_DATA(engineData, script)) @@ -316,13 +317,14 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other) QFontEngineData::QFontEngineData() - : ref(1), fontCache(QFontCache::instance()) + : ref(0), fontCache(QFontCache::instance()) { memset(engines, 0, QChar::ScriptCount * sizeof(QFontEngine *)); } QFontEngineData::~QFontEngineData() { + Q_ASSERT(ref.load() == 0); for (int i = 0; i < QChar::ScriptCount; ++i) { if (engines[i]) { if (!engines[i]->ref.deref()) @@ -637,8 +639,8 @@ QFont::QFont(QFontPrivate *data) void QFont::detach() { if (d->ref.load() == 1) { - if (d->engineData) - d->engineData->ref.deref(); + if (d->engineData && !d->engineData->ref.deref()) + delete d->engineData; d->engineData = 0; if (d->scFont && d->scFont != d.data()) d->scFont->ref.deref(); @@ -2641,7 +2643,7 @@ QFontCache::~QFontCache() EngineDataCache::ConstIterator it = engineDataCache.constBegin(), end = engineDataCache.constEnd(); while (it != end) { - if (it.value()->ref.load() == 0) + if (!it.value()->ref.deref()) delete it.value(); else FC_DEBUG("QFontCache::~QFontCache: engineData %p still has refcount %d", @@ -2713,7 +2715,9 @@ void QFontCache::insertEngineData(const QFontDef &def, QFontEngineData *engineDa def.pixelSize, def.weight, def.style, def.fixedPitch); } #endif + Q_ASSERT(!engineDataCache.contains(def)); + engineData->ref.ref(); engineDataCache.insert(def, engineData); increaseCost(sizeof(QFontEngineData)); } @@ -2829,7 +2833,7 @@ void QFontCache::timerEvent(QTimerEvent *) for (; it != end; ++it) { FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref.load())); - if (it.value()->ref.load() != 0) + if (it.value()->ref.load() != 1) in_use_cost += engine_data_cost; } } @@ -2894,9 +2898,10 @@ void QFontCache::timerEvent(QTimerEvent *) // clean out all unused engine data EngineDataCache::Iterator it = engineDataCache.begin(); while (it != engineDataCache.end()) { - if (it.value()->ref.load() == 0) { + if (it.value()->ref.load() == 1) { FC_DEBUG(" %p", it.value()); decreaseCost(sizeof(QFontEngineData)); + it.value()->ref.deref(); delete it.value(); it = engineDataCache.erase(it); } else { diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index 4cbf51d59c..115e866f24 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -143,6 +143,9 @@ public: QFontCache *fontCache; QFontEngine *engines[QChar::ScriptCount]; + +private: + Q_DISABLE_COPY(QFontEngineData) }; diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 86a5bed15d..62379cd592 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -619,9 +619,8 @@ static void getEngineData(const QFontPrivate *d, const QFontDef &def) // create a new one d->engineData = new QFontEngineData; QFontCache::instance()->insertEngineData(def, d->engineData); - } else { - d->engineData->ref.ref(); } + d->engineData->ref.ref(); } static QStringList familyList(const QFontDef &req) diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 0162c467d4..b8cce2671f 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -690,33 +690,36 @@ void tst_QFont::defaultFamily() void tst_QFont::sharing() { + // QFontCache references the engineData + int refs_by_cache = 1; + QFont f; f.setStyleHint(QFont::Serif); f.exactMatch(); // loads engine QCOMPARE(QFontPrivate::get(f)->ref.load(), 1); QVERIFY(QFontPrivate::get(f)->engineData); - QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1); + QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1 + refs_by_cache); QFont f2(f); QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2); QVERIFY(QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData); - QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1); + QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache); f2.setKerning(!f.kerning()); QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1); QVERIFY(QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData); - QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2); + QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2 + refs_by_cache); f2 = f; QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f)); QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2); QVERIFY(QFontPrivate::get(f2)->engineData); QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData); - QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1); + QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache); if (f.pointSize() > 0) f2.setPointSize(f.pointSize() * 2 / 3); -- cgit v1.2.3 From 4bb76df7f70a2050505a18efe9e6dfaa8ba61b11 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Fri, 22 Mar 2013 13:33:06 +0800 Subject: tst_qdataurl: Remove QT_DISABLE_DEPRECATED_BEFORE=0 Change-Id: I6f2e45bbc6d31cac4d9b8c735650f7985865109c Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp b/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp index d588373034..5a64c5963f 100644 --- a/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp +++ b/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp @@ -39,8 +39,6 @@ ** ****************************************************************************/ -#define QT_DEPRECATED -#define QT_DISABLE_DEPRECATED_BEFORE 0 #include "private/qdataurl_p.h" #include #include -- cgit v1.2.3 From 5c2a8899e135c29895d1f6237b494b9833d3a857 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Fri, 22 Mar 2013 13:34:30 +0800 Subject: tst_qcoreapplication: Remove QT_DISABLE_DEPRECATED_BEFORE=0 Change-Id: I6d5098ff57293171b5ddd3a58c53718cbbc8e4bf Reviewed-by: Thiago Macieira --- tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro | 1 - tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro index 9ab494d3d5..14df20c986 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro +++ b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro @@ -2,4 +2,3 @@ CONFIG += testcase parallel_test TARGET = tst_qcoreapplication QT = core testlib core-private SOURCES = tst_qcoreapplication.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp index 10c00e2a67..ff1d8b2a36 100644 --- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp @@ -643,7 +643,7 @@ void tst_QCoreApplication::customEventDispatcher() QCOMPARE(QCoreApplication::eventDispatcher(), ed); // test the alternative API of QAbstractEventDispatcher QCOMPARE(QAbstractEventDispatcher::instance(), ed); - QWeakPointer weak_ed(ed); + QPointer weak_ed(ed); QVERIFY(!weak_ed.isNull()); { int argc = 1; -- cgit v1.2.3 From 6a50270013a24185e6900c72bbfe043418cec138 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Fri, 22 Mar 2013 13:35:38 +0800 Subject: tst_qtranslator: Remove QT_DISABLE_DEPRECATED_BEFORE=0 Change-Id: Iefd8ce56b7102b5a6a656df7dbea2cd344bb9b5d Reviewed-by: Thiago Macieira --- tests/auto/corelib/kernel/qtranslator/qtranslator.pro | 1 - tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro index 7734b0d519..41c3dea924 100644 --- a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro +++ b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro @@ -5,4 +5,3 @@ SOURCES = tst_qtranslator.cpp RESOURCES += qtranslator.qrc TESTDATA += hellotr_la.qm msgfmt_from_po.qm -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index 9b22ebc1e8..5818077e3d 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -200,10 +200,9 @@ void tst_QTranslator::plural() tor.load("hellotr_la"); QVERIFY(!tor.isEmpty()); QCoreApplication::installTranslator(&tor); - QCoreApplication::Encoding e = QCoreApplication::UnicodeUTF8; - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, e, 0), QString::fromLatin1("Hallo 0 Welten!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, e, 1), QString::fromLatin1("Hallo 1 Welt!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, e, 2), QString::fromLatin1("Hallo 2 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0), QString::fromLatin1("Hallo 0 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 1), QString::fromLatin1("Hallo 1 Welt!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 2), QString::fromLatin1("Hallo 2 Welten!")); } void tst_QTranslator::translate_qm_file_generated_with_msgfmt() @@ -253,10 +252,9 @@ void tst_QTranslator::dependencies() // plural QCoreApplication::installTranslator(&tor); - QCoreApplication::Encoding e = QCoreApplication::UnicodeUTF8; - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, e, 0), QString::fromLatin1("Hallo 0 Welten!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, e, 1), QString::fromLatin1("Hallo 1 Welt!")); - QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, e, 2), QString::fromLatin1("Hallo 2 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0), QString::fromLatin1("Hallo 0 Welten!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 1), QString::fromLatin1("Hallo 1 Welt!")); + QCOMPARE(QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 2), QString::fromLatin1("Hallo 2 Welten!")); // pick up translation from the file with dependencies QCOMPARE(tor.translate("QPushButton", "It's a small world"), QString::fromLatin1("Es ist eine kleine Welt")); -- cgit v1.2.3 From fc218119829b745edfe6172be22a82ea8c80886a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 21 Mar 2013 14:52:50 +0200 Subject: Fix qlocalsocket_tcp.cpp build for Windows Embedded Compact 7. There is no 'name' variable, but apparently 'd->serverName' is correct variable here. Some other methods take 'name' as an argument and have similar code block, so I think this is a copy/paste error introduced somewhere in the past. Change-Id: I2e82b42688b9928e0dcc5054df04e87d30a5e38e Reviewed-by: Andreas Holzammer Reviewed-by: Johannes Oikarinen Reviewed-by: Thiago Macieira --- src/network/socket/qlocalsocket_tcp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp index edde5a4687..31aaa6e1c5 100644 --- a/src/network/socket/qlocalsocket_tcp.cpp +++ b/src/network/socket/qlocalsocket_tcp.cpp @@ -234,7 +234,7 @@ bool QLocalSocket::open(OpenMode openMode) } const QLatin1String prefix("QLocalServer/"); - if (name.startsWith(prefix)) + if (d->serverName.startsWith(prefix)) d->fullServerName = d->serverName; else d->fullServerName = prefix + d->serverName; -- cgit v1.2.3 From f8a047d8435581d076e6bd4c9727209104a7fc84 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 11 Apr 2013 17:06:46 +0200 Subject: Fix Windows CE compilation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Breakage introduced by 11e9f1368be986d0e128e8f7b2423d9cc7dd5436 . Simplify #ifdef-blocks. Task-number: QTBUG-30063 Change-Id: I0710915ff7b0ad5947935904c43ff9b621f638f2 Reviewed-by: Andreas Holzammer Reviewed-by: Björn Breitmeyer Reviewed-by: Janne Anttila --- src/plugins/platforms/windows/qwindowscontext.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index f2ee33d327..3f4555a31f 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -271,22 +271,19 @@ QWindowsContextPrivate::QWindowsContextPrivate() : m_eventType(QByteArrayLiteral("windows_generic_MSG")), m_lastActiveWindow(0), m_asyncExpose(0) { + const QSysInfo::WinVersion ver = QSysInfo::windowsVersion(); #ifndef Q_OS_WINCE QWindowsContext::user32dll.init(); QWindowsContext::shell32dll.init(); -#endif // Ensure metrics functions report correct data, QTBUG-30063. if (QWindowsContext::user32dll.setProcessDPIAware) QWindowsContext::user32dll.setProcessDPIAware(); - m_displayContext = GetDC(0); - m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY); - const QSysInfo::WinVersion ver = QSysInfo::windowsVersion(); -#ifndef Q_OS_WINCE if (hasTouchSupport(ver) && QWindowsContext::user32dll.initTouch()) m_systemInfo |= QWindowsContext::SI_SupportsTouch; -#endif - +#endif // !Q_OS_WINCE + m_displayContext = GetDC(0); + m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY); if (useRTL_Extensions(ver)) { m_systemInfo |= QWindowsContext::SI_RTL_Extensions; m_keyMapper.setUseRTLExtensions(true); -- cgit v1.2.3 From 8c81b282f8e18897257b93cb3fc149d74441c40e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 2 Apr 2013 16:21:35 +0200 Subject: Widgets: Propagate 'accepted'-state of touch begin events. Task-number: QTBUG-29946 Change-Id: Ia9ac54251f52b6ae4b3d667e49b96441def72a57 Reviewed-by: Shawn Rutledge --- src/widgets/kernel/qapplication.cpp | 15 ++++++++++----- src/widgets/kernel/qapplication_p.h | 2 +- src/widgets/kernel/qwidgetwindow.cpp | 8 +++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 02fcfde59e..d036f6bada 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3837,7 +3837,7 @@ bool QApplicationPrivate::translateTouchToMouse(QWidget *widget, QTouchEvent *ev return false; } -void QApplicationPrivate::translateRawTouchEvent(QWidget *window, +bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, QTouchDevice *device, const QList &touchPoints, ulong timestamp) @@ -3899,8 +3899,9 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, } if (widgetsNeedingEvents.isEmpty()) - return; + return false; + bool accepted = false; QHash::ConstIterator it = widgetsNeedingEvents.constBegin(); const QHash::ConstIterator end = widgetsNeedingEvents.constEnd(); for (; it != end; ++it) { @@ -3939,19 +3940,23 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, { // if the TouchBegin handler recurses, we assume that means the event // has been implicitly accepted and continue to send touch events - widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); - (void ) QApplication::sendSpontaneousEvent(widget, &touchEvent); + if (QApplication::sendSpontaneousEvent(widget, &touchEvent) && touchEvent.isAccepted()) { + accepted = true; + widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent); + } break; } default: if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)) { if (touchEvent.type() == QEvent::TouchEnd) widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false); - (void) QApplication::sendSpontaneousEvent(widget, &touchEvent); + if (QApplication::sendSpontaneousEvent(widget, &touchEvent) && touchEvent.isAccepted()) + accepted = true; } break; } } + return accepted; } void QApplicationPrivate::translateTouchCancel(QTouchDevice *device, ulong timestamp) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index ca1bccb727..87cf259ba5 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -284,7 +284,7 @@ public: void appendTouchPoint(const QTouchEvent::TouchPoint &touchPoint); void removeTouchPoint(int touchPointId); bool translateTouchToMouse(QWidget *widget, QTouchEvent *event); - static void translateRawTouchEvent(QWidget *widget, + static bool translateRawTouchEvent(QWidget *widget, QTouchDevice *device, const QList &touchPoints, ulong timestamp); diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index ddb570d6c7..bedcfe78bf 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -473,10 +473,12 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) void QWidgetWindow::handleTouchEvent(QTouchEvent *event) { - if (event->type() == QEvent::TouchCancel) + if (event->type() == QEvent::TouchCancel) { QApplicationPrivate::translateTouchCancel(event->device(), event->timestamp()); - else - QApplicationPrivate::translateRawTouchEvent(m_widget, event->device(), event->touchPoints(), event->timestamp()); + event->accept(); + } else { + event->setAccepted(QApplicationPrivate::translateRawTouchEvent(m_widget, event->device(), event->touchPoints(), event->timestamp())); + } } void QWidgetWindow::handleKeyEvent(QKeyEvent *event) -- cgit v1.2.3