diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qzip.cpp | 12 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 9 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 4 | ||||
-rw-r--r-- | src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 6 | ||||
-rw-r--r-- | src/widgets/styles/qgtkstyle.cpp | 3 |
6 files changed, 27 insertions, 13 deletions
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp index 9e37330381..151b0bcfeb 100644 --- a/src/gui/text/qzip.cpp +++ b/src/gui/text/qzip.cpp @@ -1302,7 +1302,7 @@ QFile::Permissions QZipWriter::creationPermissions() const */ void QZipWriter::addFile(const QString &fileName, const QByteArray &data) { - d->addEntry(QZipWriterPrivate::File, fileName, data); + d->addEntry(QZipWriterPrivate::File, QDir::fromNativeSeparators(fileName), data); } /*! @@ -1324,7 +1324,7 @@ void QZipWriter::addFile(const QString &fileName, QIODevice *device) return; } } - d->addEntry(QZipWriterPrivate::File, fileName, device->readAll()); + d->addEntry(QZipWriterPrivate::File, QDir::fromNativeSeparators(fileName), device->readAll()); if (opened) device->close(); } @@ -1335,10 +1335,10 @@ void QZipWriter::addFile(const QString &fileName, QIODevice *device) */ void QZipWriter::addDirectory(const QString &dirName) { - QString name = dirName; + QString name(QDir::fromNativeSeparators(dirName)); // separator is mandatory - if (!name.endsWith(QDir::separator())) - name.append(QDir::separator()); + if (!name.endsWith(QLatin1Char('/'))) + name.append(QLatin1Char('/')); d->addEntry(QZipWriterPrivate::Directory, name, QByteArray()); } @@ -1349,7 +1349,7 @@ void QZipWriter::addDirectory(const QString &dirName) */ void QZipWriter::addSymLink(const QString &fileName, const QString &destination) { - d->addEntry(QZipWriterPrivate::Symlink, fileName, QFile::encodeName(destination)); + d->addEntry(QZipWriterPrivate::Symlink, QDir::fromNativeSeparators(fileName), QFile::encodeName(destination)); } /*! diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index d9d8396011..d25372ece6 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -164,6 +164,9 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, int id = theIdCounter.fetchAndAddRelaxed(1); // generate unique ID if (name.isEmpty()) { + if (!receiver) + return -1; + QHostInfo hostInfo(id); hostInfo.setError(QHostInfo::HostNotFound); hostInfo.setErrorString(QCoreApplication::translate("QHostInfo", "No host name given")); @@ -183,6 +186,9 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, bool valid = false; QHostInfo info = manager->cache.get(name, &valid); if (valid) { + if (!receiver) + return -1; + info.setLookupId(id); QHostInfoResult result; QObject::connect(&result, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); @@ -193,7 +199,8 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, // cache is not enabled or it was not in the cache, do normal lookup QHostInfoRunnable* runnable = new QHostInfoRunnable(name, id); - QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); + if (receiver) + QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); manager->scheduleLookup(runnable); } return id; diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 7391cbf9df..ef5bdbbf0d 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -361,9 +361,9 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo static QHash<QString, QStringList> fallbackLists; -#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_6_0) +#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_6_0) // CTFontCopyDefaultCascadeListForLanguages is available in the SDK - #if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_6_0) + #if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_8, __IPHONE_6_0) // But we have to feature check at runtime if (&CTFontCopyDefaultCascadeListForLanguages) #endif diff --git a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h index 2c5381aec8..08af59b2a4 100644 --- a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h +++ b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.h @@ -74,7 +74,7 @@ private: static void onColorChanged(QGtk2ColorDialogHelper *helper); void applyOptions(); - mutable QScopedPointer<QGtk2Dialog> d; + QScopedPointer<QGtk2Dialog> d; }; class QGtk2FileDialogHelper : public QPlatformFileDialogHelper @@ -111,7 +111,7 @@ private: QStringList _selection; QHash<QString, GtkFileFilter*> _filters; QHash<GtkFileFilter*, QString> _filterNames; - mutable QScopedPointer<QGtk2Dialog> d; + QScopedPointer<QGtk2Dialog> d; }; class QGtk2FontDialogHelper : public QPlatformFontDialogHelper @@ -135,7 +135,7 @@ private Q_SLOTS: private: void applyOptions(); - mutable QScopedPointer<QGtk2Dialog> d; + QScopedPointer<QGtk2Dialog> d; }; QT_END_NAMESPACE diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index d7b9d8c5fb..c543303024 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -356,6 +356,12 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) // the popup disappeared, replay the mouse press event QWidget *w = QApplication::widgetAt(event->globalPos()); if (w && !QApplicationPrivate::isBlockedByModal(w)) { + // activate window of the widget under mouse pointer + if (!w->isActiveWindow()) { + w->activateWindow(); + w->raise(); + } + QWindow *win = w->windowHandle(); if (!win) win = w->nativeParentWidget()->windowHandle(); diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp index 52c1e2376c..caa41db451 100644 --- a/src/widgets/styles/qgtkstyle.cpp +++ b/src/widgets/styles/qgtkstyle.cpp @@ -3173,7 +3173,8 @@ void QGtkStyle::drawControl(ControlElement element, #ifndef QT_NO_COMBOBOX - if (qobject_cast<const QComboBox*>(widget)) + if (qobject_cast<const QComboBox*>(widget) || + option->styleObject && option->styleObject->property("_q_isComboBoxPopupItem").toBool()) ignoreCheckMark = true; // Ignore the checkmarks provided by the QComboMenuDelegate #endif |