diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 7 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 7 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetbackingstore.cpp | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qrubberband.cpp | 2 |
5 files changed, 13 insertions, 18 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 1c3a793234..804331b1cd 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -1004,7 +1004,11 @@ void QFileDialog::setDirectory(const QString &directory) QDir QFileDialog::directory() const { Q_D(const QFileDialog); - return QDir(d->nativeDialogInUse ? d->directory_sys().toLocalFile() : d->rootPath()); + if (d->nativeDialogInUse) { + QString dir = d->directory_sys().toLocalFile(); + return QDir(dir.isEmpty() ? d->options->initialDirectory().toLocalFile() : dir); + } + return d->rootPath(); } /*! diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index f7f7cf1039..dcf6aed591 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -279,13 +279,12 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge // (and reaches this point), then the menu item itself has been disabled. // This occurs at the QPA level on Mac, were we disable all the Cocoa menus // when showing a modal window. - Q_UNUSED(menu); - continue; -#else + if (a->shortcut().count() <= 1) + continue; +#endif QAction *a = menu->menuAction(); if (correctActionContext(context, a, active_window)) return true; -#endif } else #endif if (correctWidgetContext(context, w, active_window)) diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 3281e0c6f7..0fd794cc02 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -118,11 +118,12 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO win->resize(q->size()); win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0)); - if (q->testAttribute(Qt::WA_TranslucentBackground)) { - QSurfaceFormat format; + QSurfaceFormat format = win->requestedFormat(); + if ((flags & Qt::Window) && win->surfaceType() != QSurface::OpenGLSurface + && q->testAttribute(Qt::WA_TranslucentBackground)) { format.setAlphaBufferSize(8); - win->setFormat(format); } + win->setFormat(format); if (QWidget *nativeParent = q->nativeParentWidget()) { if (nativeParent->windowHandle()) { diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 9fcd14e813..8e3e2a00b0 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -66,15 +66,6 @@ QT_BEGIN_NAMESPACE extern QRegion qt_dirtyRegion(QWidget *); -/* - A version of QRect::intersects() that does not normalize the rects. -*/ -static inline bool qRectIntersects(const QRect &r1, const QRect &r2) -{ - return (qMax(r1.left(), r2.left()) <= qMin(r1.right(), r2.right()) - && qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom())); -} - /** * Flushes the contents of the \a backingStore into the screen area of \a widget. * \a tlwOffset is the position of the top level widget relative to the window surface. diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp index 112a9b66cd..ea58d45e46 100644 --- a/src/widgets/widgets/qrubberband.cpp +++ b/src/widgets/widgets/qrubberband.cpp @@ -86,7 +86,7 @@ void QRubberBand::initStyleOption(QStyleOptionRubberBand *option) const return; option->initFrom(this); option->shape = d_func()->shape; -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC option->opaque = true; #else option->opaque = windowFlags() & RUBBERBAND_WINDOW_TYPE; |