diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 18 | ||||
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qopenglcontext_p.h | 7 | ||||
-rw-r--r-- | src/gui/kernel/qplatformmenu.h | 5 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 4 |
5 files changed, 28 insertions, 9 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index ab71fe9081..8ccff4321d 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -466,7 +466,14 @@ static QWindowGeometrySpecification windowGeometrySpecification; \section1 Supported Command Line Options - All Qt programs automatically support the following command line options: + All Qt programs automatically support a set of command-line options that + allow modifying the way Qt will interact with the windowing system. Some of + the options are also accessible via environment variables, which are the + preferred form if the application can launch GUI sub-processes or other + applications (environment variables will be inherited by child processes). + When in doubt, use the environment variables. + + The options currently supported are the following: \list \li \c{-platform} \e {platformName[:options]}, specifies the @@ -489,18 +496,21 @@ static QWindowGeometrySpecification windowGeometrySpecification; \li \c {-qwindowgeometry} \e geometry, specifies window geometry for the main window using the X11-syntax. For example: \c {-qwindowgeometry 100x100+50+50} + \li \c {-qwindowtitle}, sets the title of the first window \li \c{-reverse}, sets the application's layout direction to - Qt::RightToLeft + Qt::RightToLeft. This option is intended to aid debugging and should + not be used in production. The default value is automatically detected + from the user's locale (see also QLocale::textDirection()). \li \c{-session} \e session, restores the application from an earlier \l{Session Management}{session}. - \li -qwindowgeometry, sets the geometry of the first window - \li -qwindowtitle, sets the title of the first window \endlist The following standard command line options are available for X11: \list \li \c {-display} \e {hostname:screen_number}, switches displays on X11. + + Overrides the \c DISPLAY environment variable. \li \c {-geometry} \e geometry, same as \c {-qwindowgeometry}. \endlist diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 1af5c09fd2..be592153d2 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1345,7 +1345,8 @@ void QOpenGLSharedResourceGuard::freeResource(QOpenGLContext *context) QOpenGLMultiGroupSharedResource instance. */ QOpenGLMultiGroupSharedResource::QOpenGLMultiGroupSharedResource() - : active(0) + : active(0), + m_mutex(QMutex::Recursive) { #ifdef QT_GL_CONTEXT_RESOURCE_DEBUG qDebug("Creating context group resource object %p.", this); diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index b21ff67068..711a3b1b2f 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -127,7 +127,7 @@ private: class Q_GUI_EXPORT QOpenGLContextGroupPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QOpenGLContextGroup); + Q_DECLARE_PUBLIC(QOpenGLContextGroup) public: QOpenGLContextGroupPrivate() : m_context(0) @@ -171,7 +171,9 @@ public: template <typename T> T *value(QOpenGLContext *context) { QOpenGLContextGroup *group = context->shareGroup(); - QMutexLocker locker(&group->d_func()->m_mutex); + // Have to use our own mutex here, not the group's, since + // m_groups has to be protected too against any concurrent access. + QMutexLocker locker(&m_mutex); T *resource = static_cast<T *>(group->d_func()->m_resources.value(this, 0)); if (!resource) { resource = new T(context); @@ -183,6 +185,7 @@ public: private: QAtomicInt active; QList<QOpenGLContextGroup *> m_groups; + QMutex m_mutex; }; class QPaintEngineEx; diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h index 19e2d9bccf..b88f2a7e84 100644 --- a/src/gui/kernel/qplatformmenu.h +++ b/src/gui/kernel/qplatformmenu.h @@ -86,6 +86,9 @@ public: virtual void setChecked(bool isChecked) = 0; virtual void setShortcut(const QKeySequence& shortcut) = 0; virtual void setEnabled(bool enabled) = 0; + + virtual void setNativeContents(WId item) { Q_UNUSED(item); } + Q_SIGNALS: void activated(); void hovered(); @@ -118,6 +121,8 @@ public: setVisible(true); } + virtual void dismiss() { } // Closes this and all its related menu popups + virtual QPlatformMenuItem *menuItemAt(int position) const = 0; virtual QPlatformMenuItem *menuItemForTag(quintptr tag) const = 0; diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 6dcc3df166..40e9b9723a 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -455,7 +455,7 @@ void QWindow::setVisible(bool visible) } #ifndef QT_NO_CURSOR - if (visible && d->hasCursor) + if (visible && (d->hasCursor || QGuiApplication::overrideCursor())) d->applyCursor(); #endif d->platformWindow->setVisible(visible); @@ -743,7 +743,7 @@ void QWindow::setTitle(const QString &title) d->windowTitle = title; changed = true; } - if (d->platformWindow) + if (d->platformWindow && type() != Qt::Desktop) d->platformWindow->setWindowTitle(title); if (changed) emit windowTitleChanged(title); |