From eab6700ec0f637fd79a5dd1cb541ee6426a699d6 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 12 Jun 2013 12:46:13 +0200 Subject: Fix crash for pressing Ctrl+C in a message box This fixes a regression introduced with e34dccc9e Task-number: QTBUG-31635 Change-Id: I7c991f3b98f5c51e5fb3c12db04d3ace7be87010 Reviewed-by: Friedemann Kleint Reviewed-by: Mitch Curtis --- src/widgets/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 4ec828ac83..995d279e13 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1392,7 +1392,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e) #if !defined(QT_NO_TEXTEDIT) if (e == QKeySequence::Copy) { - if (d->detailsText->isVisible() && d->detailsText->copy()) { + if (d->detailsText && d->detailsText->isVisible() && d->detailsText->copy()) { e->setAccepted(true); return; } -- cgit v1.2.3 From 443253cf1191c5157f4a5338a6fc45993ea86061 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 10 Jun 2013 14:41:16 +0200 Subject: Let QTemporaryDir::stressTest() run in temporary directory. Task-number: QTBUG-31618 Change-Id: I60aaa4f57710816cd0e22ea9b097c7e85466fd0c Reviewed-by: David Faure (KDE) --- tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 8515f8a698..713d0c5c17 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -279,17 +279,18 @@ void tst_QTemporaryDir::openOnRootDrives() void tst_QTemporaryDir::stressTest() { const int iterations = 1000; + QTemporaryDir rootDir; + QVERIFY(rootDir.isValid()); QSet names; + const QString pattern = rootDir.path() + QStringLiteral("/XXXXXX"); for (int i = 0; i < iterations; ++i) { - QTemporaryDir dir; + QTemporaryDir dir(pattern); dir.setAutoRemove(false); - QVERIFY2(dir.isValid(), qPrintable(QString::number(i))); + QVERIFY2(dir.isValid(), qPrintable(QString::fromLatin1("Failed to create #%1 under %2.").arg(i).arg(QDir::toNativeSeparators(pattern)))); QVERIFY(!names.contains(dir.path())); names.insert(dir.path()); } - for (QSet::const_iterator it = names.constBegin(); it != names.constEnd(); ++it) - QDir(*it).removeRecursively(); } void tst_QTemporaryDir::rename() -- cgit v1.2.3 From b6f24423716b82686c86d33828b7139ac717afdd Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 12 Jun 2013 15:08:28 +0200 Subject: Fix another type of crash when dragging QDockWidget in and out QDockWidgetPrivate::mouseMoveEvent calls q->move() which can result in a call to QDockWidgetPrivate::endDrag(), which will delete the state struct. Therefore mouseMoveEvent needs to check whether it's null or not before accessing it. Task-number: QTBUG-31672 Change-Id: I91a31620f16a80b31b65b2742e7937ae8960f0fd Reviewed-by: Gabriel de Dietrich Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qdockwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index a3c331aa2b..5217e57333 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -873,7 +873,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event) QPoint pos = event->globalPos() - state->pressPos; q->move(pos); - if (!state->ctrlDrag) + if (state && !state->ctrlDrag) mwlayout->hover(state->widgetItem, event->globalPos()); ret = true; -- cgit v1.2.3 From 0bc96d1d6ba29c6e0a4c39cc526d9515036b7453 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 12 Jun 2013 12:52:31 +0200 Subject: Widgets: Do not create QWindow in createTLExtra(). QWidget::setWindowIcon() and similar call createTLExtra() which creates a QWindow without setting the native attributes on the parent, which can cause crashes when setParent_sys() decides to delete the window. Task-number: QTBUG-31672 Change-Id: I4c40ee12741be88b2281df90329ffb698d4009eb Reviewed-by: Shawn Rutledge --- src/widgets/kernel/qwidget.cpp | 5 ++++- src/widgets/kernel/qwidget_qpa.cpp | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cfccce7c41..f67a93c7b5 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1546,10 +1546,11 @@ void QWidgetPrivate::createTLExtra() x->inTopLevelResize = false; x->inRepaint = false; x->embedded = 0; + x->window = 0; + x->screenIndex = 0; #ifdef Q_WS_MAC x->wasMaximized = false; #endif // Q_WS_MAC - createTLSysExtra(); #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "tlextra" << ++count; @@ -10109,6 +10110,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; } case Qt::WA_NativeWindow: { d->createTLExtra(); + if (on) + d->createTLSysExtra(); #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); if (on && !internalWinId() && hasFocus() diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 3b6c9ca448..dafe7dc42a 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -890,9 +890,7 @@ void QWidgetPrivate::deleteSysExtra() void QWidgetPrivate::createTLSysExtra() { Q_Q(QWidget); - extra->topextra->screenIndex = 0; - extra->topextra->window = 0; - if (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) { + if (!extra->topextra->window && (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow())) { extra->topextra->window = new QWidgetWindow(q); if (extra->minw || extra->minh) extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh)); -- cgit v1.2.3 From 3e2cd8ef6f1ce4f46719890134c8bba9dbdb19ba Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 11 Jun 2013 16:58:49 +0200 Subject: fix QFileSystemEngine::createDirectory race condition During a call to QDir::mkpath(), the same path could be created by another process, in which case the OS mkdir will fail with EEXIST. But the docs for mkpath() state that it's not an error if it already exists, whereas for mkdir() it is an error. So QFileSystemEngine::createDirectory should accept the EEXIST error silently if it occurs while creating the sequence of parent directories and the final leaf directory, but should fail if EEXIST happens when it was called from QDir::mkdir(), which is when the createParents parameter is false. We assume the operating system mkdir() and CreateDirectory() are atomic, so there should be no race condition in QDir::mkdir(). It's not necessary for mkpath() to call stat() at each level, only to check whether an existing entry is a directory or a file. Also added to the autotest to verify that if the path is an existing file, creating a dir with the same name will fail in either mkdir or mkpath. Task-number: QTBUG-30046 Change-Id: I926352f10654fdf3b322c8685bb85ad8b8844874 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfilesystemengine_unix.cpp | 11 ++++++----- src/corelib/io/qfilesystemengine_win.cpp | 13 ++++++------- tests/auto/corelib/io/qdir/tst_qdir.cpp | 18 +++++++++++++++++- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index b18e32b29a..a7517b4c7f 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -510,11 +510,12 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (slash) { const QByteArray chunk = QFile::encodeName(dirName.left(slash)); - QT_STATBUF st; - if (QT_STAT(chunk.constData(), &st) != -1) { - if ((st.st_mode & S_IFMT) != S_IFDIR) - return false; - } else if (QT_MKDIR(chunk.constData(), 0777) != 0) { + if (QT_MKDIR(chunk.constData(), 0777) != 0) { + if (errno == EEXIST) { + QT_STATBUF st; + if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) + continue; + } return false; } } diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index bee7689535..fdbd6e01e4 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1044,14 +1044,13 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (slash) { QString chunk = dirName.left(slash); - bool existed = false; - if (!isDirPath(chunk, &existed)) { - if (!existed) { - if (!mkDir(chunk)) - return false; - } else { - return false; + if (!mkDir(chunk)) { + if (GetLastError() == ERROR_ALREADY_EXISTS) { + bool existed = false; + if (isDirPath(chunk, &existed) && existed) + continue; } + return false; } } } diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index d44ef167b5..fbb21e4e9a 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -311,12 +311,28 @@ void tst_QDir::mkdir() void tst_QDir::makedirReturnCode() { QString dirName = QString::fromLatin1("makedirReturnCode"); - QDir::current().rmdir(dirName); // cleanup a previous run. + QFile f(QDir::current().filePath(dirName)); + + // cleanup a previous run. + f.remove(); + QDir::current().rmdir(dirName); + QDir dir(dirName); QVERIFY(!dir.exists()); QVERIFY(QDir::current().mkdir(dirName)); QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing dir will fail. QVERIFY(QDir::current().mkpath(dirName)); // calling mkpath on an existing dir will pass + + // Remove the directory and create a file with the same path + QDir::current().rmdir(dirName); + QVERIFY(!f.exists()); + f.open(QIODevice::WriteOnly); + f.write("test"); + f.close(); + QVERIFY(f.exists()); + QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing file will fail. + QVERIFY(!QDir::current().mkpath(dirName)); // calling mkpath on an existing file will fail. + f.remove(); } void tst_QDir::rmdir_data() -- cgit v1.2.3 From 703cca8bb7607201aff5a2f833d66dc80a7d0e4d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 12 Jun 2013 14:57:11 +0200 Subject: Adjust the cmake files to find the dlls in the bin dir. Change-Id: I840f963c3648d123b31f79aa2c8902c0ad74e982 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/create_cmake.prf | 11 +++++ .../features/data/cmake/Qt5BasicConfig.cmake.in | 54 +++++++++++++--------- src/gui/Qt5GuiConfigExtras.cmake.in | 7 +-- 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 3dae3895de..7a200056ae 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -60,6 +60,17 @@ contains(CMAKE_BIN_DIR, "^\\.\\./.*") { CMAKE_BIN_DIR_IS_ABSOLUTE = True } +!isEmpty(DLLDESTDIR):!static:!staticlib { + CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX]) + contains(CMAKE_DLL_DIR, "^\\.\\./.*") { + CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/ + CMAKE_DLL_DIR_IS_ABSOLUTE = True + } +} else { + CMAKE_DLL_DIR = $$CMAKE_LIB_DIR + CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE +} + CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX]) contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") { CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA]/ diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index c55b728f1b..1a2bd4a94d 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -46,10 +46,10 @@ endmacro() macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\") +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ELSE - set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\") + set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES @@ -187,22 +187,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) !!IF isEmpty(CMAKE_DEBUG_TYPE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ELSE - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD -!!ELSE -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) +!!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" !!ELSE - if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" !!ENDIF -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + AND EXISTS +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +!!ENDIF _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() @@ -220,22 +224,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) !!IF isEmpty(CMAKE_RELEASE_TYPE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ELSE - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD -!!ELSE -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) +!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) +!!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" !!ELSE - if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" !!ENDIF -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + AND EXISTS +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) +!!ENDIF _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 83e77280d5..6ad1d679e1 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -16,11 +16,12 @@ set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\") +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\") + set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") !!ELSE -- cgit v1.2.3 From 19ed991e56dbdec0c530a7626e5e20ebdff3a78e Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 14 Jun 2013 11:51:17 +0200 Subject: Doc: Remove Tweet Search demo from the list of highlighted examples Don't highlight the example until it's updated to use a new version of the Twitter API. Task-number: QTBUG-31745 Change-Id: If7f9ac3391c549f48cfebcdbe6bdcd12eb4a3e13 Reviewed-by: Jerome Pasion --- doc/global/manifest-meta.qdocconf | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index d4b2f9f066..9dd6cbfb43 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -36,7 +36,6 @@ manifestmeta.filters = highlighted webkit1 webkit2 manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ - "QtQuick/Qt Quick Demo - Tweet Search" \ "QtQuick/Qt Quick Demo - Maroon*" \ "QtQuick/Qt Quick Demo - Calqlatr" \ "QtQuick/Qt Quick Particles Examples - Emitters" \ -- cgit v1.2.3 From dd050d35d77e2f6ac37bd1266a843df55848022f Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 13 Jun 2013 17:43:56 +0200 Subject: network requests: do not access 1st byte of empty byte array ... because otherwise this would crash. Apparently there are cases where the header name is empty. Task-number: QTBUG-31667 Change-Id: I31b3e964502c05b7614c23876bb3752fa75ab22d Reviewed-by: Richard J. Moore Reviewed-by: Shane Kearns --- src/network/access/qnetworkrequest.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 3a3e24b80b..00d5b81413 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -752,7 +752,8 @@ static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVaria static QNetworkRequest::KnownHeaders parseHeaderName(const QByteArray &headerName) { - // headerName is not empty here + if (headerName.isEmpty()) + return QNetworkRequest::KnownHeaders(-1); switch (tolower(headerName.at(0))) { case 'c': -- cgit v1.2.3 From cf98d1e60764e22e2e3f168708818106af99c498 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 13 Jun 2013 17:50:39 +0200 Subject: OSX color dialog can be accepted repeatedly QNSColorPanelDelegate::finishOffWithCode sets mResultSet = true and it needs to be set false again the next time the dialog is shown. Task-number: QTBUG-31566 Change-Id: If1d4bb9d4e76273c6423f5bf2ae37790e8a9704e Reviewed-by: Liang Qi --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index a0dac445be..514ea0482f 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -274,6 +274,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview) - (void)showModelessPanel { mDialogIsExecuting = false; + mResultSet = false; [mColorPanel makeKeyAndOrderFront:mColorPanel]; } -- cgit v1.2.3 From e083aede62a23af8330bb572366e79e2f42e0cec Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 14 Jun 2013 12:39:02 +0200 Subject: Cocoa color dialog cannot be modal, but should show anyway Silently failing doesn't seem the right way to handle this. Updated docs for DontUseNativeDialog option: it's not just for the Mac anymore. Ensure that the Qt dialog and Mac panel will never be shown at the same time. Change-Id: Ia9e80754df6c7622d9039c8dd050ac4de771a030 Task-number: QTBUG-29161 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 10 ++++------ src/widgets/dialogs/qcolordialog.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 514ea0482f..901aa667f5 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -368,10 +368,8 @@ void QCocoaColorDialogHelper::exec() bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowModality, QWindow *parent) { - if (windowModality == Qt::WindowModal) { - // Cocoa's shared color panel cannot be shown as a sheet - return false; - } + if (windowModality == Qt::WindowModal) + windowModality = Qt::ApplicationModal; return showCocoaColorPanel(windowModality, parent); } @@ -434,9 +432,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal createNSColorPanelDelegate(); QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast(mDelegate); [delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)]; - if (windowModality == Qt::NonModal) + if (windowModality != Qt::WindowModal) [delegate showModelessPanel]; - // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel() + // no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case return true; } diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index d6254076c5..79a71599c0 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1776,6 +1776,8 @@ void QColorDialog::setOptions(ColorDialogOptions options) d->options->setOptions(QColorDialogOptions::ColorDialogOptions(int(options))); d->buttons->setVisible(!(options & NoButtons)); d->showAlpha(options & ShowAlphaChannel); + if (options & DontUseNativeDialog) + d->nativeDialogInUse = false; } QColorDialog::ColorDialogOptions QColorDialog::options() const @@ -1794,8 +1796,8 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const \value ShowAlphaChannel Allow the user to select the alpha component of a color. \value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".) - \value DontUseNativeDialog Use Qt's standard color dialog on the Mac instead of Apple's - native color panel. + \value DontUseNativeDialog Use Qt's standard color dialog instead of the operating system + native color dialog. \sa options, setOption(), testOption(), windowModality() */ -- cgit v1.2.3 From 69554e458669c941130c2dc03d42a59ffd00e39e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 14 Jun 2013 12:39:42 +0200 Subject: OSX: Disable window restoration for the Mac color panel because if it is automatically restored it's out of the application's control, so the user's interaction will be ignored. Change I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 did this for normal windows by default, but the dialog helpers generate windows which aren't affected by that. Task-number: QTBUG-31750 Change-Id: I636bd87b664a489a2dc8693dad5370a715b1cf7b Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 901aa667f5..594ad65a18 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -98,6 +98,11 @@ static NSButton *macCreateButton(const char *text, NSView *superview) mDialogIsExecuting = false; mResultSet = false; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) + [mColorPanel setRestorable:NO]; +#endif + if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) { mStolenContentView = 0; mOkButton = 0; -- cgit v1.2.3 From 13e01fda195bcf55e3fb1862c9467ac9cbbf33c1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:28:52 +0200 Subject: assemble the tool commands at use time, after all the precise syntax depends on what exactly the command is used for, so we need to resolve it at the last moment. see followup commits. This logically reverts commits 6f4ff81380862ad0e788151b35d742f548241d5a and 731e6bece5cebe205ca47c1c078c7ac18984ba1c. Change-Id: If285c91d7521069be86d32593b5c2ae2027b3038 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 8 ++++---- mkspecs/features/qt_tool.prf | 11 ++++++----- mkspecs/features/testcase.prf | 2 +- qtbase.pro | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 9ec22d57db..4b96c48aa5 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -191,7 +191,7 @@ defineTest(qtAddRpathLink) { # variable, default defineTest(qtPrepareTool) { - $$1 = $$eval(QT_TOOL.$${2}.command) + $$1 = $$eval(QT_TOOL.$${2}.binary) isEmpty($$1) { $$1 = $$[QT_HOST_BINS]/$$2 exists($$eval($$1).pl) { @@ -204,9 +204,9 @@ defineTest(qtPrepareTool) { $$1 = $$BUNDLENAME } } - $$1 = $$shell_path($$eval($$1)) } - export($$1) + $$1 = $$shell_path($$eval($$1)) + qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) } defineTest(qtAddToolEnv) { @@ -233,7 +233,7 @@ defineTest(qtAddToolEnv) { } defineTest(qtAddTargetEnv) { - deps = $$replace(QT, -private$, ) + deps = $$replace($$2, -private$, ) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { for(dep, deps): \ diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 0a588807c8..9a6b9634e0 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -19,17 +19,17 @@ CONFIG += console !build_pass:if(!host_build|!force_bootstrap|force_independent) { isEmpty(MODULE):MODULE = $$TARGET - MODULE_DEPENDS = $$replace(QT, -private$, ) + !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, ) load(qt_build_paths) load(resolve_target) - cmd = $$shell_path($$QMAKE_RESOLVED_TARGET) - !host_build|!force_bootstrap: qtAddTargetEnv(cmd) TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri - TOOL_PRI_CONT = "QT_TOOL.$${MODULE}.command = $$val_escape(cmd)" + TOOL_PRI_CONT = \ + "QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ + "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -39,6 +39,7 @@ CONFIG += console unset(added) } include($$TOOL_PRI) - cache(QT_TOOL.$${MODULE}.command, transient) + for(var, $$list(binary depends)): \ + cache(QT_TOOL.$${MODULE}.$$var, transient) } diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 15febe2dd5..e31d1f4539 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -43,7 +43,7 @@ else: check.commands += $(DESTDIR_TARGET) check.commands += $(TESTARGS) # Add environment for non-installed builds -qtAddTargetEnv(check.commands) +qtAddTargetEnv(check.commands, QT) # If the test is marked as insignificant, discard the exit code insignificant_test:check.commands = -$${check.commands} diff --git a/qtbase.pro b/qtbase.pro index 02dc11eac2..6ab032e30f 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -88,7 +88,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri - TOOL_PRI_CONT = "QT_TOOL.syncqt.command = $$val_escape(cmd)" + TOOL_PRI_CONT = "QT_TOOL.syncqt.binary = $$val_escape(cmd)" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -97,7 +97,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added) } include($$TOOL_PRI) - cache(QT_TOOL.syncqt.command, transient) + cache(QT_TOOL.syncqt.binary, transient) } -- cgit v1.2.3 From c932f2cc1352417a760378f59579569673a82b1d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:37:53 +0200 Subject: fix command over-escaping in vcproj files the vs ide executes the commands verbatim, so they must not be make-escaped. Task-number: QTBUG-31289 Change-Id: Ie73fd5c4da5527c2d10bc94ccdf60f8a1ca21351 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 4b96c48aa5..abce52c328 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -224,8 +224,10 @@ defineTest(qtAddToolEnv) { else: infix = val = "(set $$name=$$join(value, ;)$$infix) &" } - contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g - else: val ~= s,\\\$,\$\$,g + !contains(TEMPLATE, vc.*) { + contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g + else: val ~= s,\\\$,\$\$,g + } $$1 = "$$val $$eval($$1)" } } -- cgit v1.2.3 From 9d48f14a3cdaee24fb41d192c648b1263edeb70d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:41:36 +0200 Subject: always $-escape make commands nmake needs %-escaping in addition to $-escaping, not instead. this has little practical impact, so it went unnoticed. Change-Id: I144b6142eec0151d83a22e0ac5ead7b0415cdafa Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index abce52c328..ca8391b65a 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -226,7 +226,7 @@ defineTest(qtAddToolEnv) { } !contains(TEMPLATE, vc.*) { contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g - else: val ~= s,\\\$,\$\$,g + val ~= s,\\\$,\$\$,g } $$1 = "$$val $$eval($$1)" } -- cgit v1.2.3 From 17c38b25f432767e533d1612df3bcee0d15a4de8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 18:12:07 +0200 Subject: fix rcc & uic .depend_commands unlike the .command, the .depend_command is not executed by make via its chosen shell, but qmake itself via the system's native shell. consequently, it needs different path separators and no make-escaping. Task-number: QTBUG-31289 Change-Id: I480f815753632db6e8d4725f463f8a1fc59680a6 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 33 ++++++++++++++++++++++++++------- mkspecs/features/resources.prf | 4 ++-- mkspecs/features/uic.prf | 4 ++-- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index ca8391b65a..63ae62c42e 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -189,7 +189,7 @@ defineTest(qtAddRpathLink) { export(QMAKE_RPATHLINKDIR) } -# variable, default +# variable, default, [suffix for variable for system() use] defineTest(qtPrepareTool) { $$1 = $$eval(QT_TOOL.$${2}.binary) isEmpty($$1) { @@ -205,16 +205,25 @@ defineTest(qtPrepareTool) { } } } + !isEmpty(3) { + $$1$$3 = $$system_path($$eval($$1)) + qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) + } $$1 = $$shell_path($$eval($$1)) qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) } +# target variable, list of env var names, [non-empty: prepare for system(), not make] defineTest(qtAddToolEnv) { + isEmpty(3): \ + ds = $$QMAKE_DIR_SEP + else: \ + ds = $$DIR_SEPARATOR for(env, 2) { value = $$eval($${env}.value) !isEmpty(value) { name = $$eval($${env}.name) - equals(QMAKE_DIR_SEP, /) { + equals(ds, /) { contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name} else: infix = val = "$$name=$$join(value, :)$$infix" @@ -224,7 +233,7 @@ defineTest(qtAddToolEnv) { else: infix = val = "(set $$name=$$join(value, ;)$$infix) &" } - !contains(TEMPLATE, vc.*) { + isEmpty(3): !contains(TEMPLATE, vc.*) { contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g val ~= s,\\\$,\$\$,g } @@ -234,12 +243,17 @@ defineTest(qtAddToolEnv) { export($$1) } +# target variable, dependency var name, [non-empty: prepare for system(), not make] defineTest(qtAddTargetEnv) { deps = $$replace($$2, -private$, ) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { - for(dep, deps): \ - deppath += $$shell_path($$eval(QT.$${dep}.libs)) + for(dep, deps) { + isEmpty(3): \ + deppath += $$shell_path($$eval(QT.$${dep}.libs)) + else: \ + deppath += $$system_path($$eval(QT.$${dep}.libs)) + } equals(QMAKE_HOST.os, Windows) { deppath.name = PATH } else:contains(QMAKE_HOST.os, Linux|FreeBSD) { @@ -258,13 +272,18 @@ defineTest(qtAddTargetEnv) { pluginpath.value = for(qmod, QMAKEMODULES) { qmod = $$section(qmod, /, 0, -3)/plugins - exists($$qmod): pluginpath.value += $$shell_path($$qmod) + exists($$qmod) { + isEmpty(3): \ + pluginpath.value += $$shell_path($$qmod) + else: \ + pluginpath.value += $$system_path($$qmod) + } } pluginpath.name = QT_PLUGIN_PATH QT_TOOL_ENV += deppath pluginpath } - qtAddToolEnv($$1, $$QT_TOOL_ENV) + qtAddToolEnv($$1, $$QT_TOOL_ENV, $$3) } defineReplace(pkgConfigExecutable) { diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 34a04b4ee2..68ca4d1442 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -1,4 +1,4 @@ -qtPrepareTool(QMAKE_RCC, rcc) +qtPrepareTool(QMAKE_RCC, rcc, _DEP) isEmpty(RCC_DIR):RCC_DIR = . isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc @@ -19,7 +19,7 @@ resource_combine { } } rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} +rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.CONFIG += add_inputs_as_makefile_deps rcc.input = RESOURCES rcc.variable_out = SOURCES diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 83e579cb3a..c6a64050e0 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -1,10 +1,10 @@ -qtPrepareTool(QMAKE_UIC, uic) +qtPrepareTool(QMAKE_UIC, uic, _DEP) isEmpty(UI_DIR):UI_DIR = . isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -uic.depend_command = $$QMAKE_UIC -d ${QMAKE_FILE_IN} +uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN} uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} uic.input = FORMS uic.variable_out = GENERATED_FILES -- cgit v1.2.3 From d135a311a34e693d761a3607663b0879be9bbf65 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Jun 2013 09:50:46 +0200 Subject: make Makefiles not depend on .qmake.super this avoids that an empty rebuild after a complete build re-runs qmake everywhere again. according to 1f83f0cf2a this is the behavior i originally intended, but somehow it got lost when switching to the new interpreter. Change-Id: Id5158d7e272fdee4f4a041fb7c828295a0a86684 Reviewed-by: Joerg Bornemann --- qmake/library/qmakeevaluator.cpp | 4 ++-- qmake/library/qmakeevaluator.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index c60119615f..6fb9c05ae5 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1222,7 +1222,7 @@ bool QMakeEvaluator::loadSpec() m_qmakespec = QDir::cleanPath(qmakespec); if (!m_superfile.isEmpty() - && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { + && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { return false; } if (!loadSpecInternal()) @@ -1813,7 +1813,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile( m_current = m_locationStack.pop(); pro->deref(); #ifdef PROEVALUATOR_FULL - if (ok == ReturnTrue) { + if (ok == ReturnTrue && !(flags & LoadHidden)) { ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")]; ProString ifn(fileName); if (!iif.contains(ifn)) diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index 59e3295f69..09617ba019 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -102,7 +102,8 @@ public: LoadPreFiles = 1, LoadPostFiles = 2, LoadAll = LoadPreFiles|LoadPostFiles, - LoadSilent = 0x10 + LoadSilent = 0x10, + LoadHidden = 0x20 }; Q_DECLARE_FLAGS(LoadFlags, LoadFlag) -- cgit v1.2.3 From a5ecb0bcfd0295723ef6c58136397b9455ec482c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 13 Jun 2013 16:46:50 +0200 Subject: Android Mute and FastForward keys mapped wrong KEYCODE_MEDIA_FAST_FORWARD is mapped to Qt::Key_Forward, which undoes Back. I believe the best match in Qt would be Qt::Key_AudioForward which is also mapped by XCB from XF86XK_AudioForward /* fast-forward audio track */ KEYCODE_MUTE is mapped to Qt::Key_Volume_Mute, but the mute button is for muting the microphone, the volume mute is called KEYCODE_VOLUME_MUTE. Change-Id: Id0b78c9bde78faef1f5d31019693e6c466941d70 Reviewed-by: BogDan Vatra --- src/corelib/global/qnamespace.h | 2 ++ src/corelib/global/qnamespace.qdoc | 1 + src/plugins/platforms/android/src/androidjniinput.cpp | 11 +++++++---- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 74949b86f0..25c47d5d34 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -980,6 +980,8 @@ public: Key_TouchpadOn = 0x01000111, Key_TouchpadOff = 0x01000112, + Key_MicMute = 0x01000113, + Key_MediaLast = 0x0100ffff, // Keypad navigation keys diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9eb0c6b8f2..f9248eb68d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1621,6 +1621,7 @@ \value Key_TouchpadToggle \value Key_TouchpadOn \value Key_TouchpadOff + \value Key_MicMute \value Key_MediaLast \value Key_unknown diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index 29ccfe0125..75cb617ca8 100644 --- a/src/plugins/platforms/android/src/androidjniinput.cpp +++ b/src/plugins/platforms/android/src/androidjniinput.cpp @@ -333,7 +333,7 @@ namespace QtAndroidInput return Qt::Key_BracketLeft; case 0x0000005a: // KEYCODE_MEDIA_FAST_FORWARD - return Qt::Key_Forward; + return Qt::Key_AudioForward; case 0x00000057: return Qt::Key_MediaNext; @@ -344,7 +344,7 @@ namespace QtAndroidInput case 0x00000058: return Qt::Key_MediaPrevious; - case 0x00000059: + case 0x00000059: // KEYCODE_MEDIA_REWIND return Qt::Key_AudioRewind; case 0x00000056: @@ -356,8 +356,8 @@ namespace QtAndroidInput case 0x00000045: return Qt::Key_Minus; - case 0x0000005b: - return Qt::Key_VolumeMute; + case 0x0000005b: // KEYCODE_MUTE + return Qt::Key_MicMute; case 0x0000004e: return Qt::Key_NumLock; @@ -405,6 +405,9 @@ namespace QtAndroidInput case 0x00000019: return Qt::Key_VolumeDown; + case 0x000000a4: // KEYCODE_VOLUME_MUTE + return Qt::Key_VolumeMute; + case 0x00000018: return Qt::Key_VolumeUp; diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 155b327315..db53e7471e 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -248,6 +248,7 @@ #define XF86XK_TouchpadToggle 0x1008FFA9 #define XF86XK_TouchpadOn 0x1008FFB0 #define XF86XK_TouchpadOff 0x1008FFB1 +#define XF86XK_AudioMicMute 0x1008FFB2 // end of XF86keysyms.h @@ -543,6 +544,7 @@ static const unsigned int KeyTbl[] = { XF86XK_TouchpadToggle, Qt::Key_TouchpadToggle, XF86XK_TouchpadOn, Qt::Key_TouchpadOn, XF86XK_TouchpadOff, Qt::Key_TouchpadOff, + XF86XK_AudioMicMute, Qt::Key_MicMute, XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 6: remap properly XF86XK_Launch1, Qt::Key_Launch3, XF86XK_Launch2, Qt::Key_Launch4, -- cgit v1.2.3 From cf8647d6aa0f65a51dc9366d407b2218f561970d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jun 2013 14:18:10 +0200 Subject: Remove unused member QFactoryLoaderPrivate::keyList. Task-number: QTBUG-31476 Change-Id: Ife9b25ede67837152d94cd500a1d7c6dc6cd8ab8 Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 289fda7afc..943fb35ab6 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -72,7 +72,6 @@ public: QByteArray iid; QList libraryList; QMap keyMap; - QStringList keyList; QString suffix; Qt::CaseSensitivity cs; QStringList loadedPaths; @@ -172,10 +171,8 @@ void QFactoryLoader::update() metaDataOk = true; QJsonArray k = object.value(QLatin1String("Keys")).toArray(); - for (int i = 0; i < k.size(); ++i) { - QString s = k.at(i).toString(); - keys += s; - } + for (int i = 0; i < k.size(); ++i) + keys += d->cs ? k.at(i).toString() : k.at(i).toString().toLower(); } if (qt_debug_component()) qDebug() << "Got keys from plugin meta data" << keys; @@ -192,9 +189,7 @@ void QFactoryLoader::update() // library was built with a future Qt version, // whereas the new one has a Qt version that fits // better - QString key = keys.at(k); - if (!d->cs) - key = key.toLower(); + const QString &key = keys.at(k); QLibraryPrivate *previous = d->keyMap.value(key); int prev_qt_version = 0; if (previous) { @@ -203,7 +198,6 @@ void QFactoryLoader::update() int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble(); if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) { d->keyMap[key] = library; - d->keyList += keys.at(k); } } } -- cgit v1.2.3 From 732dcfe7fdfa7534ab0de4674ae17f191167a57a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jun 2013 14:48:21 +0200 Subject: QFactoryLoader: Release unused libraries. Task-number: QTBUG-31476 Change-Id: Ib2eb076afaa21ab1fdc12944f80483e3de260d4b Reviewed-by: Lars Knoll --- src/corelib/plugin/qfactoryloader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 943fb35ab6..1288643e32 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -183,7 +183,7 @@ void QFactoryLoader::update() continue; } - d->libraryList += library; + int keyUsageCount = 0; for (int k = 0; k < keys.count(); ++k) { // first come first serve, unless the first // library was built with a future Qt version, @@ -198,8 +198,13 @@ void QFactoryLoader::update() int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble(); if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) { d->keyMap[key] = library; + ++keyUsageCount; } } + if (keyUsageCount || keys.isEmpty()) + d->libraryList += library; + else + library->release(); } } #else -- cgit v1.2.3 From 021264a239c7c5f30263a59a73f08e482142b291 Mon Sep 17 00:00:00 2001 From: Venu Date: Fri, 14 Jun 2013 17:35:29 +0200 Subject: Tagged all those examples that work on an Android device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change enables the developers to list all the tagged examples on the Qt Creator welcome screen using the "android" tag. Task-number: QTBUG-30173 Change-Id: Ic09183eb441497506b2d35f0d83ecd5d73d724f5 Reviewed-by: Jerome Pasion Reviewed-by: Topi Reiniƶ Reviewed-by: Christian Stromme --- doc/global/manifest-meta.qdocconf | 101 +++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 9dd6cbfb43..a86f3a14e4 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -32,7 +32,7 @@ # manifestmeta.global.names = * # manifestmeta.global.tags = qt5 -manifestmeta.filters = highlighted webkit1 webkit2 +manifestmeta.filters = highlighted webkit1 webkit2 android manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ @@ -69,3 +69,102 @@ manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \ "QtWebKitExamples/YouTube View Example" manifestmeta.webkit2.tags = webkit2 + +manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \ + "QtQuick/Qt Quick Demo - Calqlatr" \ + "QtWidgets/Application Chooser Example" \ + "QtWidgets/Stickman Example" \ + "QtWidgets/Move Blocks Example" \ + "QtWidgets/Border Layout Example" \ + "QtWidgets/Dynamic Layouts Example" \ + "QtWidgets/Flow Layout Example" \ + "QtWidgets/MDI Example" \ + "QtWidgets/Dock Widgets Example" \ + "QtWidgets/Recent Files Example" \ + "QtWidgets/Menus Example" \ + "QtWidgets/Concentric Circles Example" \ + "QtWidgets/Gradients" \ + "QtWidgets/Font Sampler Example" \ + "QtWidgets/Path Stroking" \ + "QtWidgets/Transformations Example" \ + "QtWidgets/Syntax Highlighter Example" \ + "QtWidgets/Calendar Example" \ + "QtWidgets/Movie Example" \ + "QtWidgets/Validators Example" \ + "QtWidgets/Analog Clock Example" \ + "QtWidgets/Calculator Example" \ + "QtWidgets/Mouse Button Tester" \ + "QtWidgets/Character Map Example" \ + "QtWidgets/Wiggly Example" \ + "QtWidgets/Digital Clock Example" \ + "QtWidgets/Elided Label Example" \ + "QtWidgets/Image Viewer Example" \ + "QtWidgets/Sliders Example" \ + "QtWidgets/Tetrix Example" \ + "QtWidgets/Group Box Example" \ + "QtWidgets/Spin Boxes Example" \ + "QtWidgets/Undo Framework" \ + "QtWidgets/Regular Expressions Example" \ + "QtWidgets/Colliding Mice Example" \ + "QtWidgets/Basic Graphics Layouts Example" \ + "QtWidgets/Boxes" \ + "QtWidgets/40000 Chips" \ + "QtWidgets/Diagram Scene Example" \ + "QtWidgets/Drag and Drop Robot Example" \ + "QtWidgets/Elastic Nodes Example" \ + "QtWidgets/Pad Navigator Example" \ + "QtWidgets/Anchor Layout Example" \ + "QtWidgets/Weather Anchor Layout Example" \ + "QtConcurrent/Image Scaling Example" \ + "QtConcurrent/QtConcurrent Progress Dialog Example" \ + "QtNetwork/Torrent Example" \ + "QtNetwork/Network Chat Example" \ + "QtSQL/Master Detail Example" \ + "QtOpenGL/Cube OpenGL ES 2.0 example" \ + "QtOpenGL/Textures Example" \ + "QtLinguist/Arrow Pad Example" \ + "QtGui/Raster Window Example" \ + "QtGui/Analog Clock Window Example" \ + "QtMultimedia/Video Widget Example" \ + "QtMultimedia/Media Player Example" \ + "QtSVG/Text Object Example" \ + "QtQML/Qt Quick Examples - XMLHttpRequest" \ + "QtQuick/Qt Quick Particles Examples - *" \ + "QtQuick/Qt Quick Examples - Touch Interaction" \ + "QtQuick/Scene Graph - *" \ + "QtQuick/Qt Quick Examples - Image Elements" \ + "QtQuick/Qt Quick Examples - Key Interaction" \ + "QtQuick/Qt Quick Examples - Text" \ + "QtQuick/Qt Quick Examples - Animation" \ + "QtQuick/Qt Quick Examples - Shader Effects" \ + "QtQuick/Qt Quick Examples - Canvas" \ + "QtWidgets/Interview" \ + "QtWidgets/Spreadsheet" \ + "QtWidgets/Pixelator Example" \ + "QtWidgets/Class Wizard Example" \ + "QtWidgets/Animated Tiles Example" \ + "QtWidgets/Basic Layouts Example" \ + "QtWidgets/Application Example" \ + "QtWidgets/Affine Transformations" \ + "QtWidgets/Image Composition Example" \ + "QtWidgets/Basic Drawing Example" \ + "QtWidgets/Vector Deformation" \ + "QtWidgets/Painter Paths Example" \ + "QtWidgets/Text Edit" \ + "QtWidgets/Style Sheet Example" \ + "QtWidgets/Code Editor Example" \ + "QtWidgets/Window Flags Example" \ + "QtWidgets/Scribble Example" \ + "QtWidgets/Shaped Clock Example" \ + "QtWidgets/Line Edits Example" \ + "QtWidgets/Calendar Widget Example" \ + "QtWidgets/Completer Example" \ + "QtWidgets/I18N Example" \ + "QtQML/Extending QML - Grouped Properties Example" \ + "QtQML/Extending QML - Methods Example" \ + "QtQML/Extending QML - Signal Support Example" \ + "QtQML/Extending QML - Attached Properties Example" \ + "QtQuick/Qt Quick Examples - Window and Screen" \ + "QtWidgets/Address Book Example" + +manifestmeta.android.tags = android -- cgit v1.2.3 From f5e0ec5e16506166ba6a83d0e024a65a219035b8 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 19 Jun 2013 11:14:51 +0200 Subject: update QtNetwork changelog for 5.1.0 Change-Id: I6392fd125657c4a4a3abb4607fa31bb0d8c0fdd6 Reviewed-by: Richard J. Moore --- dist/changes-5.1.0 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0 index cb96c2debe..bc0db0b9c8 100644 --- a/dist/changes-5.1.0 +++ b/dist/changes-5.1.0 @@ -88,7 +88,16 @@ QtGui QtNetwork --------- - - + - QNetworkAccessManager / QNetworkReply: + * Add a new encrypted() signal so that applications can perform + additional checks on the certificate chain. + - QSslSocket: + * Support for sending intermediate certificates when QSslSocket is used + as a server, and when using client certificates. + - HTTPS internals: + * SSL sessions are re-used by default. + - QHostInfo: + * Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache. QtWidgets --------- -- cgit v1.2.3 From 172fa29dffef0eb55378f62b3ea1c18810639b3f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 19 Jun 2013 18:07:40 +0200 Subject: fix LD_LIBRARY_PATH manipulation in uic calls not being make-escaped the evaluator has the bug that function arguments are inherited. work around that by passing an explicitly empty 3rd parameter to qtAddTargetEnv(). proper fix upcoming in less critical branch. Change-Id: Ic45cc890abaa6271985590d4ebe02c96bff6dec4 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 63ae62c42e..699c42ee1f 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -210,7 +210,7 @@ defineTest(qtPrepareTool) { qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) } $$1 = $$shell_path($$eval($$1)) - qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) + qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, ) } # target variable, list of env var names, [non-empty: prepare for system(), not make] -- cgit v1.2.3