summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-29 12:58:32 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-29 12:58:41 +0200
commite66d181e659a08d19ab7d144c3ba0619d537de83 (patch)
tree7367e93797cb9a2a331f0741baed5a1cad2c96b6 /src/gui
parent4758555f3e44af3425f0b691dc38fb40f3c9413d (diff)
parent75aea3ff5eec4a5c8f4184e14a90f4a5e3a577b0 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qclipboard.cpp4
-rw-r--r--src/gui/kernel/qguiapplication.cpp6
-rw-r--r--src/gui/kernel/qwindow.cpp2
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp14
-rw-r--r--src/gui/painting/qbackingstore.cpp1
-rw-r--r--src/gui/painting/qdrawhelper.cpp7
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp19
-rw-r--r--src/gui/painting/qplatformbackingstore.h4
-rw-r--r--src/gui/text/qrawfont.cpp16
9 files changed, 61 insertions, 12 deletions
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index ec6c0bcc36..21127eebbd 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -438,6 +438,10 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode)
The text(), image(), and pixmap() functions are simpler
wrappers for retrieving text, image, and pixmap data.
+ \note The pointer returned might become invalidated when the contents
+ of the clipboard changes; either by calling one of the setter functions
+ or externally by the system clipboard changing.
+
\sa setMimeData()
*/
const QMimeData* QClipboard::mimeData(Mode mode) const
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 16add8f627..d8457bc041 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1203,12 +1203,6 @@ static void init_plugins(const QList<QByteArray> &pluginList)
void QGuiApplicationPrivate::createPlatformIntegration()
{
- // Use the Qt menus by default. Platform plugins that
- // want to enable a native menu implementation can clear
- // this flag.
- QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
-
-
QHighDpiScaling::initHighDpiScaling();
// Load the platform integration
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 23e783fcb4..edb65a2d4c 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2395,7 +2395,7 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
bool lastWindowClosed = true;
for (int i = 0; i < list.size(); ++i) {
QWindow *w = list.at(i);
- if (!w->isVisible() || w->transientParent())
+ if (!w->isVisible() || w->transientParent() || w->type() == Qt::ToolTip)
continue;
lastWindowClosed = false;
break;
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index c0c0bb0a03..6f5aff14aa 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -584,16 +584,26 @@ bool QOpenGLShader::compileSourceCode(const char *source)
QVarLengthArray<const char *, 5> sourceChunks;
QVarLengthArray<GLint, 5> sourceChunkLengths;
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (versionDirectivePosition.hasPosition()) {
- // Append source up to #version directive
+ // Append source up to and including the #version directive
sourceChunks.append(source);
sourceChunkLengths.append(GLint(versionDirectivePosition.position));
+ } else {
+ // QTBUG-55733: Intel on Windows with Compatibility profile requires a #version always
+ if (ctx->format().profile() == QSurfaceFormat::CompatibilityProfile) {
+ const char *vendor = reinterpret_cast<const char *>(ctx->functions()->glGetString(GL_VENDOR));
+ if (vendor && !strcmp(vendor, "Intel")) {
+ static const char version110[] = "#version 110\n";
+ sourceChunks.append(version110);
+ sourceChunkLengths.append(GLint(sizeof(version110)) - 1);
+ }
+ }
}
// The precision qualifiers are useful on OpenGL/ES systems,
// but usually not present on desktop systems.
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
const QSurfaceFormat currentSurfaceFormat = ctx->format();
QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(QOpenGLContext::currentContext());
if (currentSurfaceFormat.renderableType() == QSurfaceFormat::OpenGL
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index e3d18512dd..ceaad61e13 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -138,6 +138,7 @@ QBackingStore::QBackingStore(QWindow *window)
: d_ptr(new QBackingStorePrivate(window))
{
d_ptr->platformBackingStore = QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(window);
+ d_ptr->platformBackingStore->setBackingStore(this);
}
/*!
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 7685f7f4ca..3e01d34cb2 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -5331,15 +5331,16 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)
int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);
int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));
- QRgba64 oldColor = data->solid.color;
+ // Save the fillData since we overwrite it when setting solid.color.
+ QGradientData gradient = data->gradient;
while (count--) {
int y = spans->y;
- data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off));
+ data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off));
blend_color_rgb16(1, spans, userData);
++spans;
}
- data->solid.color = oldColor;
+ data->gradient = gradient;
} else {
blend_src_generic(count, spans, userData);
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 0c5de36981..b8bbdefa37 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -77,6 +77,7 @@ class QPlatformBackingStorePrivate
public:
QPlatformBackingStorePrivate(QWindow *w)
: window(w)
+ , backingStore(0)
#ifndef QT_NO_OPENGL
, textureId(0)
, blitter(0)
@@ -100,6 +101,7 @@ public:
#endif
}
QWindow *window;
+ QBackingStore *backingStore;
#ifndef QT_NO_OPENGL
mutable GLuint textureId;
mutable QSize textureSize;
@@ -623,6 +625,23 @@ QWindow* QPlatformBackingStore::window() const
}
/*!
+ Sets the backing store associated with this surface.
+*/
+void QPlatformBackingStore::setBackingStore(QBackingStore *backingStore)
+{
+ d_ptr->backingStore = backingStore;
+}
+
+/*!
+ Returns a pointer to the backing store associated with this
+ surface.
+*/
+QBackingStore *QPlatformBackingStore::backingStore() const
+{
+ return d_ptr->backingStore;
+}
+
+/*!
This function is called before painting onto the surface begins,
with the \a region in which the painting will occur.
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index 8d0e29ad8d..ec56aaa002 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -112,6 +112,7 @@ public:
virtual ~QPlatformBackingStore();
QWindow *window() const;
+ QBackingStore *backingStore() const;
virtual QPaintDevice *paintDevice() = 0;
@@ -145,6 +146,9 @@ public:
private:
QPlatformBackingStorePrivate *d_ptr;
+
+ void setBackingStore(QBackingStore *);
+ friend class QBackingStore;
};
#ifndef QT_NO_OPENGL
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 4d567b26c2..886cf5ef39 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -324,6 +324,13 @@ bool QRawFont::operator==(const QRawFont &other) const
/*!
Returns the ascent of this QRawFont in pixel units.
+ The ascent of a font is the distance from the baseline to the
+ highest position characters extend to. In practice, some font
+ designers break this rule, e.g. when they put more than one accent
+ on top of a character, or to accommodate an unusual character in
+ an exotic language, so it is possible (though rare) that this
+ value will be too small.
+
\sa QFontMetricsF::ascent()
*/
qreal QRawFont::ascent() const
@@ -351,6 +358,11 @@ qreal QRawFont::capHeight() const
/*!
Returns the descent of this QRawFont in pixel units.
+ The descent is the distance from the base line to the lowest point
+ characters extend to. In practice, some font designers break this rule,
+ e.g. to accommodate an unusual character in an exotic language, so
+ it is possible (though rare) that this value will be too small.
+
\sa QFontMetricsF::descent()
*/
qreal QRawFont::descent() const
@@ -361,6 +373,8 @@ qreal QRawFont::descent() const
/*!
Returns the xHeight of this QRawFont in pixel units.
+ This is often but not always the same as the height of the character 'x'.
+
\sa QFontMetricsF::xHeight()
*/
qreal QRawFont::xHeight() const
@@ -371,6 +385,8 @@ qreal QRawFont::xHeight() const
/*!
Returns the leading of this QRawFont in pixel units.
+ This is the natural inter-line spacing.
+
\sa QFontMetricsF::leading()
*/
qreal QRawFont::leading() const