summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-22 11:08:32 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-22 21:19:57 +0200
commit28628a5d5e6c55512759ceafc644aa31e444b781 (patch)
tree221d1ab0995afe0d441f1ddb433aee985f6d41ea /src/gui/kernel
parentcbb2ba23e203374132e4b134b1c8f1a3626d2378 (diff)
parent686c44a69b13f6e884dd2b6d9991f4cd94597c5a (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/plugins/platforms/eglfs/qeglfshooks.cpp Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
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;