summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qdrag.cpp2
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qoffscreensurface.cpp8
-rw-r--r--src/gui/kernel/qopenglcontext.cpp4
-rw-r--r--src/gui/kernel/qopenglcontext_p.h1
-rw-r--r--src/gui/kernel/qsessionmanager.cpp8
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp11
8 files changed, 26 insertions, 14 deletions
diff --git a/src/gui/kernel/qdrag.cpp b/src/gui/kernel/qdrag.cpp
index 465c04cdc8..d7fd4d5bc0 100644
--- a/src/gui/kernel/qdrag.cpp
+++ b/src/gui/kernel/qdrag.cpp
@@ -101,7 +101,7 @@ QT_BEGIN_NAMESPACE
\l{QWidget::mouseMoveEvent()}{mouseMoveEvent()} to check whether a QDrag is
required.
- \sa {Drag and Drop}, QClipboard, QMimeData, QWindowsMime, QMacPasteboardMime,
+ \sa {Drag and Drop}, QClipboard, QMimeData, QMacPasteboardMime,
{Draggable Icons Example}, {Draggable Text Example}, {Drop Site Example},
{Fridge Magnets Example}
*/
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 92d9871dc5..bb7000a266 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -628,7 +628,7 @@ QHoverEvent::~QHoverEvent()
\a modifiers holds the keyboard modifier flags at the time of the
event, and \a orient holds the wheel's orientation.
- \sa pos(), pixelDelta(), angleDelta(), state()
+ \sa pos(), pixelDelta(), angleDelta()
*/
#ifndef QT_NO_WHEELEVENT
QWheelEvent::QWheelEvent(const QPointF &pos, int delta,
@@ -659,7 +659,7 @@ QWheelEvent::~QWheelEvent()
\a orient holds the wheel's orientation.
- \sa pos(), pixelDelta(), angleDelta(), state()
+ \sa pos(), pixelDelta(), angleDelta()
*/
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp
index ce913a98af..1625909843 100644
--- a/src/gui/kernel/qoffscreensurface.cpp
+++ b/src/gui/kernel/qoffscreensurface.cpp
@@ -71,6 +71,14 @@ QT_BEGIN_NAMESPACE
How the offscreen surface is implemented depends on the underlying platform, but it will
typically use a pixel buffer (pbuffer). If the platform doesn't implement or support
offscreen surfaces, QOffscreenSurface will use an invisible QWindow internally.
+
+ \note In order to create an offscreen surface that is guaranteed to be compatible with
+ a given context and window, make sure to set the format to the context's or the
+ window's actual format, that is, the QSurfaceFormat returned from
+ QOpenGLContext::format() or QWindow::format() \e{after the context or window has been
+ created}. Passing the format returned from QWindow::requestedFormat() to setFormat()
+ may result in an incompatible offscreen surface since the underlying windowing system
+ interface may offer a different set of configurations for window and pbuffer surfaces.
*/
class Q_GUI_EXPORT QOffscreenSurfacePrivate : public QObjectPrivate
{
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 5087e33b47..e258218e85 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -165,7 +165,7 @@ void QOpenGLVersionProfile::setVersion(int majorVersion, int minorVersion)
/*!
Returns the OpenGL profile. Only makes sense if profiles are supported by this version.
- \sa setProfile(), supportsProfiles()
+ \sa setProfile()
*/
QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile() const
{
@@ -176,7 +176,7 @@ QSurfaceFormat::OpenGLContextProfile QOpenGLVersionProfile::profile() const
Sets the OpenGL profile \a profile. Only makes sense if profiles are supported by
this version.
- \sa profile(), supportsProfiles()
+ \sa profile()
*/
void QOpenGLVersionProfile::setProfile(QSurfaceFormat::OpenGLContextProfile profile)
{
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index 07729e0e73..23c13b2e24 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -171,6 +171,7 @@ public:
template <typename T>
T *value(QOpenGLContext *context) {
QOpenGLContextGroup *group = context->shareGroup();
+ QMutexLocker locker(&group->d_func()->m_mutex);
T *resource = static_cast<T *>(group->d_func()->m_resources.value(this, 0));
if (!resource) {
resource = new T(context);
diff --git a/src/gui/kernel/qsessionmanager.cpp b/src/gui/kernel/qsessionmanager.cpp
index b9ef35854c..a428840ca8 100644
--- a/src/gui/kernel/qsessionmanager.cpp
+++ b/src/gui/kernel/qsessionmanager.cpp
@@ -201,7 +201,7 @@ QString QSessionManager::sessionKey() const
Here's an example of how an application's QGuiApplication::commitDataRequest()
might be implemented:
- \snippet code/src_gui_kernel_qguiapplication.cpp 8
+ \snippet code/src_gui_kernel_qguiapplication.cpp 1
If an error occurred within the application while saving its data, you may
want to try allowsErrorInteraction() instead.
@@ -293,7 +293,7 @@ QSessionManager::RestartHint QSessionManager::restartHint() const
If the session manager is capable of restoring sessions it will execute
\a command in order to restore the application. The command defaults to
- \snippet code/src_gui_kernel_qguiapplication.cpp 9
+ \snippet code/src_gui_kernel_qguiapplication.cpp 2
The \c -session option is mandatory; otherwise QGuiApplication cannot
tell whether it has been restored or what the current session identifier
@@ -321,7 +321,7 @@ void QSessionManager::setRestartCommand(const QStringList &command)
To iterate over the list, you can use the \l foreach pseudo-keyword:
- \snippet code/src_gui_kernel_qguiapplication.cpp 10
+ \snippet code/src_gui_kernel_qguiapplication.cpp 3
\sa setRestartCommand(), restartHint()
*/
@@ -347,7 +347,7 @@ void QSessionManager::setDiscardCommand(const QStringList &command)
To iterate over the list, you can use the \l foreach pseudo-keyword:
- \snippet code/src_gui_kernel_qguiapplication.cpp 11
+ \snippet code/src_gui_kernel_qguiapplication.cpp 4
\sa setDiscardCommand(), restartCommand(), setRestartCommand()
*/
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 23c0e59779..2b8e611dff 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -387,7 +387,7 @@ void QSurfaceFormat::setOption(QSurfaceFormat::FormatOption option, bool on)
Returns true if the format option \a option is set; otherwise returns false.
- \sa options(), testOption()
+ \sa options()
*/
bool QSurfaceFormat::testOption(QSurfaceFormat::FormatOption option) const
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index fd9e0ad61b..13da58e391 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -159,10 +159,6 @@ QWindow::QWindow(QScreen *targetScreen)
d->screen = targetScreen;
if (!d->screen)
d->screen = QGuiApplication::primaryScreen();
-
- //if your applications aborts here, then chances are your creating a QWindow before the
- //screen list is populated.
- Q_ASSERT(d->screen);
d->init();
}
@@ -232,6 +228,13 @@ QWindow::~QWindow()
void QWindowPrivate::init()
{
Q_Q(QWindow);
+
+ // If your application aborts here, you are probably creating a QWindow
+ // before the screen list is populated.
+ if (!screen) {
+ qFatal("Cannot create window: no screens available");
+ exit(1);
+ }
QObject::connect(screen, SIGNAL(destroyed(QObject*)), q, SLOT(screenDestroyed(QObject*)));
QGuiApplicationPrivate::window_list.prepend(q);
}