diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-06-25 13:52:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-25 14:31:00 +0200 |
commit | 851fae6dbe08785ebb8be3732c40fbe1a5a280a0 (patch) | |
tree | f3422ef7eadff27175ba11d6b9f2ae784280ce80 /src | |
parent | 6f0d258424a6c95a30ad63ae563f38e38ef47d7c (diff) | |
parent | 533820320c30fca6028415321d1a3b937a261088 (diff) |
Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 1 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 11 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 13 | ||||
-rw-r--r-- | src/corelib/plugin/qfactoryloader.cpp | 19 | ||||
-rw-r--r-- | src/gui/Qt5GuiConfigExtras.cmake.in | 7 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/android/src/androidjniinput.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 16 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 2 | ||||
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 6 | ||||
-rw-r--r-- | src/widgets/dialogs/qmessagebox.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 5 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qdockwidget.cpp | 2 |
15 files changed, 60 insertions, 44 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/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/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 61c9b40e83..c617325e9e 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -72,7 +72,6 @@ public: QByteArray iid; QList<QLibraryPrivate*> libraryList; QMap<QString,QLibraryPrivate*> keyMap; - QStringList keyList; QString suffix; Qt::CaseSensitivity cs; QStringList loadedPaths; @@ -176,10 +175,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; @@ -190,15 +187,13 @@ 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, // 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) { @@ -207,9 +202,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; - d->keyList += keys.at(k); + ++keyUsageCount; } } + if (keyUsageCount || keys.isEmpty()) + d->libraryList += library; + else + library->release(); } } #else 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 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': 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/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index a0dac445be..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; @@ -274,6 +279,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview) - (void)showModelessPanel { mDialogIsExecuting = false; + mResultSet = false; [mColorPanel makeKeyAndOrderFront:mColorPanel]; } @@ -367,10 +373,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); } @@ -433,9 +437,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal createNSColorPanelDelegate(); QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(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/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index f7c473de88..6e5a9ccbb4 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, 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() */ 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; } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 1c4ae9c8a2..c6bd387a90 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1548,10 +1548,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; @@ -10122,6 +10123,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)); diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index ae931deb16..7cd7172ef5 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; |