summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qclipboard.cpp5
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp12
2 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index bb3895c2f5..cf98bba54c 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -425,8 +425,9 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode)
/*!
\fn QMimeData *QClipboard::mimeData(Mode mode) const
- Returns a reference to a QMimeData representation of the current
- clipboard data.
+ Returns a pointer to a QMimeData representation of the current
+ clipboard data (can be NULL if the given \a mode is not
+ supported by the platform).
The \a mode argument is used to control which part of the system
clipboard is used. If \a mode is QClipboard::Clipboard, the
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index dd742b6007..000d727380 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -42,6 +42,7 @@
#include <QtCore/qatomic.h>
#include <QtCore/QDebug>
#include <QOpenGLContext>
+#include <QtGui/qguiapplication.h>
#ifdef major
#undef major
@@ -763,10 +764,13 @@ Q_GLOBAL_STATIC(QSurfaceFormat, qt_default_surface_format)
void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &format)
{
#ifndef QT_NO_OPENGL
- QOpenGLContext *globalContext = QOpenGLContext::globalShareContext();
- if (globalContext && globalContext->isValid()) {
- qWarning("Warning: Setting a new default format with a different version or profile after "
- "the global shared context is created may cause issues with context sharing.");
+ if (qApp) {
+ QOpenGLContext *globalContext = QOpenGLContext::globalShareContext();
+ if (globalContext && globalContext->isValid()) {
+ qWarning("Warning: Setting a new default format with a different version or profile "
+ "after the global shared context is created may cause issues with context "
+ "sharing.");
+ }
}
#endif
*qt_default_surface_format() = format;