summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-05-14 18:43:38 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-14 18:43:38 +0200
commit70cd276db01de8a9ccabb60282f00068b3840b88 (patch)
treeffeae752c77d0e0074b59fe5c3c682d2842e459e /src
parent800214f0b9cbbbc7b77a12180ce59033dd3cca64 (diff)
parent3d4aeb791990f359e277efbfb0a1f1793945b55d (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp2
-rw-r--r--src/angle/patches/0017-ANGLE-D3D11-Don-t-use-mipmaps-in-level-9-textures.patch31
-rw-r--r--src/corelib/io/qtemporarydir.cpp14
-rw-r--r--src/corelib/io/qtextstream.cpp4
-rw-r--r--src/corelib/kernel/kernel.pri10
-rw-r--r--src/corelib/tools/qdatetime.cpp21
-rw-r--r--src/gui/kernel/qguiapplication.cpp20
-rw-r--r--src/gui/kernel/qopenglcontext.cpp3
-rw-r--r--src/gui/kernel/qopenglcontext_p.h5
-rw-r--r--src/gui/opengl/qopengl.h10
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp31
-rw-r--r--src/gui/text/qfontdatabase.cpp6
-rw-r--r--src/gui/text/qtextlayout.cpp1
-rw-r--r--src/network/access/qspdyprotocolhandler.cpp6
-rw-r--r--src/network/ssl/qsslcontext.cpp23
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp24
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp5
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm9
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm5
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp7
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dcontext.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dhelpers.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp3
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp2
-rw-r--r--src/plugins/platforms/qnx/qnx.pro20
-rw-r--r--src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp4
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp3
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp21
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp30
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp81
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h9
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp13
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp12
-rw-r--r--src/testlib/qtestcase.cpp15
-rw-r--r--src/widgets/widgets/qmenu.cpp1
48 files changed, 257 insertions, 223 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
index fdfbe526ec..0c981ac503 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
@@ -257,7 +257,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum
D3D11_TEXTURE2D_DESC desc;
desc.Width = width; // Compressed texture size constraints?
desc.Height = height;
- desc.MipLevels = (levels > 0) ? levels + mLodOffset : 0;
+ desc.MipLevels = mRenderer->getFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 ? ((levels > 0) ? levels + mLodOffset : 0) : 1;
desc.ArraySize = 1;
desc.Format = mTextureFormat;
desc.SampleDesc.Count = 1;
diff --git a/src/angle/patches/0017-ANGLE-D3D11-Don-t-use-mipmaps-in-level-9-textures.patch b/src/angle/patches/0017-ANGLE-D3D11-Don-t-use-mipmaps-in-level-9-textures.patch
new file mode 100644
index 0000000000..200a8105de
--- /dev/null
+++ b/src/angle/patches/0017-ANGLE-D3D11-Don-t-use-mipmaps-in-level-9-textures.patch
@@ -0,0 +1,31 @@
+From 9632c57033b514bfb10a0dfa7ba51ec27a944616 Mon Sep 17 00:00:00 2001
+From: Andrew Knight <andrew.knight@digia.com>
+Date: Tue, 6 May 2014 13:35:14 +0300
+Subject: [PATCH] ANGLE D3D11: Don't use mipmaps in level 9 textures
+
+As the mipmaps levels aren't being generated on level 9, they shouldn't
+be used. Fall back to multisampled textures instead (which is the
+behavior for non-power-of-two textures anyway). This fixes an issue in
+which textured polygons (e.g. QML Images) turn black when scaled down.
+
+Change-Id: I648b8be473dc38f4e1b26724cbaff610e586fdbd
+---
+ src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
+index fdfbe52..0c981ac 100644
+--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
++++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/TextureStorage11.cpp
+@@ -257,7 +257,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum
+ D3D11_TEXTURE2D_DESC desc;
+ desc.Width = width; // Compressed texture size constraints?
+ desc.Height = height;
+- desc.MipLevels = (levels > 0) ? levels + mLodOffset : 0;
++ desc.MipLevels = mRenderer->getFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 ? ((levels > 0) ? levels + mLodOffset : 0) : 1;
+ desc.ArraySize = 1;
+ desc.Format = mTextureFormat;
+ desc.SampleDesc.Count = 1;
+--
+1.9.0.msysgit.0
+
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 2c526847b4..1e615956d7 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -218,25 +218,25 @@ QTemporaryDir::QTemporaryDir()
}
/*!
- Constructs a QTemporaryFile with a template name of \a templateName.
+ Constructs a QTemporaryDir with a template of \a templatePath.
- If \a templateName is a relative path, the path will be relative to the
+ If \a templatePath is a relative path, the path will be relative to the
current working directory. You can use QDir::tempPath() to construct \a
- templateName if you want use the system's temporary directory.
+ templatePath if you want use the system's temporary directory.
- If the \a templateName ends with XXXXXX it will be used as the dynamic portion
+ If the \a templatePath ends with XXXXXX it will be used as the dynamic portion
of the directory name, otherwise it will be appended.
Unlike QTemporaryFile, XXXXXX in the middle of the template string is not supported.
\sa QDir::tempPath()
*/
-QTemporaryDir::QTemporaryDir(const QString &templateName)
+QTemporaryDir::QTemporaryDir(const QString &templatePath)
: d_ptr(new QTemporaryDirPrivate)
{
- if (templateName.isEmpty())
+ if (templatePath.isEmpty())
d_ptr->create(defaultTemplateName());
else
- d_ptr->create(templateName);
+ d_ptr->create(templatePath);
}
/*!
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 163b087436..288a939ab2 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -569,7 +569,9 @@ void QTextStreamPrivate::flushWriteBuffer()
#endif
// convert from unicode to raw data
- QByteArray data = codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState);
+ // codec might be null if we're already inside global destructors (QTestCodec::codecForLocale returned null)
+ QByteArray data = Q_LIKELY(codec) ? codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState)
+ : writeBuffer.toLatin1();
#else
QByteArray data = writeBuffer.toLocal8Bit();
#endif
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 1fec528b31..819c10e99f 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -164,11 +164,17 @@ vxworks {
blackberry {
SOURCES += \
- kernel/qeventdispatcher_blackberry.cpp \
+ kernel/qeventdispatcher_blackberry.cpp
+ HEADERS += \
+ kernel/qeventdispatcher_blackberry_p.h
+}
+
+qqnx_pps {
+ LIBS_PRIVATE += -lpps
+ SOURCES += \
kernel/qppsattribute.cpp \
kernel/qppsobject.cpp
HEADERS += \
- kernel/qeventdispatcher_blackberry_p.h \
kernel/qppsattribute_p.h \
kernel/qppsattributeprivate_p.h \
kernel/qppsobject_p.h \
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index e38a5f569a..801876629c 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -253,7 +253,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-'))
.arg(qAbs(offset) / SECS_PER_HOUR, 2, 10, QLatin1Char('0'))
- .arg((offset / 60) % 60, 2, 10, QLatin1Char('0'));
+ .arg((qAbs(offset) / 60) % 60, 2, 10, QLatin1Char('0'));
}
// Parse offset in [+-]HH[:]MM format
@@ -265,17 +265,24 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
if (size < 2 || size > 6)
return 0;
+ // sign will be +1 for a positive and -1 for a negative offset
+ int sign;
+
// First char must be + or -
- const QChar sign = offsetString.at(0);
- if (sign != QLatin1Char('+') && sign != QLatin1Char('-'))
+ const QChar signChar = offsetString.at(0);
+ if (signChar == QLatin1Char('+'))
+ sign = 1;
+ else if (signChar == QLatin1Char('-'))
+ sign = -1;
+ else
return 0;
// Split the hour and minute parts
- QStringList parts = offsetString.split(QLatin1Char(':'));
+ QStringList parts = offsetString.mid(1).split(QLatin1Char(':'));
if (parts.count() == 1) {
// [+-]HHMM format
- parts.append(parts.at(0).mid(3));
- parts[0] = parts.at(0).left(3);
+ parts.append(parts.at(0).mid(2));
+ parts[0] = parts.at(0).left(2);
}
bool ok = false;
@@ -288,7 +295,7 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
return 0;
*valid = true;
- return ((hour * 60) + minute) * 60;
+ return sign * ((hour * 60) + minute) * 60;
}
/*****************************************************************************
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 2d5f717222..b49f5f00ce 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,19 +496,22 @@ 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 {-qwindowicon}, sets the default window icon
+ \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
- \li -qwindowicon, sets the default window icon
\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 9bc4373860..012e384d72 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1405,7 +1405,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 8c6a0a04ca..a7525c0e54 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -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/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index 731724b862..09bb6adf9a 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -133,17 +133,19 @@ typedef GLfloat GLdouble;
# endif // Q_OS_MAC
#endif // QT_OPENGL_ES_2
-// Desktops, apart from Mac OS X prior to 10.7 can support OpenGL 3
-// and desktops apart from Mac can support OpenGL 4
+// Desktops, apart from Mac OS X prior to 10.7 can support OpenGL 3.
+// Desktops, apart from Mac OS X prior to 10.9 can support OpenGL 4.
#if !defined(QT_OPENGL_ES_2)
# if !defined(Q_OS_MAC) || (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
# define QT_OPENGL_3
# define QT_OPENGL_3_2
# endif
-#if !defined(Q_OS_MAC)
+# if !defined(Q_OS_MAC) || (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9)
# define QT_OPENGL_4
+# endif
+# if !defined(Q_OS_MAC)
# define QT_OPENGL_4_3
-#endif
+# endif
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index ac88d9d3a5..f721d5cb8c 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -408,41 +408,14 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
#endif
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, fmt, GL_UNSIGNED_BYTE, mask.bits());
} else {
- // glTexSubImage2D() might cause some garbage to appear in the texture if the mask width is
- // not a multiple of four bytes. The bug appeared on a computer with 32-bit Windows Vista
- // and nVidia GeForce 8500GT. GL_UNPACK_ALIGNMENT is set to four bytes, 'mask' has a
- // multiple of four bytes per line, and most of the glyph shows up correctly in the
- // texture, which makes me think that this is a driver bug.
- // One workaround is to make sure the mask width is a multiple of four bytes, for instance
- // by converting it to a format with four bytes per pixel. Another is to copy one line at a
- // time.
-
-#if 0
- if (!ctx->d_func()->workaround_brokenAlphaTexSubImage_init) {
- // don't know which driver versions exhibit this bug, so be conservative for now
- const QByteArray versionString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
- glctx->d_func()->workaround_brokenAlphaTexSubImage = versionString.indexOf("NVIDIA") >= 0;
- glctx->d_func()->workaround_brokenAlphaTexSubImage_init = true;
- }
-#endif
-
-#if 0
- if (ctx->d_func()->workaround_brokenAlphaTexSubImage) {
- for (int i = 0; i < maskHeight; ++i)
- funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y + i, maskWidth, 1, GL_ALPHA, GL_UNSIGNED_BYTE, mask.scanLine(i));
- } else {
-#endif
-
+ // The scanlines in mask are 32-bit aligned, even for mono or 8-bit formats. This
+ // is good because it matches the default of 4 bytes for GL_UNPACK_ALIGNMENT.
#if !defined(QT_OPENGL_ES_2)
const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA;
#else
const GLenum format = GL_ALPHA;
#endif
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, format, GL_UNSIGNED_BYTE, mask.bits());
-
-#if 0
- }
-#endif
}
}
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 558258c30e..06438103ad 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -2501,10 +2501,14 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
if (!engine) {
if (!request.family.isEmpty()) {
+ QFont::StyleHint styleHint = QFont::StyleHint(request.styleHint);
+ if (styleHint == QFont::AnyStyle && request.fixedPitch)
+ styleHint = QFont::TypeWriter;
+
QStringList fallbacks = request.fallBackFamilies
+ fallbackFamilies(request.family,
QFont::Style(request.style),
- QFont::StyleHint(request.styleHint),
+ styleHint,
QChar::Script(script));
if (script > QChar::Script_Common)
fallbacks += QString(); // Find the first font matching the specified script.
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index c3cf2e56bb..84ad9038d5 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2810,7 +2810,6 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
break;
glyph_pos = gs;
edge = pos;
- break;
}
pos -= glyphs.effectiveAdvance(gs);
++gs;
diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp
index d204d498bf..ab703981ee 100644
--- a/src/network/access/qspdyprotocolhandler.cpp
+++ b/src/network/access/qspdyprotocolhandler.cpp
@@ -580,7 +580,7 @@ void QSpdyProtocolHandler::sendControlFrame(FrameType type,
{
// frame type and stream ID
char header[8];
- header[0] = 0x80; // leftmost bit == 1 -> is a control frame
+ header[0] = 0x80u; // leftmost bit == 1 -> is a control frame
header[1] = 0x03; // 3 bit == version 3
header[2] = 0;
switch (type) {
@@ -653,10 +653,10 @@ void QSpdyProtocolHandler::sendSYN_STREAM(HttpMessagePair messagePair,
prioAndSlot[0] = 0x00; // == prio 0 (highest)
break;
case QHttpNetworkRequest::NormalPriority:
- prioAndSlot[0] = 0x80; // == prio 4
+ prioAndSlot[0] = 0x80u; // == prio 4
break;
case QHttpNetworkRequest::LowPriority:
- prioAndSlot[0] = 0xe0; // == prio 7 (lowest)
+ prioAndSlot[0] = 0xe0u; // == prio 7 (lowest)
break;
}
prioAndSlot[1] = 0x00; // slot in client certificates (not supported currently)
diff --git a/src/network/ssl/qsslcontext.cpp b/src/network/ssl/qsslcontext.cpp
index 9c68218062..f5e5352d5e 100644
--- a/src/network/ssl/qsslcontext.cpp
+++ b/src/network/ssl/qsslcontext.cpp
@@ -214,22 +214,23 @@ init_context:
}
// Add all our CAs to this store.
- QList<QSslCertificate> expiredCerts;
foreach (const QSslCertificate &caCertificate, sslContext->sslConfiguration.caCertificates()) {
- // add expired certs later, so that the
- // valid ones are used before the expired ones
- if (caCertificate.expiryDate() < QDateTime::currentDateTime()) {
- expiredCerts.append(caCertificate);
- } else {
+ // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
+ //
+ // If several CA certificates matching the name, key identifier, and
+ // serial number condition are available, only the first one will be
+ // examined. This may lead to unexpected results if the same CA
+ // certificate is available with different expiration dates. If a
+ // ``certificate expired'' verification error occurs, no other
+ // certificate will be searched. Make sure to not have expired
+ // certificates mixed with valid ones.
+ //
+ // See also: QSslSocketBackendPrivate::verify()
+ if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
q_X509_STORE_add_cert(sslContext->ctx->cert_store, (X509 *)caCertificate.handle());
}
}
- // now add the expired certs
- foreach (const QSslCertificate &caCertificate, expiredCerts) {
- q_X509_STORE_add_cert(sslContext->ctx->cert_store, reinterpret_cast<X509 *>(caCertificate.handle()));
- }
-
if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
// tell OpenSSL the directories where to look up the root certs on demand
QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index b0d1ed2c4f..173d8eaa89 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -1633,23 +1633,23 @@ QList<QSslError> QSslSocketBackendPrivate::verify(QList<QSslCertificate> certifi
setDefaultCaCertificates(defaultCaCertificates() + systemCaCertificates());
}
- QList<QSslCertificate> expiredCerts;
-
foreach (const QSslCertificate &caCertificate, QSslSocket::defaultCaCertificates()) {
- // add expired certs later, so that the
- // valid ones are used before the expired ones
- if (caCertificate.expiryDate() < QDateTime::currentDateTime()) {
- expiredCerts.append(caCertificate);
- } else {
+ // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
+ //
+ // If several CA certificates matching the name, key identifier, and
+ // serial number condition are available, only the first one will be
+ // examined. This may lead to unexpected results if the same CA
+ // certificate is available with different expiration dates. If a
+ // ``certificate expired'' verification error occurs, no other
+ // certificate will be searched. Make sure to not have expired
+ // certificates mixed with valid ones.
+ //
+ // See also: QSslContext::fromConfiguration()
+ if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
q_X509_STORE_add_cert(certStore, reinterpret_cast<X509 *>(caCertificate.handle()));
}
}
- // now add the expired certs
- foreach (const QSslCertificate &caCertificate, expiredCerts) {
- q_X509_STORE_add_cert(certStore, reinterpret_cast<X509 *>(caCertificate.handle()));
- }
-
QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
// Register a custom callback to get all verification errors.
diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp b/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
index 24e9ccd39f..ab92bac37d 100644
--- a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp
@@ -100,9 +100,8 @@ void QEGLPlatformBackingStore::updateTexture()
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- // QOpenGLTextureBlitter requires GL_REPEAT for the time being
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_image.width(), m_image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
} else {
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index be39767a8f..c0643444e2 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -196,13 +196,20 @@ void QCoreTextFontDatabase::populateFontDatabase()
QCFType<CFArrayRef> familyNames = availableFamilyNames();
const int numberOfFamilies = CFArrayGetCount(familyNames);
for (int i = 0; i < numberOfFamilies; ++i) {
- QString familyName = QCFString::toQString((CFStringRef) CFArrayGetValueAtIndex(familyNames, i));
+ CFStringRef familyNameRef = (CFStringRef) CFArrayGetValueAtIndex(familyNames, i);
+ QString familyName = QCFString::toQString(familyNameRef);
// Don't populate internal fonts
if (familyName.startsWith(QLatin1Char('.')) || familyName == QStringLiteral("LastResort"))
continue;
QPlatformFontDatabase::registerFontFamily(familyName);
+
+#if defined(Q_OS_OSX)
+ QString localizedFamilyName = QString::fromNSString([[NSFontManager sharedFontManager] localizedNameForFamily:(NSString*)familyNameRef face:nil]);
+ if (familyName != localizedFamilyName)
+ QPlatformFontDatabase::registerAliasToFontFamily(familyName, localizedFamilyName);
+#endif
}
}
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 0460f11139..6e2c8a2a9a 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -559,6 +559,9 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
QImage im(br.width.ceil().toInt(), br.height.ceil().toInt(), imageFormat);
im.fill(0);
+ if (!im.width() || !im.height())
+ return im;
+
#ifndef Q_OS_IOS
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
#else
@@ -568,9 +571,11 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
#ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version
cgflags |= kCGBitmapByteOrder32Host;
#endif
+
CGContextRef ctx = CGBitmapContextCreate(im.bits(), im.width(), im.height(),
8, im.bytesPerLine(), colorspace,
cgflags);
+ Q_ASSERT(ctx);
CGContextSetFontSize(ctx, fontDef.pixelSize);
CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > antialiasingThreshold)
&& !(fontDef.styleStrategy & QFont::NoAntialias));
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp
index 85c56bc73e..8bfeac0b2a 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h
index d7015ef342..de63bc77f7 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
index 80688a1da7..d757789935 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
@@ -90,7 +90,7 @@ public:
return false;
}
- ComPtr<IDXGIDevice> dxgiDevice;
+ ComPtr<IDXGIDevice1> dxgiDevice;
ComPtr<IDXGIAdapter> dxgiAdapter;
hr = d3dDevice.As(&dxgiDevice);
@@ -99,6 +99,9 @@ public:
return false;
}
+ // Ensure that DXGI doesn't queue more than one frame at a time.
+ dxgiDevice->SetMaximumFrameLatency(1);
+
hr = dxgiDevice->GetAdapter(&dxgiAdapter);
if (FAILED(hr)) {
qWarning("%s: Failed to probe DXGI Device for parent DXGI Adapter: %#x", __FUNCTION__, hr);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.h b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.h
index 0025463dd5..f9ccab5783 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp
index 27e94e4be4..fb47851a06 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h
index 4986efb967..c563f6a8f0 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dhelpers.h b/src/plugins/platforms/direct2d/qwindowsdirect2dhelpers.h
index 3be05ee1e0..c1b7fc97a8 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dhelpers.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dhelpers.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
index 44fc7aa927..9833d50e6c 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
index a46d5c0126..0a5a7ff58a 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp
index 6792d92de5..0020a95a4d 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h
index ee3f7f6eed..ee1e3db3d2 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp
index 85dbaab2ce..f5f4923b2f 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h
index c799083d84..c9d8607497 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
index 6e8d9b0baf..ca2dcf908d 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
@@ -382,8 +382,7 @@ public:
inline D2D1_INTERPOLATION_MODE interpolationMode() const
{
Q_Q(const QWindowsDirect2DPaintEngine);
- // XXX are we choosing the right d2d interpolation modes?
- return (q->state()->renderHints & QPainter::SmoothPixmapTransform) ? D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC
+ return (q->state()->renderHints & QPainter::SmoothPixmapTransform) ? D2D1_INTERPOLATION_MODE_LINEAR
: D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR;
}
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp
index f75bb49fd9..85fbeb7d6f 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index 856b7d2abe..b5c6b48931 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -121,18 +121,22 @@ CONFIG(blackberry-playbook) {
CONFIG(qqnx_pps) {
DEFINES += QQNX_PPS
- SOURCES += qqnxnavigatorpps.cpp \
- qqnxnavigatoreventnotifier.cpp \
- qqnxvirtualkeyboardpps.cpp \
- qqnxclipboard.cpp \
+ SOURCES += qqnxclipboard.cpp \
qqnxbuttoneventnotifier.cpp
- HEADERS += qqnxnavigatorpps.h \
- qqnxnavigatoreventnotifier.h \
- qqnxvirtualkeyboardpps.h \
- qqnxclipboard.h \
+ HEADERS += qqnxclipboard.h \
qqnxbuttoneventnotifier.h
+ !blackberry {
+ SOURCES += qqnxnavigatorpps.cpp \
+ qqnxnavigatoreventnotifier.cpp \
+ qqnxvirtualkeyboardpps.cpp
+
+ HEADERS += qqnxnavigatorpps.h \
+ qqnxnavigatoreventnotifier.h \
+ qqnxvirtualkeyboardpps.h
+ }
+
LIBS += -lpps
!contains(DEFINES, QT_NO_CLIPBOARD): LIBS += -lclipboard
diff --git a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
index 2f531efd8b..d3f843ac39 100644
--- a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
@@ -90,7 +90,9 @@ void QQnxButtonEventNotifier::start()
errno = 0;
m_fd = qt_safe_open(ppsPath, O_RDONLY);
if (m_fd == -1) {
+#if defined(Q_OS_BLACKBERRY) || defined (QQNXBUTTON_DEBUG)
qWarning("QQNX: failed to open buttons pps, errno=%d", errno);
+#endif
return;
}
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 41ca2b5e18..1110eb5f28 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -67,12 +67,12 @@
#include "qqnxvirtualkeyboardbps.h"
#elif defined(QQNX_PPS)
#include "qqnxnavigatorpps.h"
+#include "qqnxnavigatoreventnotifier.h"
#include "qqnxvirtualkeyboardpps.h"
#endif
#if defined(QQNX_PPS)
# include "qqnxbuttoneventnotifier.h"
-# include "qqnxnavigatoreventnotifier.h"
# include "qqnxclipboard.h"
# if defined(QQNX_IMF)
@@ -284,7 +284,7 @@ QQnxIntegration::~QQnxIntegration()
#endif
// Stop/destroy navigator event notifier
-#if defined(QQNX_PPS)
+#if !defined(Q_OS_BLACKBERRY) && defined(QQNX_PPS)
delete m_navigatorEventNotifier;
#endif
delete m_navigatorEventHandler;
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
index 640944fb45..8c8f1b2afe 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
@@ -93,7 +93,8 @@ void QQnxNavigatorEventNotifier::start()
errno = 0;
m_fd = open(navigatorControlPath, O_RDWR);
if (m_fd == -1) {
- qWarning("QQNX: failed to open navigator pps, errno=%d", errno);
+ qNavigatorEventNotifierDebug() << Q_FUNC_INFO << ": failed to open navigator pps:"
+ << strerror(errno);
return;
}
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 57914cf2fb..3109388fb2 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -41,6 +41,8 @@
#include "qqnxrasterbackingstore.h"
#include "qqnxrasterwindow.h"
+#include "qqnxscreen.h"
+#include "qqnxglobal.h"
#include <QtCore/QDebug>
@@ -167,6 +169,25 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
m_hasUnflushedPaintOperations = true;
platformWindow()->adjustBufferSize();
+
+ if (window()->requestedFormat().alphaBufferSize() != 0) {
+ foreach (const QRect &r, region.rects()) {
+ // Clear transparent regions
+ const int bg[] = {
+ SCREEN_BLIT_COLOR, 0x00000000,
+ SCREEN_BLIT_DESTINATION_X, r.x(),
+ SCREEN_BLIT_DESTINATION_Y, r.y(),
+ SCREEN_BLIT_DESTINATION_WIDTH, r.width(),
+ SCREEN_BLIT_DESTINATION_HEIGHT, r.height(),
+ SCREEN_BLIT_END
+ };
+ Q_SCREEN_CHECKERROR(screen_fill(platformWindow()->screen()->nativeContext(),
+ platformWindow()->renderBuffer().nativeBuffer(), bg),
+ "failed to clear transparent regions");
+ }
+ Q_SCREEN_CHECKERROR(screen_flush_blits(platformWindow()->screen()->nativeContext(), 0),
+ "failed to flush blits");
+ }
}
void QQnxRasterBackingStore::endPaint()
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
index 2b6ee3d1dc..78180ec4a7 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
@@ -128,15 +128,16 @@ bool QQnxVirtualKeyboardPps::connect()
m_fd = ::open(ms_PPSPath, O_RDWR);
if (m_fd == -1)
{
- qCritical("QQnxVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
- ms_PPSPath, strerror(errno), errno);
+ qVirtualKeyboardDebug() << Q_FUNC_INFO << ": Unable to open" << ms_PPSPath
+ << ":" << strerror(errno);
close();
return false;
}
m_buffer = new char[ms_bufferSize];
if (!m_buffer) {
- qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. Size is unavailable.", ms_bufferSize);
+ qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. "
+ "Size is unavailable.", ms_bufferSize);
return false;
}
@@ -156,7 +157,7 @@ bool QQnxVirtualKeyboardPps::queryPPSInfo()
// Request info, requires id to regenerate res message.
pps_encoder_add_string(m_encoder, "msg", "info");
- pps_encoder_add_string(m_encoder, "id", "libWebView");
+ pps_encoder_add_string(m_encoder, "id", "1");
return writeCurrentPPSEncoder();
}
@@ -220,7 +221,6 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
{
int newHeight = 0;
- const char *value;
if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) {
qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found");
@@ -230,27 +230,9 @@ void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found");
return;
}
- if (pps_decoder_push(m_decoder, "locale") != PPS_DECODER_OK) {
- qCritical("QQnxVirtualKeyboard: Keyboard PPS locale object not found");
- return;
- }
- if (pps_decoder_get_string(m_decoder, "languageId", &value) != PPS_DECODER_OK) {
- qCritical("QQnxVirtualKeyboard: Keyboard PPS languageId field not found");
- return;
- }
- const QString languageId = QString::fromLatin1(value);
- if (pps_decoder_get_string(m_decoder, "countryId", &value) != PPS_DECODER_OK) {
- qCritical("QQnxVirtualKeyboard: Keyboard PPS size countryId not found");
- return;
- }
- const QString countryId = QString::fromLatin1(value);
-
setHeight(newHeight);
- const QLocale locale = QLocale(languageId + QLatin1Char('_') + countryId);
- setLocale(locale);
-
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight << "locale=" << locale;
+ qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight;
}
bool QQnxVirtualKeyboardPps::showKeyboard()
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index dfa400285a..5c9add4baa 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -364,7 +364,7 @@ bool QWindowsMouseHandler::translateMouseWheelEvent(QWindow *window, HWND,
delta = (int) msg.wParam;
Qt::Orientation orientation = (msg.message == WM_MOUSEHWHEEL
- || (buttons & Qt::AltModifier)) ?
+ || (mods & Qt::AltModifier)) ?
Qt::Horizontal : Qt::Vertical;
// according to the MSDN documentation on WM_MOUSEHWHEEL:
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 773220660a..e2ff7197aa 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -425,17 +425,8 @@ QWinRTScreen::QWinRTScreen(ICoreWindow *window)
#endif
, m_cursor(new QWinRTCursor(window))
, m_orientation(Qt::PrimaryOrientation)
+ , m_touchDevice(Q_NULLPTR)
{
-#ifdef Q_OS_WINPHONE // On phone, there can be only one touch device
- QTouchDevice *touchDevice = new QTouchDevice;
- touchDevice->setCapabilities(QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::Pressure);
- touchDevice->setType(QTouchDevice::TouchScreen);
- touchDevice->setName(QStringLiteral("WinPhoneTouchScreen"));
- Pointer pointer = { Pointer::TouchScreen, touchDevice };
- m_pointers.insert(0, pointer);
- QWindowSystemInterface::registerTouchDevice(touchDevice);
-#endif
-
Rect rect;
window->get_Bounds(&rect);
m_geometry = QRect(0, 0, rect.Width, rect.Height);
@@ -763,47 +754,25 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
if (FAILED(pointerPoint->get_Properties(&properties)))
return E_INVALIDARG;
-#ifdef Q_OS_WINPHONE
- quint32 pointerId = 0;
- Pointer pointer = m_pointers.value(pointerId);
+ PointerDeviceType pointerDeviceType;
+#if defined(Q_OS_WINPHONE) && _MSC_VER <= 1700
+ pointerDeviceType = PointerDeviceType_Touch;
#else
- Pointer pointer = { Pointer::Unknown, 0 };
- quint32 pointerId;
- pointerPoint->get_PointerId(&pointerId);
- if (m_pointers.contains(pointerId)) {
- pointer = m_pointers.value(pointerId);
- } else { // We have not yet enumerated this device. Do so now...
- IPointerDevice *device;
- if (SUCCEEDED(pointerPoint->get_PointerDevice(&device))) {
- PointerDeviceType type;
- device->get_PointerDeviceType(&type);
- switch (type) {
- case PointerDeviceType_Touch:
- pointer.type = Pointer::TouchScreen;
- pointer.device = new QTouchDevice;
- pointer.device->setName(QStringLiteral("WinRT TouchScreen ") + QString::number(pointerId));
- // TODO: We may want to probe the device usage flags for more accurate values for these next two
- pointer.device->setType(QTouchDevice::TouchScreen);
- pointer.device->setCapabilities(QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::Pressure);
- QWindowSystemInterface::registerTouchDevice(pointer.device);
- break;
-
- case PointerDeviceType_Pen:
- pointer.type = Pointer::Tablet;
- break;
-
- case PointerDeviceType_Mouse:
- pointer.type = Pointer::Mouse;
- break;
- }
-
- m_pointers.insert(pointerId, pointer);
- device->Release();
- }
+ ComPtr<IPointerDevice> pointerDevice;
+ HRESULT hr = pointerPoint->get_PointerDevice(&pointerDevice);
+ if (FAILED(hr)) {
+ qErrnoWarning(hr, "Failed to get pointer device.");
+ return S_OK;
+ }
+
+ hr = pointerDevice->get_PointerDeviceType(&pointerDeviceType);
+ if (FAILED(hr)) {
+ qErrnoWarning(hr, "Failed to get pointer device type.");
+ return S_OK;
}
#endif
- switch (pointer.type) {
- case Pointer::Mouse: {
+ switch (pointerDeviceType) {
+ case PointerDeviceType_Mouse: {
qint32 delta;
properties->get_MouseWheelDelta(&delta);
if (delta) {
@@ -840,7 +809,15 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
break;
}
- case Pointer::TouchScreen: {
+ case PointerDeviceType_Touch: {
+ if (!m_touchDevice) {
+ m_touchDevice = new QTouchDevice;
+ m_touchDevice->setName(QStringLiteral("WinRTTouchScreen"));
+ m_touchDevice->setType(QTouchDevice::TouchScreen);
+ m_touchDevice->setCapabilities(QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::Pressure | QTouchDevice::NormalizedPosition);
+ QWindowSystemInterface::registerTouchDevice(m_touchDevice);
+ }
+
quint32 id;
pointerPoint->get_PointerId(&id);
@@ -868,7 +845,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
it.value().normalPosition = QPointF(pos.x()/m_geometry.width(), pos.y()/m_geometry.height());
it.value().pressure = pressure;
- QWindowSystemInterface::handleTouchEvent(topWindow(), pointer.device, m_touchPoints.values(), mods);
+ QWindowSystemInterface::handleTouchEvent(topWindow(), m_touchDevice, m_touchPoints.values(), mods);
// Remove released points, station others
for (QHash<quint32, QWindowSystemInterface::TouchPoint>::iterator i = m_touchPoints.begin(); i != m_touchPoints.end();) {
@@ -880,7 +857,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
break;
}
- case Pointer::Tablet: {
+ case PointerDeviceType_Pen: {
quint32 id;
pointerPoint->get_PointerId(&id);
@@ -903,7 +880,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
float rotation;
properties->get_Twist(&rotation);
- QWindowSystemInterface::handleTabletEvent(topWindow(), isPressed, pos, pos, pointerId,
+ QWindowSystemInterface::handleTabletEvent(topWindow(), isPressed, pos, pos, 0,
pointerType, pressure, xTilt, yTilt,
0, rotation, 0, id, mods);
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h
index c6511e9446..753d89541c 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.h
+++ b/src/plugins/platforms/winrt/qwinrtscreen.h
@@ -101,12 +101,6 @@ class QWinRTPageFlipper;
class QWinRTCursor;
class QWinRTInputContext;
-struct Pointer {
- enum Type { Unknown, Mouse, TouchScreen, Tablet };
- Type type;
- QTouchDevice *device;
-};
-
class QWinRTScreen : public QPlatformScreen
{
public:
@@ -165,6 +159,7 @@ private:
ABI::Windows::UI::Core::ICoreWindow *m_coreWindow;
ABI::Windows::UI::ViewManagement::IApplicationViewStatics *m_applicationView;
ABI::Windows::ApplicationModel::Core::ICoreApplication *m_application;
+
QRect m_geometry;
QImage::Format m_format;
QSurfaceFormat m_surfaceFormat;
@@ -183,7 +178,7 @@ private:
#ifndef Q_OS_WINPHONE
QHash<quint32, QPair<Qt::Key, QString> > m_activeKeys;
#endif
- QHash<quint32, Pointer> m_pointers;
+ QTouchDevice *m_touchDevice;
QHash<quint32, QWindowSystemInterface::TouchPoint> m_touchPoints;
};
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index e3b81c2b40..f5f6c712c5 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -1791,19 +1791,6 @@ bool QXcbConnection::xi2GetValuatorValueIfSet(void *event, int valuatorNum, doub
return true;
}
-bool QXcbConnection::xi2GetButtonState(void *event, int buttonNum)
-{
- xXIDeviceEvent *xideviceevent = static_cast<xXIDeviceEvent *>(event);
- unsigned char *buttonsMaskAddr = (unsigned char*)&xideviceevent[1];
-
- for (int i = 0; i < (xideviceevent->buttons_len * 4); i++) {
- if (buttonNum < 8)
- return (buttonsMaskAddr[i] & (1 << buttonNum));
- buttonNum -= 8;
- }
- return false;
-}
-
// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
// - "pad0" became "extension"
// - "pad1" and "pad" became "pad0"
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 1719d8ec6b..1af9f1fdd1 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -533,7 +533,6 @@ private:
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
- static bool xi2GetButtonState(void *event, int buttonNum);
#endif
xcb_connection_t *m_connection;
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 831ccba6f6..efa1691780 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -575,7 +575,7 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
#ifdef XCB_USE_XINPUT21
xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
- if (xiEvent->evtype == XI_Motion) {
+ if (xiEvent->evtype == XI_Motion && scrollingDevice.orientations) {
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
QPoint rawDelta;
@@ -612,20 +612,20 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiEvent->time, local, global, rawDelta, angleDelta, modifiers);
}
}
- } else if (xiEvent->evtype == XI_ButtonRelease) {
+ } else if (xiEvent->evtype == XI_ButtonRelease && scrollingDevice.legacyOrientations) {
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
QPoint angleDelta;
if (scrollingDevice.legacyOrientations & Qt::Vertical) {
- if (xi2GetButtonState(xiDeviceEvent, 4))
+ if (xiDeviceEvent->detail == 4)
angleDelta.setY(120);
- else if (xi2GetButtonState(xiDeviceEvent, 5))
+ else if (xiDeviceEvent->detail == 5)
angleDelta.setY(-120);
}
if (scrollingDevice.legacyOrientations & Qt::Horizontal) {
- if (xi2GetButtonState(xiDeviceEvent, 6))
+ if (xiDeviceEvent->detail == 6)
angleDelta.setX(120);
- if (xi2GetButtonState(xiDeviceEvent, 7))
+ else if (xiDeviceEvent->detail == 7)
angleDelta.setX(-120);
}
if (!angleDelta.isNull()) {
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index cc58b51743..ffcc7abbfe 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2143,18 +2143,26 @@ char *toHexRepresentation(const char *ba, int length)
char *toPrettyUnicode(const ushort *p, int length)
{
// keep it simple for the vast majority of cases
- QScopedArrayPointer<char> buffer(new char[length * 6 + 3]);
+ bool trimmed = false;
+ QScopedArrayPointer<char> buffer(new char[256]);
const ushort *end = p + length;
char *dst = buffer.data();
*dst++ = '"';
for ( ; p != end; ++p) {
+ if (dst - buffer.data() > 245) {
+ // plus the the quote, the three dots and NUL, it's 250, 251 or 255
+ trimmed = true;
+ break;
+ }
+
if (*p < 0x7f && *p >= 0x20 && *p != '\\') {
*dst++ = *p;
continue;
}
// write as an escape sequence
+ // this means we may advance dst to buffer.data() + 246 or 250
*dst++ = '\\';
switch (*p) {
case 0x22:
@@ -2186,6 +2194,11 @@ char *toPrettyUnicode(const ushort *p, int length)
}
*dst++ = '"';
+ if (trimmed) {
+ *dst++ = '.';
+ *dst++ = '.';
+ *dst++ = '.';
+ }
*dst++ = '\0';
return buffer.take();
}
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index a3f776fe32..846199ebe2 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2177,6 +2177,7 @@ QAction *QMenu::exec()
QAction *QMenu::exec(const QPoint &p, QAction *action)
{
Q_D(QMenu);
+ ensurePolished();
createWinId();
QEventLoop eventLoop;
d->eventLoop = &eventLoop;