Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
This commit is contained in:
commit
70cd276db0
70
dist/changes-5.3.0
vendored
70
dist/changes-5.3.0
vendored
@ -91,6 +91,10 @@ QtCore
|
|||||||
- QLibraryInfo provides information on how Qt was built.
|
- QLibraryInfo provides information on how Qt was built.
|
||||||
- Added class QMarginsF to support handling margins with floating-point
|
- Added class QMarginsF to support handling margins with floating-point
|
||||||
values.
|
values.
|
||||||
|
- The setSharable() and isSharable() functions in Qt containers has
|
||||||
|
been deprecated and will be removed in Qt 6. New applications should
|
||||||
|
not use this feature, while old applications that may be using this
|
||||||
|
(undocumented) feature should port away from it.
|
||||||
|
|
||||||
- Atomic support:
|
- Atomic support:
|
||||||
* Added more operations to the atomic classes, including operator T(),
|
* Added more operations to the atomic classes, including operator T(),
|
||||||
@ -222,6 +226,9 @@ QtGui
|
|||||||
EGL
|
EGL
|
||||||
- [QTBUG-36993] Native (that is, not distance field based) text
|
- [QTBUG-36993] Native (that is, not distance field based) text
|
||||||
rendering is now functional on OpenGL 3.2+ core profiles too.
|
rendering is now functional on OpenGL 3.2+ core profiles too.
|
||||||
|
- The function QOpenGLShaderProgram::create() has been added. It is can
|
||||||
|
be used to force immediate allocation of the program's id.
|
||||||
|
- QFont::setRawName() and QFont::rawName() were deprecated.
|
||||||
|
|
||||||
- Accessibility:
|
- Accessibility:
|
||||||
* [QTBUG-37204] Implemented text attributes to enable VoiceOver to read
|
* [QTBUG-37204] Implemented text attributes to enable VoiceOver to read
|
||||||
@ -285,8 +292,6 @@ QtNetwork
|
|||||||
QtPrintSupport
|
QtPrintSupport
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
- [QTBUG-29663] Made the Qt buildsystem automatically include the
|
|
||||||
necessary plugins so that static applications can print.
|
|
||||||
- CUPS 1.4 is now required for print support on Linux and other *nix
|
- CUPS 1.4 is now required for print support on Linux and other *nix
|
||||||
platforms.
|
platforms.
|
||||||
|
|
||||||
@ -309,19 +314,29 @@ QtPrintSupport
|
|||||||
QtSql
|
QtSql
|
||||||
-----
|
-----
|
||||||
|
|
||||||
- QSqlQuery::isNull(field) now correctly returns true for "no such field".
|
- QSqlError:
|
||||||
- QSqlQuery::isNull(fieldname) is a new overload.
|
* Now handles alphanumeric error codes. Used by QPSQL. Old numeric
|
||||||
- [QTBUG-12186] Fixed the order of values with positional binding in a
|
code is deprecated.
|
||||||
QSqlQuery
|
|
||||||
|
- QSqlQuery:
|
||||||
|
* isNull(field) now correctly returns true for "no such field".
|
||||||
|
* isNull(fieldname) is a new overload.
|
||||||
|
* [QTBUG-12186] Fixed order of values with positional binding.
|
||||||
|
|
||||||
|
- QSqlTableModel:
|
||||||
|
* [QTBUG-38509] Fix failure to refresh in selectRow()
|
||||||
|
|
||||||
|
- QIBASE:
|
||||||
|
* [QTBUG-37508] Fix QByteArray memory corruption in QIBaseDriver::open().
|
||||||
|
* Support for prepared queries in numRowsAffected().
|
||||||
|
|
||||||
|
- QODBC:
|
||||||
|
* [QTBUG-37831] Fix access of tmpStorage in QODBCResult::exec().
|
||||||
|
|
||||||
- QSQLITE:
|
- QSQLITE:
|
||||||
* Creating temporary databases is now possible
|
* Creating temporary databases is now possible
|
||||||
* Empty database name now opens in-memory database.
|
* Empty database name now opens in-memory database.
|
||||||
|
|
||||||
- QSqlError
|
|
||||||
* Now handles alphanumeric error codes. Used by QPSQL. Old numeric
|
|
||||||
code is deprecated.
|
|
||||||
|
|
||||||
QtTest
|
QtTest
|
||||||
------
|
------
|
||||||
|
|
||||||
@ -430,8 +445,6 @@ QtWidgets
|
|||||||
Android
|
Android
|
||||||
-------
|
-------
|
||||||
|
|
||||||
- [QTBUG-34781] Fixed regression in "make install" on library projects on
|
|
||||||
Android so they can be used inside subdirs projects again.
|
|
||||||
- [QTBUG-36074] Fixed crash on populating large combo boxes or menus.
|
- [QTBUG-36074] Fixed crash on populating large combo boxes or menus.
|
||||||
- [QTBUG-36528] Fixed QDir::entryList() for assets scheme to no longer
|
- [QTBUG-36528] Fixed QDir::entryList() for assets scheme to no longer
|
||||||
skip the first file in the directory.
|
skip the first file in the directory.
|
||||||
@ -513,3 +526,36 @@ qdbus
|
|||||||
trying to display remote interfaces that had complex types without a
|
trying to display remote interfaces that had complex types without a
|
||||||
matching base Qt type.
|
matching base Qt type.
|
||||||
|
|
||||||
|
configure & build system
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
- Configure's -separate-debug-info option is now checked more strictly.
|
||||||
|
- Added configure [-no]-imf options for QNX.
|
||||||
|
- Added unsupported linux-libc++-clang and freebsd-clang mkspecs.
|
||||||
|
- Numerous configuration-specific build fixes.
|
||||||
|
|
||||||
|
qmake
|
||||||
|
-----
|
||||||
|
|
||||||
|
- QTPLUGIN will now be automatically populated with the plugins that are
|
||||||
|
typically needed by the used Qt modules.
|
||||||
|
- qmake will not create dependencies on system headers any more, provided it
|
||||||
|
detects the system include paths.
|
||||||
|
- Added DISTCLEAN_DEPS variable analogous to CLEAN_DEPS.
|
||||||
|
- Added function $$getenv() which is equivalent to using the $$() expansion,
|
||||||
|
but permits various qmake meta characters in the name.
|
||||||
|
- [MacOS] QMAKE_BUNDLEID_PREFIX is now recognized by the Makefile generator.
|
||||||
|
- [QTBUG-29939][MSVC2012+] Added Windows XP target support.
|
||||||
|
- [QTBUG-35570][VS2012+] Fixed bad ProgramDataBaseFileName.
|
||||||
|
- [QTBUG-38066][VS2010+] Fixed version suffix being appended to applications.
|
||||||
|
- [QTBUG-31185][VS] The PlatformToolset environment variable is now honored.
|
||||||
|
- [QTBUG-34781][Android] Fixed regression in "make install" on library projects
|
||||||
|
so they can be used inside subdirs projects again.
|
||||||
|
- [QTBUG-37113] Fixed creation of excessively long relative paths, which
|
||||||
|
would lead to errors with MSVC. Note that this does not fix all such cases.
|
||||||
|
|
||||||
|
qlalr
|
||||||
|
-----
|
||||||
|
|
||||||
|
- (Re-)added to Qt base. Added corresponding qmake feature file.
|
||||||
|
Caveat: the generated files are not scanned for dependencies.
|
||||||
|
@ -39,15 +39,18 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
|
|||||||
"QtQuick/Qt Quick Demo - Tweet Search" \
|
"QtQuick/Qt Quick Demo - Tweet Search" \
|
||||||
"QtQuick/Qt Quick Demo - Maroon*" \
|
"QtQuick/Qt Quick Demo - Maroon*" \
|
||||||
"QtQuick/Qt Quick Demo - Calqlatr" \
|
"QtQuick/Qt Quick Demo - Calqlatr" \
|
||||||
"QtQuick/Qt Quick Particles Examples - Emitters" \
|
"QtQuick/Qt Quick Demo - StocQt" \
|
||||||
|
"QtQuick/Qt Quick Demo - Clocks" \
|
||||||
"QtQuick/Qt Quick Examples - Shader Effects" \
|
"QtQuick/Qt Quick Examples - Shader Effects" \
|
||||||
"QtWebKitExamples/Fancy Browser" \
|
"QtQuick/Qt Quick Examples - Text" \
|
||||||
"QtWebKitExamples/Flickr View Example" \
|
"QtQuick/Qt Quick Examples - Window and Screen" \
|
||||||
"QtWebKitExamples/YouTube View Example" \
|
|
||||||
"QtQuickControls/Qt Quick Controls - Gallery" \
|
"QtQuickControls/Qt Quick Controls - Gallery" \
|
||||||
"QtQuickControls/Qt Quick Controls - Text Editor Example" \
|
"QtQuickControls/Qt Quick Controls - Text Editor Example" \
|
||||||
"QtQuickControls/Qt Quick Controls - Table View Example" \
|
"QtQuickControls/Qt Quick Controls - Table View Example" \
|
||||||
"QtWidgets/Application Example"
|
"QtQuickControls/Qt Quick Controls - Calendar Example" \
|
||||||
|
"QtQuickDialogs/Qt Quick System Dialog Examples" \
|
||||||
|
"QtWidgets/Application Example" \
|
||||||
|
"QtWinExtras/Quick Player"
|
||||||
|
|
||||||
manifestmeta.highlighted.attributes = isHighlighted:true
|
manifestmeta.highlighted.attributes = isHighlighted:true
|
||||||
|
|
||||||
|
@ -137,7 +137,8 @@ bootstrap { #Qt code
|
|||||||
unix {
|
unix {
|
||||||
SOURCES += qfilesystemengine_unix.cpp qfilesystemiterator_unix.cpp qfsfileengine_unix.cpp
|
SOURCES += qfilesystemengine_unix.cpp qfilesystemiterator_unix.cpp qfsfileengine_unix.cpp
|
||||||
mac {
|
mac {
|
||||||
SOURCES += qcore_mac.cpp qsettings_mac.cpp qlocale_mac.mm
|
SOURCES += qcore_mac.cpp qsettings_mac.cpp
|
||||||
|
OBJECTIVE_SOURCES += qlocale_mac.mm
|
||||||
LIBS += -framework ApplicationServices
|
LIBS += -framework ApplicationServices
|
||||||
} else {
|
} else {
|
||||||
SOURCES += qlocale_unix.cpp
|
SOURCES += qlocale_unix.cpp
|
||||||
|
@ -257,7 +257,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum
|
|||||||
D3D11_TEXTURE2D_DESC desc;
|
D3D11_TEXTURE2D_DESC desc;
|
||||||
desc.Width = width; // Compressed texture size constraints?
|
desc.Width = width; // Compressed texture size constraints?
|
||||||
desc.Height = height;
|
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.ArraySize = 1;
|
||||||
desc.Format = mTextureFormat;
|
desc.Format = mTextureFormat;
|
||||||
desc.SampleDesc.Count = 1;
|
desc.SampleDesc.Count = 1;
|
||||||
|
@ -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
|
||||||
|
|
@ -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
|
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.
|
of the directory name, otherwise it will be appended.
|
||||||
Unlike QTemporaryFile, XXXXXX in the middle of the template string is not supported.
|
Unlike QTemporaryFile, XXXXXX in the middle of the template string is not supported.
|
||||||
|
|
||||||
\sa QDir::tempPath()
|
\sa QDir::tempPath()
|
||||||
*/
|
*/
|
||||||
QTemporaryDir::QTemporaryDir(const QString &templateName)
|
QTemporaryDir::QTemporaryDir(const QString &templatePath)
|
||||||
: d_ptr(new QTemporaryDirPrivate)
|
: d_ptr(new QTemporaryDirPrivate)
|
||||||
{
|
{
|
||||||
if (templateName.isEmpty())
|
if (templatePath.isEmpty())
|
||||||
d_ptr->create(defaultTemplateName());
|
d_ptr->create(defaultTemplateName());
|
||||||
else
|
else
|
||||||
d_ptr->create(templateName);
|
d_ptr->create(templatePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -569,7 +569,9 @@ void QTextStreamPrivate::flushWriteBuffer()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// convert from unicode to raw data
|
// 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
|
#else
|
||||||
QByteArray data = writeBuffer.toLocal8Bit();
|
QByteArray data = writeBuffer.toLocal8Bit();
|
||||||
#endif
|
#endif
|
||||||
|
@ -164,11 +164,17 @@ vxworks {
|
|||||||
|
|
||||||
blackberry {
|
blackberry {
|
||||||
SOURCES += \
|
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/qppsattribute.cpp \
|
||||||
kernel/qppsobject.cpp
|
kernel/qppsobject.cpp
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
kernel/qeventdispatcher_blackberry_p.h \
|
|
||||||
kernel/qppsattribute_p.h \
|
kernel/qppsattribute_p.h \
|
||||||
kernel/qppsattributeprivate_p.h \
|
kernel/qppsattributeprivate_p.h \
|
||||||
kernel/qppsobject_p.h \
|
kernel/qppsobject_p.h \
|
||||||
|
@ -253,7 +253,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
|
|||||||
|
|
||||||
return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-'))
|
return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-'))
|
||||||
.arg(qAbs(offset) / SECS_PER_HOUR, 2, 10, QLatin1Char('0'))
|
.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
|
// Parse offset in [+-]HH[:]MM format
|
||||||
@ -265,17 +265,24 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
|
|||||||
if (size < 2 || size > 6)
|
if (size < 2 || size > 6)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
// sign will be +1 for a positive and -1 for a negative offset
|
||||||
|
int sign;
|
||||||
|
|
||||||
// First char must be + or -
|
// First char must be + or -
|
||||||
const QChar sign = offsetString.at(0);
|
const QChar signChar = offsetString.at(0);
|
||||||
if (sign != QLatin1Char('+') && sign != QLatin1Char('-'))
|
if (signChar == QLatin1Char('+'))
|
||||||
|
sign = 1;
|
||||||
|
else if (signChar == QLatin1Char('-'))
|
||||||
|
sign = -1;
|
||||||
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Split the hour and minute parts
|
// Split the hour and minute parts
|
||||||
QStringList parts = offsetString.split(QLatin1Char(':'));
|
QStringList parts = offsetString.mid(1).split(QLatin1Char(':'));
|
||||||
if (parts.count() == 1) {
|
if (parts.count() == 1) {
|
||||||
// [+-]HHMM format
|
// [+-]HHMM format
|
||||||
parts.append(parts.at(0).mid(3));
|
parts.append(parts.at(0).mid(2));
|
||||||
parts[0] = parts.at(0).left(3);
|
parts[0] = parts.at(0).left(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
@ -288,7 +295,7 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
*valid = true;
|
*valid = true;
|
||||||
return ((hour * 60) + minute) * 60;
|
return sign * ((hour * 60) + minute) * 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
@ -466,7 +466,14 @@ static QWindowGeometrySpecification windowGeometrySpecification;
|
|||||||
|
|
||||||
\section1 Supported Command Line Options
|
\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
|
\list
|
||||||
|
|
||||||
\li \c{-platform} \e {platformName[:options]}, specifies the
|
\li \c{-platform} \e {platformName[:options]}, specifies the
|
||||||
@ -489,19 +496,22 @@ static QWindowGeometrySpecification windowGeometrySpecification;
|
|||||||
\li \c {-qwindowgeometry} \e geometry, specifies window geometry for
|
\li \c {-qwindowgeometry} \e geometry, specifies window geometry for
|
||||||
the main window using the X11-syntax. For example:
|
the main window using the X11-syntax. For example:
|
||||||
\c {-qwindowgeometry 100x100+50+50}
|
\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
|
\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
|
\li \c{-session} \e session, restores the application from an earlier
|
||||||
\l{Session Management}{session}.
|
\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
|
\endlist
|
||||||
|
|
||||||
The following standard command line options are available for X11:
|
The following standard command line options are available for X11:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li \c {-display} \e {hostname:screen_number}, switches displays on X11.
|
\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}.
|
\li \c {-geometry} \e geometry, same as \c {-qwindowgeometry}.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
@ -1405,7 +1405,8 @@ void QOpenGLSharedResourceGuard::freeResource(QOpenGLContext *context)
|
|||||||
QOpenGLMultiGroupSharedResource instance.
|
QOpenGLMultiGroupSharedResource instance.
|
||||||
*/
|
*/
|
||||||
QOpenGLMultiGroupSharedResource::QOpenGLMultiGroupSharedResource()
|
QOpenGLMultiGroupSharedResource::QOpenGLMultiGroupSharedResource()
|
||||||
: active(0)
|
: active(0),
|
||||||
|
m_mutex(QMutex::Recursive)
|
||||||
{
|
{
|
||||||
#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
|
#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
|
||||||
qDebug("Creating context group resource object %p.", this);
|
qDebug("Creating context group resource object %p.", this);
|
||||||
|
@ -171,7 +171,9 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
T *value(QOpenGLContext *context) {
|
T *value(QOpenGLContext *context) {
|
||||||
QOpenGLContextGroup *group = context->shareGroup();
|
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));
|
T *resource = static_cast<T *>(group->d_func()->m_resources.value(this, 0));
|
||||||
if (!resource) {
|
if (!resource) {
|
||||||
resource = new T(context);
|
resource = new T(context);
|
||||||
@ -183,6 +185,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QAtomicInt active;
|
QAtomicInt active;
|
||||||
QList<QOpenGLContextGroup *> m_groups;
|
QList<QOpenGLContextGroup *> m_groups;
|
||||||
|
QMutex m_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QPaintEngineEx;
|
class QPaintEngineEx;
|
||||||
|
@ -133,17 +133,19 @@ typedef GLfloat GLdouble;
|
|||||||
# endif // Q_OS_MAC
|
# endif // Q_OS_MAC
|
||||||
#endif // QT_OPENGL_ES_2
|
#endif // QT_OPENGL_ES_2
|
||||||
|
|
||||||
// Desktops, apart from Mac OS X prior to 10.7 can support OpenGL 3
|
// 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.9 can support OpenGL 4.
|
||||||
#if !defined(QT_OPENGL_ES_2)
|
#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)
|
# 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
|
||||||
# define QT_OPENGL_3_2
|
# define QT_OPENGL_3_2
|
||||||
# endif
|
# 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
|
# define QT_OPENGL_4
|
||||||
|
# endif
|
||||||
|
# if !defined(Q_OS_MAC)
|
||||||
# define QT_OPENGL_4_3
|
# define QT_OPENGL_4_3
|
||||||
#endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@ -408,41 +408,14 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
|
|||||||
#endif
|
#endif
|
||||||
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, fmt, GL_UNSIGNED_BYTE, mask.bits());
|
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, fmt, GL_UNSIGNED_BYTE, mask.bits());
|
||||||
} else {
|
} else {
|
||||||
// glTexSubImage2D() might cause some garbage to appear in the texture if the mask width is
|
// The scanlines in mask are 32-bit aligned, even for mono or 8-bit formats. This
|
||||||
// not a multiple of four bytes. The bug appeared on a computer with 32-bit Windows Vista
|
// is good because it matches the default of 4 bytes for GL_UNPACK_ALIGNMENT.
|
||||||
// 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
|
|
||||||
|
|
||||||
#if !defined(QT_OPENGL_ES_2)
|
#if !defined(QT_OPENGL_ES_2)
|
||||||
const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA;
|
const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA;
|
||||||
#else
|
#else
|
||||||
const GLenum format = GL_ALPHA;
|
const GLenum format = GL_ALPHA;
|
||||||
#endif
|
#endif
|
||||||
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, format, GL_UNSIGNED_BYTE, mask.bits());
|
funcs->glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, format, GL_UNSIGNED_BYTE, mask.bits());
|
||||||
|
|
||||||
#if 0
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2501,10 +2501,14 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
|
|||||||
|
|
||||||
if (!engine) {
|
if (!engine) {
|
||||||
if (!request.family.isEmpty()) {
|
if (!request.family.isEmpty()) {
|
||||||
|
QFont::StyleHint styleHint = QFont::StyleHint(request.styleHint);
|
||||||
|
if (styleHint == QFont::AnyStyle && request.fixedPitch)
|
||||||
|
styleHint = QFont::TypeWriter;
|
||||||
|
|
||||||
QStringList fallbacks = request.fallBackFamilies
|
QStringList fallbacks = request.fallBackFamilies
|
||||||
+ fallbackFamilies(request.family,
|
+ fallbackFamilies(request.family,
|
||||||
QFont::Style(request.style),
|
QFont::Style(request.style),
|
||||||
QFont::StyleHint(request.styleHint),
|
styleHint,
|
||||||
QChar::Script(script));
|
QChar::Script(script));
|
||||||
if (script > QChar::Script_Common)
|
if (script > QChar::Script_Common)
|
||||||
fallbacks += QString(); // Find the first font matching the specified script.
|
fallbacks += QString(); // Find the first font matching the specified script.
|
||||||
|
@ -2810,7 +2810,6 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const
|
|||||||
break;
|
break;
|
||||||
glyph_pos = gs;
|
glyph_pos = gs;
|
||||||
edge = pos;
|
edge = pos;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
pos -= glyphs.effectiveAdvance(gs);
|
pos -= glyphs.effectiveAdvance(gs);
|
||||||
++gs;
|
++gs;
|
||||||
|
@ -580,7 +580,7 @@ void QSpdyProtocolHandler::sendControlFrame(FrameType type,
|
|||||||
{
|
{
|
||||||
// frame type and stream ID
|
// frame type and stream ID
|
||||||
char header[8];
|
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[1] = 0x03; // 3 bit == version 3
|
||||||
header[2] = 0;
|
header[2] = 0;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -653,10 +653,10 @@ void QSpdyProtocolHandler::sendSYN_STREAM(HttpMessagePair messagePair,
|
|||||||
prioAndSlot[0] = 0x00; // == prio 0 (highest)
|
prioAndSlot[0] = 0x00; // == prio 0 (highest)
|
||||||
break;
|
break;
|
||||||
case QHttpNetworkRequest::NormalPriority:
|
case QHttpNetworkRequest::NormalPriority:
|
||||||
prioAndSlot[0] = 0x80; // == prio 4
|
prioAndSlot[0] = 0x80u; // == prio 4
|
||||||
break;
|
break;
|
||||||
case QHttpNetworkRequest::LowPriority:
|
case QHttpNetworkRequest::LowPriority:
|
||||||
prioAndSlot[0] = 0xe0; // == prio 7 (lowest)
|
prioAndSlot[0] = 0xe0u; // == prio 7 (lowest)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prioAndSlot[1] = 0x00; // slot in client certificates (not supported currently)
|
prioAndSlot[1] = 0x00; // slot in client certificates (not supported currently)
|
||||||
|
@ -214,22 +214,23 @@ init_context:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add all our CAs to this store.
|
// Add all our CAs to this store.
|
||||||
QList<QSslCertificate> expiredCerts;
|
|
||||||
foreach (const QSslCertificate &caCertificate, sslContext->sslConfiguration.caCertificates()) {
|
foreach (const QSslCertificate &caCertificate, sslContext->sslConfiguration.caCertificates()) {
|
||||||
// add expired certs later, so that the
|
// From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
|
||||||
// valid ones are used before the expired ones
|
//
|
||||||
if (caCertificate.expiryDate() < QDateTime::currentDateTime()) {
|
// If several CA certificates matching the name, key identifier, and
|
||||||
expiredCerts.append(caCertificate);
|
// serial number condition are available, only the first one will be
|
||||||
} else {
|
// 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());
|
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) {
|
if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
|
||||||
// tell OpenSSL the directories where to look up the root certs on demand
|
// tell OpenSSL the directories where to look up the root certs on demand
|
||||||
QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
|
QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
|
||||||
|
@ -1633,23 +1633,23 @@ QList<QSslError> QSslSocketBackendPrivate::verify(QList<QSslCertificate> certifi
|
|||||||
setDefaultCaCertificates(defaultCaCertificates() + systemCaCertificates());
|
setDefaultCaCertificates(defaultCaCertificates() + systemCaCertificates());
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QSslCertificate> expiredCerts;
|
|
||||||
|
|
||||||
foreach (const QSslCertificate &caCertificate, QSslSocket::defaultCaCertificates()) {
|
foreach (const QSslCertificate &caCertificate, QSslSocket::defaultCaCertificates()) {
|
||||||
// add expired certs later, so that the
|
// From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
|
||||||
// valid ones are used before the expired ones
|
//
|
||||||
if (caCertificate.expiryDate() < QDateTime::currentDateTime()) {
|
// If several CA certificates matching the name, key identifier, and
|
||||||
expiredCerts.append(caCertificate);
|
// serial number condition are available, only the first one will be
|
||||||
} else {
|
// 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()));
|
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);
|
QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
|
||||||
|
|
||||||
// Register a custom callback to get all verification errors.
|
// Register a custom callback to get all verification errors.
|
||||||
|
@ -100,9 +100,8 @@ void QEGLPlatformBackingStore::updateTexture()
|
|||||||
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
|
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_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_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_image.width(), m_image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_image.width(), m_image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
||||||
} else {
|
} else {
|
||||||
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
|
glBindTexture(GL_TEXTURE_2D, m_bsTexture);
|
||||||
|
@ -196,13 +196,20 @@ void QCoreTextFontDatabase::populateFontDatabase()
|
|||||||
QCFType<CFArrayRef> familyNames = availableFamilyNames();
|
QCFType<CFArrayRef> familyNames = availableFamilyNames();
|
||||||
const int numberOfFamilies = CFArrayGetCount(familyNames);
|
const int numberOfFamilies = CFArrayGetCount(familyNames);
|
||||||
for (int i = 0; i < numberOfFamilies; ++i) {
|
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
|
// Don't populate internal fonts
|
||||||
if (familyName.startsWith(QLatin1Char('.')) || familyName == QStringLiteral("LastResort"))
|
if (familyName.startsWith(QLatin1Char('.')) || familyName == QStringLiteral("LastResort"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
QPlatformFontDatabase::registerFontFamily(familyName);
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -559,6 +559,9 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
|
|||||||
QImage im(br.width.ceil().toInt(), br.height.ceil().toInt(), imageFormat);
|
QImage im(br.width.ceil().toInt(), br.height.ceil().toInt(), imageFormat);
|
||||||
im.fill(0);
|
im.fill(0);
|
||||||
|
|
||||||
|
if (!im.width() || !im.height())
|
||||||
|
return im;
|
||||||
|
|
||||||
#ifndef Q_OS_IOS
|
#ifndef Q_OS_IOS
|
||||||
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
||||||
#else
|
#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
|
#ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version
|
||||||
cgflags |= kCGBitmapByteOrder32Host;
|
cgflags |= kCGBitmapByteOrder32Host;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CGContextRef ctx = CGBitmapContextCreate(im.bits(), im.width(), im.height(),
|
CGContextRef ctx = CGBitmapContextCreate(im.bits(), im.width(), im.height(),
|
||||||
8, im.bytesPerLine(), colorspace,
|
8, im.bytesPerLine(), colorspace,
|
||||||
cgflags);
|
cgflags);
|
||||||
|
Q_ASSERT(ctx);
|
||||||
CGContextSetFontSize(ctx, fontDef.pixelSize);
|
CGContextSetFontSize(ctx, fontDef.pixelSize);
|
||||||
CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > antialiasingThreshold)
|
CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > antialiasingThreshold)
|
||||||
&& !(fontDef.styleStrategy & QFont::NoAntialias));
|
&& !(fontDef.styleStrategy & QFont::NoAntialias));
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
@ -90,7 +90,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ComPtr<IDXGIDevice> dxgiDevice;
|
ComPtr<IDXGIDevice1> dxgiDevice;
|
||||||
ComPtr<IDXGIAdapter> dxgiAdapter;
|
ComPtr<IDXGIAdapter> dxgiAdapter;
|
||||||
|
|
||||||
hr = d3dDevice.As(&dxgiDevice);
|
hr = d3dDevice.As(&dxgiDevice);
|
||||||
@ -99,6 +99,9 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure that DXGI doesn't queue more than one frame at a time.
|
||||||
|
dxgiDevice->SetMaximumFrameLatency(1);
|
||||||
|
|
||||||
hr = dxgiDevice->GetAdapter(&dxgiAdapter);
|
hr = dxgiDevice->GetAdapter(&dxgiAdapter);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
qWarning("%s: Failed to probe DXGI Device for parent DXGI Adapter: %#x", __FUNCTION__, hr);
|
qWarning("%s: Failed to probe DXGI Device for parent DXGI Adapter: %#x", __FUNCTION__, hr);
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -382,8 +382,7 @@ public:
|
|||||||
inline D2D1_INTERPOLATION_MODE interpolationMode() const
|
inline D2D1_INTERPOLATION_MODE interpolationMode() const
|
||||||
{
|
{
|
||||||
Q_Q(const QWindowsDirect2DPaintEngine);
|
Q_Q(const QWindowsDirect2DPaintEngine);
|
||||||
// XXX are we choosing the right d2d interpolation modes?
|
return (q->state()->renderHints & QPainter::SmoothPixmapTransform) ? D2D1_INTERPOLATION_MODE_LINEAR
|
||||||
return (q->state()->renderHints & QPainter::SmoothPixmapTransform) ? D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC
|
|
||||||
: D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR;
|
: D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
** Contact: http://www.qt-project.org/legal
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
@ -121,18 +121,22 @@ CONFIG(blackberry-playbook) {
|
|||||||
CONFIG(qqnx_pps) {
|
CONFIG(qqnx_pps) {
|
||||||
DEFINES += QQNX_PPS
|
DEFINES += QQNX_PPS
|
||||||
|
|
||||||
SOURCES += qqnxnavigatorpps.cpp \
|
SOURCES += qqnxclipboard.cpp \
|
||||||
qqnxnavigatoreventnotifier.cpp \
|
|
||||||
qqnxvirtualkeyboardpps.cpp \
|
|
||||||
qqnxclipboard.cpp \
|
|
||||||
qqnxbuttoneventnotifier.cpp
|
qqnxbuttoneventnotifier.cpp
|
||||||
|
|
||||||
HEADERS += qqnxnavigatorpps.h \
|
HEADERS += qqnxclipboard.h \
|
||||||
qqnxnavigatoreventnotifier.h \
|
|
||||||
qqnxvirtualkeyboardpps.h \
|
|
||||||
qqnxclipboard.h \
|
|
||||||
qqnxbuttoneventnotifier.h
|
qqnxbuttoneventnotifier.h
|
||||||
|
|
||||||
|
!blackberry {
|
||||||
|
SOURCES += qqnxnavigatorpps.cpp \
|
||||||
|
qqnxnavigatoreventnotifier.cpp \
|
||||||
|
qqnxvirtualkeyboardpps.cpp
|
||||||
|
|
||||||
|
HEADERS += qqnxnavigatorpps.h \
|
||||||
|
qqnxnavigatoreventnotifier.h \
|
||||||
|
qqnxvirtualkeyboardpps.h
|
||||||
|
}
|
||||||
|
|
||||||
LIBS += -lpps
|
LIBS += -lpps
|
||||||
!contains(DEFINES, QT_NO_CLIPBOARD): LIBS += -lclipboard
|
!contains(DEFINES, QT_NO_CLIPBOARD): LIBS += -lclipboard
|
||||||
|
|
||||||
|
@ -90,7 +90,9 @@ void QQnxButtonEventNotifier::start()
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
m_fd = qt_safe_open(ppsPath, O_RDONLY);
|
m_fd = qt_safe_open(ppsPath, O_RDONLY);
|
||||||
if (m_fd == -1) {
|
if (m_fd == -1) {
|
||||||
|
#if defined(Q_OS_BLACKBERRY) || defined (QQNXBUTTON_DEBUG)
|
||||||
qWarning("QQNX: failed to open buttons pps, errno=%d", errno);
|
qWarning("QQNX: failed to open buttons pps, errno=%d", errno);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,12 +67,12 @@
|
|||||||
#include "qqnxvirtualkeyboardbps.h"
|
#include "qqnxvirtualkeyboardbps.h"
|
||||||
#elif defined(QQNX_PPS)
|
#elif defined(QQNX_PPS)
|
||||||
#include "qqnxnavigatorpps.h"
|
#include "qqnxnavigatorpps.h"
|
||||||
|
#include "qqnxnavigatoreventnotifier.h"
|
||||||
#include "qqnxvirtualkeyboardpps.h"
|
#include "qqnxvirtualkeyboardpps.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QQNX_PPS)
|
#if defined(QQNX_PPS)
|
||||||
# include "qqnxbuttoneventnotifier.h"
|
# include "qqnxbuttoneventnotifier.h"
|
||||||
# include "qqnxnavigatoreventnotifier.h"
|
|
||||||
# include "qqnxclipboard.h"
|
# include "qqnxclipboard.h"
|
||||||
|
|
||||||
# if defined(QQNX_IMF)
|
# if defined(QQNX_IMF)
|
||||||
@ -284,7 +284,7 @@ QQnxIntegration::~QQnxIntegration()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Stop/destroy navigator event notifier
|
// Stop/destroy navigator event notifier
|
||||||
#if defined(QQNX_PPS)
|
#if !defined(Q_OS_BLACKBERRY) && defined(QQNX_PPS)
|
||||||
delete m_navigatorEventNotifier;
|
delete m_navigatorEventNotifier;
|
||||||
#endif
|
#endif
|
||||||
delete m_navigatorEventHandler;
|
delete m_navigatorEventHandler;
|
||||||
|
@ -93,7 +93,8 @@ void QQnxNavigatorEventNotifier::start()
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
m_fd = open(navigatorControlPath, O_RDWR);
|
m_fd = open(navigatorControlPath, O_RDWR);
|
||||||
if (m_fd == -1) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
|
|
||||||
#include "qqnxrasterbackingstore.h"
|
#include "qqnxrasterbackingstore.h"
|
||||||
#include "qqnxrasterwindow.h"
|
#include "qqnxrasterwindow.h"
|
||||||
|
#include "qqnxscreen.h"
|
||||||
|
#include "qqnxglobal.h"
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
@ -167,6 +169,25 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion)
|
|||||||
m_hasUnflushedPaintOperations = true;
|
m_hasUnflushedPaintOperations = true;
|
||||||
|
|
||||||
platformWindow()->adjustBufferSize();
|
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()
|
void QQnxRasterBackingStore::endPaint()
|
||||||
|
@ -128,15 +128,16 @@ bool QQnxVirtualKeyboardPps::connect()
|
|||||||
m_fd = ::open(ms_PPSPath, O_RDWR);
|
m_fd = ::open(ms_PPSPath, O_RDWR);
|
||||||
if (m_fd == -1)
|
if (m_fd == -1)
|
||||||
{
|
{
|
||||||
qCritical("QQnxVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
|
qVirtualKeyboardDebug() << Q_FUNC_INFO << ": Unable to open" << ms_PPSPath
|
||||||
ms_PPSPath, strerror(errno), errno);
|
<< ":" << strerror(errno);
|
||||||
close();
|
close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_buffer = new char[ms_bufferSize];
|
m_buffer = new char[ms_bufferSize];
|
||||||
if (!m_buffer) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +157,7 @@ bool QQnxVirtualKeyboardPps::queryPPSInfo()
|
|||||||
|
|
||||||
// Request info, requires id to regenerate res message.
|
// Request info, requires id to regenerate res message.
|
||||||
pps_encoder_add_string(m_encoder, "msg", "info");
|
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();
|
return writeCurrentPPSEncoder();
|
||||||
}
|
}
|
||||||
@ -220,7 +221,6 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
|
|||||||
void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
|
void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
|
||||||
{
|
{
|
||||||
int newHeight = 0;
|
int newHeight = 0;
|
||||||
const char *value;
|
|
||||||
|
|
||||||
if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) {
|
if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) {
|
||||||
qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found");
|
qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found");
|
||||||
@ -230,27 +230,9 @@ void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
|
|||||||
qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found");
|
qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found");
|
||||||
return;
|
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);
|
setHeight(newHeight);
|
||||||
|
|
||||||
const QLocale locale = QLocale(languageId + QLatin1Char('_') + countryId);
|
qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight;
|
||||||
setLocale(locale);
|
|
||||||
|
|
||||||
qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight << "locale=" << locale;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QQnxVirtualKeyboardPps::showKeyboard()
|
bool QQnxVirtualKeyboardPps::showKeyboard()
|
||||||
|
@ -364,7 +364,7 @@ bool QWindowsMouseHandler::translateMouseWheelEvent(QWindow *window, HWND,
|
|||||||
delta = (int) msg.wParam;
|
delta = (int) msg.wParam;
|
||||||
|
|
||||||
Qt::Orientation orientation = (msg.message == WM_MOUSEHWHEEL
|
Qt::Orientation orientation = (msg.message == WM_MOUSEHWHEEL
|
||||||
|| (buttons & Qt::AltModifier)) ?
|
|| (mods & Qt::AltModifier)) ?
|
||||||
Qt::Horizontal : Qt::Vertical;
|
Qt::Horizontal : Qt::Vertical;
|
||||||
|
|
||||||
// according to the MSDN documentation on WM_MOUSEHWHEEL:
|
// according to the MSDN documentation on WM_MOUSEHWHEEL:
|
||||||
|
@ -425,17 +425,8 @@ QWinRTScreen::QWinRTScreen(ICoreWindow *window)
|
|||||||
#endif
|
#endif
|
||||||
, m_cursor(new QWinRTCursor(window))
|
, m_cursor(new QWinRTCursor(window))
|
||||||
, m_orientation(Qt::PrimaryOrientation)
|
, 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;
|
Rect rect;
|
||||||
window->get_Bounds(&rect);
|
window->get_Bounds(&rect);
|
||||||
m_geometry = QRect(0, 0, rect.Width, rect.Height);
|
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)))
|
if (FAILED(pointerPoint->get_Properties(&properties)))
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
#ifdef Q_OS_WINPHONE
|
PointerDeviceType pointerDeviceType;
|
||||||
quint32 pointerId = 0;
|
#if defined(Q_OS_WINPHONE) && _MSC_VER <= 1700
|
||||||
Pointer pointer = m_pointers.value(pointerId);
|
pointerDeviceType = PointerDeviceType_Touch;
|
||||||
#else
|
#else
|
||||||
Pointer pointer = { Pointer::Unknown, 0 };
|
ComPtr<IPointerDevice> pointerDevice;
|
||||||
quint32 pointerId;
|
HRESULT hr = pointerPoint->get_PointerDevice(&pointerDevice);
|
||||||
pointerPoint->get_PointerId(&pointerId);
|
if (FAILED(hr)) {
|
||||||
if (m_pointers.contains(pointerId)) {
|
qErrnoWarning(hr, "Failed to get pointer device.");
|
||||||
pointer = m_pointers.value(pointerId);
|
return S_OK;
|
||||||
} 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:
|
hr = pointerDevice->get_PointerDeviceType(&pointerDeviceType);
|
||||||
pointer.type = Pointer::Tablet;
|
if (FAILED(hr)) {
|
||||||
break;
|
qErrnoWarning(hr, "Failed to get pointer device type.");
|
||||||
|
return S_OK;
|
||||||
case PointerDeviceType_Mouse:
|
|
||||||
pointer.type = Pointer::Mouse;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pointers.insert(pointerId, pointer);
|
|
||||||
device->Release();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
switch (pointer.type) {
|
switch (pointerDeviceType) {
|
||||||
case Pointer::Mouse: {
|
case PointerDeviceType_Mouse: {
|
||||||
qint32 delta;
|
qint32 delta;
|
||||||
properties->get_MouseWheelDelta(&delta);
|
properties->get_MouseWheelDelta(&delta);
|
||||||
if (delta) {
|
if (delta) {
|
||||||
@ -840,7 +809,15 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
|
|||||||
|
|
||||||
break;
|
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;
|
quint32 id;
|
||||||
pointerPoint->get_PointerId(&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().normalPosition = QPointF(pos.x()/m_geometry.width(), pos.y()/m_geometry.height());
|
||||||
it.value().pressure = pressure;
|
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
|
// Remove released points, station others
|
||||||
for (QHash<quint32, QWindowSystemInterface::TouchPoint>::iterator i = m_touchPoints.begin(); i != m_touchPoints.end();) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case Pointer::Tablet: {
|
case PointerDeviceType_Pen: {
|
||||||
quint32 id;
|
quint32 id;
|
||||||
pointerPoint->get_PointerId(&id);
|
pointerPoint->get_PointerId(&id);
|
||||||
|
|
||||||
@ -903,7 +880,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *window, IPointerEventArgs *a
|
|||||||
float rotation;
|
float rotation;
|
||||||
properties->get_Twist(&rotation);
|
properties->get_Twist(&rotation);
|
||||||
|
|
||||||
QWindowSystemInterface::handleTabletEvent(topWindow(), isPressed, pos, pos, pointerId,
|
QWindowSystemInterface::handleTabletEvent(topWindow(), isPressed, pos, pos, 0,
|
||||||
pointerType, pressure, xTilt, yTilt,
|
pointerType, pressure, xTilt, yTilt,
|
||||||
0, rotation, 0, id, mods);
|
0, rotation, 0, id, mods);
|
||||||
|
|
||||||
|
@ -101,12 +101,6 @@ class QWinRTPageFlipper;
|
|||||||
class QWinRTCursor;
|
class QWinRTCursor;
|
||||||
class QWinRTInputContext;
|
class QWinRTInputContext;
|
||||||
|
|
||||||
struct Pointer {
|
|
||||||
enum Type { Unknown, Mouse, TouchScreen, Tablet };
|
|
||||||
Type type;
|
|
||||||
QTouchDevice *device;
|
|
||||||
};
|
|
||||||
|
|
||||||
class QWinRTScreen : public QPlatformScreen
|
class QWinRTScreen : public QPlatformScreen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -165,6 +159,7 @@ private:
|
|||||||
ABI::Windows::UI::Core::ICoreWindow *m_coreWindow;
|
ABI::Windows::UI::Core::ICoreWindow *m_coreWindow;
|
||||||
ABI::Windows::UI::ViewManagement::IApplicationViewStatics *m_applicationView;
|
ABI::Windows::UI::ViewManagement::IApplicationViewStatics *m_applicationView;
|
||||||
ABI::Windows::ApplicationModel::Core::ICoreApplication *m_application;
|
ABI::Windows::ApplicationModel::Core::ICoreApplication *m_application;
|
||||||
|
|
||||||
QRect m_geometry;
|
QRect m_geometry;
|
||||||
QImage::Format m_format;
|
QImage::Format m_format;
|
||||||
QSurfaceFormat m_surfaceFormat;
|
QSurfaceFormat m_surfaceFormat;
|
||||||
@ -183,7 +178,7 @@ private:
|
|||||||
#ifndef Q_OS_WINPHONE
|
#ifndef Q_OS_WINPHONE
|
||||||
QHash<quint32, QPair<Qt::Key, QString> > m_activeKeys;
|
QHash<quint32, QPair<Qt::Key, QString> > m_activeKeys;
|
||||||
#endif
|
#endif
|
||||||
QHash<quint32, Pointer> m_pointers;
|
QTouchDevice *m_touchDevice;
|
||||||
QHash<quint32, QWindowSystemInterface::TouchPoint> m_touchPoints;
|
QHash<quint32, QWindowSystemInterface::TouchPoint> m_touchPoints;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1791,19 +1791,6 @@ bool QXcbConnection::xi2GetValuatorValueIfSet(void *event, int valuatorNum, doub
|
|||||||
return true;
|
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:
|
// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
|
||||||
// - "pad0" became "extension"
|
// - "pad0" became "extension"
|
||||||
// - "pad1" and "pad" became "pad0"
|
// - "pad1" and "pad" became "pad0"
|
||||||
|
@ -533,7 +533,6 @@ private:
|
|||||||
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
|
#if defined(XCB_USE_XINPUT2) || defined(XCB_USE_XINPUT2_MAEMO)
|
||||||
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
|
static bool xi2GetValuatorValueIfSet(void *event, int valuatorNum, double *value);
|
||||||
static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
|
static bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode);
|
||||||
static bool xi2GetButtonState(void *event, int buttonNum);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xcb_connection_t *m_connection;
|
xcb_connection_t *m_connection;
|
||||||
|
@ -575,7 +575,7 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
|
|||||||
#ifdef XCB_USE_XINPUT21
|
#ifdef XCB_USE_XINPUT21
|
||||||
xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
|
xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
|
||||||
|
|
||||||
if (xiEvent->evtype == XI_Motion) {
|
if (xiEvent->evtype == XI_Motion && scrollingDevice.orientations) {
|
||||||
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
|
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
|
||||||
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
|
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
|
||||||
QPoint rawDelta;
|
QPoint rawDelta;
|
||||||
@ -612,20 +612,20 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
|
|||||||
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiEvent->time, local, global, rawDelta, angleDelta, modifiers);
|
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);
|
xXIDeviceEvent* xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
|
||||||
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
|
if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) {
|
||||||
QPoint angleDelta;
|
QPoint angleDelta;
|
||||||
if (scrollingDevice.legacyOrientations & Qt::Vertical) {
|
if (scrollingDevice.legacyOrientations & Qt::Vertical) {
|
||||||
if (xi2GetButtonState(xiDeviceEvent, 4))
|
if (xiDeviceEvent->detail == 4)
|
||||||
angleDelta.setY(120);
|
angleDelta.setY(120);
|
||||||
else if (xi2GetButtonState(xiDeviceEvent, 5))
|
else if (xiDeviceEvent->detail == 5)
|
||||||
angleDelta.setY(-120);
|
angleDelta.setY(-120);
|
||||||
}
|
}
|
||||||
if (scrollingDevice.legacyOrientations & Qt::Horizontal) {
|
if (scrollingDevice.legacyOrientations & Qt::Horizontal) {
|
||||||
if (xi2GetButtonState(xiDeviceEvent, 6))
|
if (xiDeviceEvent->detail == 6)
|
||||||
angleDelta.setX(120);
|
angleDelta.setX(120);
|
||||||
if (xi2GetButtonState(xiDeviceEvent, 7))
|
else if (xiDeviceEvent->detail == 7)
|
||||||
angleDelta.setX(-120);
|
angleDelta.setX(-120);
|
||||||
}
|
}
|
||||||
if (!angleDelta.isNull()) {
|
if (!angleDelta.isNull()) {
|
||||||
|
@ -2143,18 +2143,26 @@ char *toHexRepresentation(const char *ba, int length)
|
|||||||
char *toPrettyUnicode(const ushort *p, int length)
|
char *toPrettyUnicode(const ushort *p, int length)
|
||||||
{
|
{
|
||||||
// keep it simple for the vast majority of cases
|
// 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;
|
const ushort *end = p + length;
|
||||||
char *dst = buffer.data();
|
char *dst = buffer.data();
|
||||||
|
|
||||||
*dst++ = '"';
|
*dst++ = '"';
|
||||||
for ( ; p != end; ++p) {
|
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 != '\\') {
|
if (*p < 0x7f && *p >= 0x20 && *p != '\\') {
|
||||||
*dst++ = *p;
|
*dst++ = *p;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// write as an escape sequence
|
// write as an escape sequence
|
||||||
|
// this means we may advance dst to buffer.data() + 246 or 250
|
||||||
*dst++ = '\\';
|
*dst++ = '\\';
|
||||||
switch (*p) {
|
switch (*p) {
|
||||||
case 0x22:
|
case 0x22:
|
||||||
@ -2186,6 +2194,11 @@ char *toPrettyUnicode(const ushort *p, int length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
*dst++ = '"';
|
*dst++ = '"';
|
||||||
|
if (trimmed) {
|
||||||
|
*dst++ = '.';
|
||||||
|
*dst++ = '.';
|
||||||
|
*dst++ = '.';
|
||||||
|
}
|
||||||
*dst++ = '\0';
|
*dst++ = '\0';
|
||||||
return buffer.take();
|
return buffer.take();
|
||||||
}
|
}
|
||||||
|
@ -2177,6 +2177,7 @@ QAction *QMenu::exec()
|
|||||||
QAction *QMenu::exec(const QPoint &p, QAction *action)
|
QAction *QMenu::exec(const QPoint &p, QAction *action)
|
||||||
{
|
{
|
||||||
Q_D(QMenu);
|
Q_D(QMenu);
|
||||||
|
ensurePolished();
|
||||||
createWinId();
|
createWinId();
|
||||||
QEventLoop eventLoop;
|
QEventLoop eventLoop;
|
||||||
d->eventLoop = &eventLoop;
|
d->eventLoop = &eventLoop;
|
||||||
|
@ -247,6 +247,13 @@ private:
|
|||||||
QString testFileName;
|
QString testFileName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void runOnExit()
|
||||||
|
{
|
||||||
|
QByteArray buffer;
|
||||||
|
QTextStream(&buffer) << "This will try to use QTextCodec::codecForLocale" << endl;
|
||||||
|
}
|
||||||
|
Q_DESTRUCTOR_FUNCTION(runOnExit)
|
||||||
|
|
||||||
tst_QTextStream::tst_QTextStream()
|
tst_QTextStream::tst_QTextStream()
|
||||||
: tempDir(QDir::tempPath() + "/tst_qtextstream.XXXXXX")
|
: tempDir(QDir::tempPath() + "/tst_qtextstream.XXXXXX")
|
||||||
{
|
{
|
||||||
|
@ -715,6 +715,10 @@ void tst_QDateTime::toString_isoDate_data()
|
|||||||
QTest::newRow("negative OffsetFromUTC")
|
QTest::newRow("negative OffsetFromUTC")
|
||||||
<< dt
|
<< dt
|
||||||
<< QString("1978-11-09T13:28:34-02:00");
|
<< QString("1978-11-09T13:28:34-02:00");
|
||||||
|
dt.setUtcOffset(-900);
|
||||||
|
QTest::newRow("negative non-integral OffsetFromUTC")
|
||||||
|
<< dt
|
||||||
|
<< QString("1978-11-09T13:28:34-00:15");
|
||||||
QTest::newRow("invalid")
|
QTest::newRow("invalid")
|
||||||
<< QDateTime(QDate(-1, 11, 9), QTime(13, 28, 34), Qt::UTC)
|
<< QDateTime(QDate(-1, 11, 9), QTime(13, 28, 34), Qt::UTC)
|
||||||
<< QString();
|
<< QString();
|
||||||
@ -1895,8 +1899,12 @@ void tst_QDateTime::fromStringDateFormat_data()
|
|||||||
// Test Qt::ISODate format.
|
// Test Qt::ISODate format.
|
||||||
QTest::newRow("ISO +01:00") << QString::fromLatin1("1987-02-13T13:24:51+01:00")
|
QTest::newRow("ISO +01:00") << QString::fromLatin1("1987-02-13T13:24:51+01:00")
|
||||||
<< Qt::ISODate << QDateTime(QDate(1987, 2, 13), QTime(12, 24, 51), Qt::UTC);
|
<< Qt::ISODate << QDateTime(QDate(1987, 2, 13), QTime(12, 24, 51), Qt::UTC);
|
||||||
|
QTest::newRow("ISO +00:01") << QString::fromLatin1("1987-02-13T13:24:51+00:01")
|
||||||
|
<< Qt::ISODate << QDateTime(QDate(1987, 2, 13), QTime(13, 23, 51), Qt::UTC);
|
||||||
QTest::newRow("ISO -01:00") << QString::fromLatin1("1987-02-13T13:24:51-01:00")
|
QTest::newRow("ISO -01:00") << QString::fromLatin1("1987-02-13T13:24:51-01:00")
|
||||||
<< Qt::ISODate << QDateTime(QDate(1987, 2, 13), QTime(14, 24, 51), Qt::UTC);
|
<< Qt::ISODate << QDateTime(QDate(1987, 2, 13), QTime(14, 24, 51), Qt::UTC);
|
||||||
|
QTest::newRow("ISO -00:01") << QString::fromLatin1("1987-02-13T13:24:51-00:01")
|
||||||
|
<< Qt::ISODate << QDateTime(QDate(1987, 2, 13), QTime(13, 25, 51), Qt::UTC);
|
||||||
QTest::newRow("ISO +0000") << QString::fromLatin1("1970-01-01T00:12:34+0000")
|
QTest::newRow("ISO +0000") << QString::fromLatin1("1970-01-01T00:12:34+0000")
|
||||||
<< Qt::ISODate << QDateTime(QDate(1970, 1, 1), QTime(0, 12, 34), Qt::UTC);
|
<< Qt::ISODate << QDateTime(QDate(1970, 1, 1), QTime(0, 12, 34), Qt::UTC);
|
||||||
QTest::newRow("ISO +00:00") << QString::fromLatin1("1970-01-01T00:12:34+00:00")
|
QTest::newRow("ISO +00:00") << QString::fromLatin1("1970-01-01T00:12:34+00:00")
|
||||||
|
@ -367,11 +367,11 @@ void emitSignalPeer(const QString &interface, const QString &name, const QVarian
|
|||||||
QTest::qWait(1000);
|
QTest::qWait(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* slotSpyPeer()
|
QString slotSpyPeer()
|
||||||
{
|
{
|
||||||
QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "slotSpyServer");
|
QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "slotSpyServer");
|
||||||
QDBusMessage reply = QDBusConnection::sessionBus().call(req);
|
QDBusMessage reply = QDBusConnection::sessionBus().call(req);
|
||||||
return reply.arguments().at(0).toString().toLatin1().data();
|
return reply.arguments().at(0).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString valueSpyPeer()
|
QString valueSpyPeer()
|
||||||
@ -1108,7 +1108,7 @@ void tst_QDBusAbstractAdaptor::methodCallsPeer()
|
|||||||
|
|
||||||
// simple call: one such method exists
|
// simple call: one such method exists
|
||||||
QCOMPARE(if2.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if2.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface2::method()");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface2::method()"));
|
||||||
if (!nInterfaces--)
|
if (!nInterfaces--)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1121,24 +1121,24 @@ void tst_QDBusAbstractAdaptor::methodCallsPeer()
|
|||||||
QCOMPARE(if2.call(QDBus::BlockWithGui, "methodString").type(), QDBusMessage::ErrorMessage);
|
QCOMPARE(if2.call(QDBus::BlockWithGui, "methodString").type(), QDBusMessage::ErrorMessage);
|
||||||
|
|
||||||
QCOMPARE(if3.call(QDBus::BlockWithGui, "methodVoid").type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if3.call(QDBus::BlockWithGui, "methodVoid").type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface3::methodVoid()");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface3::methodVoid()"));
|
||||||
QCOMPARE(if3.call(QDBus::BlockWithGui, "methodInt", 42).type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if3.call(QDBus::BlockWithGui, "methodInt", 42).type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface3::methodInt(int)");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface3::methodInt(int)"));
|
||||||
QCOMPARE(if3.call(QDBus::BlockWithGui, "methodString", QString("")).type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if3.call(QDBus::BlockWithGui, "methodString", QString("")).type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface3::methodString(QString)");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface3::methodString(QString)"));
|
||||||
|
|
||||||
if (!nInterfaces--)
|
if (!nInterfaces--)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// method overloading: different interfaces
|
// method overloading: different interfaces
|
||||||
QCOMPARE(if4.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if4.call(QDBus::BlockWithGui, "method").type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface4::method()");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface4::method()"));
|
||||||
|
|
||||||
// method overloading: different parameters
|
// method overloading: different parameters
|
||||||
QCOMPARE(if4.call(QDBus::BlockWithGui, "method.i", 42).type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if4.call(QDBus::BlockWithGui, "method.i", 42).type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface4::method(int)");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface4::method(int)"));
|
||||||
QCOMPARE(if4.call(QDBus::BlockWithGui, "method.s", QString()).type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if4.call(QDBus::BlockWithGui, "method.s", QString()).type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface4::method(QString)");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface4::method(QString)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDBusAbstractAdaptor::methodCallScriptablePeer()
|
void tst_QDBusAbstractAdaptor::methodCallScriptablePeer()
|
||||||
@ -1152,7 +1152,7 @@ void tst_QDBusAbstractAdaptor::methodCallScriptablePeer()
|
|||||||
QDBusInterface if2(QString(), "/", "local.Interface2", con);
|
QDBusInterface if2(QString(), "/", "local.Interface2", con);
|
||||||
|
|
||||||
QCOMPARE(if2.call(QDBus::BlockWithGui,"scriptableMethod").type(), QDBusMessage::ReplyMessage);
|
QCOMPARE(if2.call(QDBus::BlockWithGui,"scriptableMethod").type(), QDBusMessage::ReplyMessage);
|
||||||
QCOMPARE(slotSpyPeer(), "void Interface2::scriptableMethod()");
|
QCOMPARE(slotSpyPeer(), QStringLiteral("void Interface2::scriptableMethod()"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QDBusAbstractAdaptor::signalEmissionsPeer_data()
|
void tst_QDBusAbstractAdaptor::signalEmissionsPeer_data()
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
SOURCES = qpinger.cpp ../interface.cpp
|
SOURCES = qpinger.cpp ../interface.cpp
|
||||||
HEADERS = ../interface.h
|
HEADERS = ../interface.h
|
||||||
TARGET = qpinger
|
TARGET = qpinger
|
||||||
|
CONFIG -= app_bundle
|
||||||
|
CONFIG += console
|
||||||
QT = core dbus
|
QT = core dbus
|
||||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
SOURCES = qpong.cpp
|
SOURCES = qpong.cpp
|
||||||
TARGET = qpong
|
TARGET = qpong
|
||||||
QT = core dbus
|
QT = core dbus
|
||||||
|
CONFIG -= app_bundle
|
||||||
|
CONFIG += console
|
||||||
|
|
||||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
|
||||||
|
@ -4631,32 +4631,28 @@ void tst_QWidget::windowMoveResize()
|
|||||||
|
|
||||||
QTest::qWait(10);
|
QTest::qWait(10);
|
||||||
QTRY_COMPARE(widget.pos(), rect.topLeft());
|
QTRY_COMPARE(widget.pos(), rect.topLeft());
|
||||||
if (m_platform == QStringLiteral("windows")) {
|
// Windows: Minimum size of decorated windows.
|
||||||
QEXPECT_FAIL("130,100 0x200, flags 0", "QTBUG-26424", Continue);
|
const bool expectResizeFail = (!windowFlags && (rect.width() < 160 || rect.height() < 40))
|
||||||
QEXPECT_FAIL("130,50 0x0, flags 0", "QTBUG-26424", Continue);
|
&& m_platform == QStringLiteral("windows");
|
||||||
}
|
if (!expectResizeFail)
|
||||||
QTRY_COMPARE(widget.size(), rect.size());
|
QTRY_COMPARE(widget.size(), rect.size());
|
||||||
|
|
||||||
// move() while shown
|
// move() while shown
|
||||||
foreach (const QRect &r, rects) {
|
foreach (const QRect &r, rects) {
|
||||||
if (m_platform == QStringLiteral("xcb")
|
// XCB: First resize after show of zero-sized gets wrong win_gravity.
|
||||||
&& ((widget.width() == 0 || widget.height() == 0) && r.width() != 0 && r.height() != 0)) {
|
const bool expectMoveFail = !windowFlags
|
||||||
QEXPECT_FAIL("130,100 0x200, flags 0",
|
&& ((widget.width() == 0 || widget.height() == 0) && r.width() != 0 && r.height() != 0)
|
||||||
"First resize after show of zero-sized gets wrong win_gravity.",
|
&& m_platform == QStringLiteral("xcb")
|
||||||
Continue);
|
&& (rect == QRect(QPoint(130, 100), QSize(0, 200))
|
||||||
QEXPECT_FAIL("100,50 200x0, flags 0",
|
|| rect == QRect(QPoint(100, 50), QSize(200, 0))
|
||||||
"First resize after show of zero-sized gets wrong win_gravity.",
|
|| rect == QRect(QPoint(130, 50), QSize(0, 0)));
|
||||||
Continue);
|
|
||||||
QEXPECT_FAIL("130,50 0x0, flags 0",
|
|
||||||
"First resize after show of zero-sized gets wrong win_gravity.",
|
|
||||||
Continue);
|
|
||||||
}
|
|
||||||
|
|
||||||
widget.move(r.topLeft());
|
widget.move(r.topLeft());
|
||||||
widget.resize(r.size());
|
widget.resize(r.size());
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTRY_COMPARE(widget.pos(), r.topLeft());
|
if (!expectMoveFail) {
|
||||||
QTRY_COMPARE(widget.size(), r.size());
|
QTRY_COMPARE(widget.pos(), r.topLeft());
|
||||||
|
QTRY_COMPARE(widget.size(), r.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
widget.move(rect.topLeft());
|
widget.move(rect.topLeft());
|
||||||
widget.resize(rect.size());
|
widget.resize(rect.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user