Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ief0a0b754c104d5348fee9ee15e967bd37c526f8
This commit is contained in:
commit
11b9c813e6
@ -125,11 +125,8 @@ goto doneargs
|
|||||||
|
|
||||||
:platform
|
:platform
|
||||||
shift
|
shift
|
||||||
if "%~1" == "win32-msvc2012" goto msvc
|
|
||||||
if "%~1" == "win32-msvc2013" goto msvc
|
|
||||||
if "%~1" == "win32-msvc2015" goto msvc
|
|
||||||
if "%~1" == "win32-msvc2017" goto msvc
|
|
||||||
set PLATFORM=%~1
|
set PLATFORM=%~1
|
||||||
|
if "%PLATFORM:~0,10%" == "win32-msvc" goto msvc
|
||||||
goto nextarg
|
goto nextarg
|
||||||
:msvc
|
:msvc
|
||||||
echo. >&2
|
echo. >&2
|
||||||
@ -150,7 +147,7 @@ goto doneargs
|
|||||||
:doneargs
|
:doneargs
|
||||||
|
|
||||||
rem Find various executables
|
rem Find various executables
|
||||||
for %%C in (clang-cl.exe cl.exe icl.exe g++.exe perl.exe jom.exe) do set %%C=%%~$PATH:C
|
for %%C in (clang-cl.exe clang.exe cl.exe icl.exe g++.exe perl.exe jom.exe) do set %%C=%%~$PATH:C
|
||||||
|
|
||||||
rem Determine host spec
|
rem Determine host spec
|
||||||
|
|
||||||
@ -161,6 +158,8 @@ if "%PLATFORM%" == "" (
|
|||||||
set PLATFORM=win32-msvc
|
set PLATFORM=win32-msvc
|
||||||
) else if not "%clang-cl.exe%" == "" (
|
) else if not "%clang-cl.exe%" == "" (
|
||||||
set PLATFORM=win32-clang-msvc
|
set PLATFORM=win32-clang-msvc
|
||||||
|
) else if not "%clang.exe%" == "" (
|
||||||
|
set PLATFORM=win32-clang-g++
|
||||||
) else if not "%g++.exe%" == "" (
|
) else if not "%g++.exe%" == "" (
|
||||||
set PLATFORM=win32-g++
|
set PLATFORM=win32-g++
|
||||||
) else (
|
) else (
|
||||||
@ -172,7 +171,7 @@ if not exist "%QTSRC%\mkspecs\%PLATFORM%\qmake.conf" (
|
|||||||
echo Host platform '%PLATFORM%' is invalid. Aborting. >&2
|
echo Host platform '%PLATFORM%' is invalid. Aborting. >&2
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
if "%PLATFORM:win32-g++=%" == "%PLATFORM%" (
|
if "%PLATFORM:g++=%" == "%PLATFORM%" (
|
||||||
if "%MAKE%" == "" (
|
if "%MAKE%" == "" (
|
||||||
if not "%jom.exe%" == "" (
|
if not "%jom.exe%" == "" (
|
||||||
set MAKE=jom
|
set MAKE=jom
|
||||||
|
@ -69,7 +69,7 @@ class LcdNumber : public QFrame
|
|||||||
//! [6]
|
//! [6]
|
||||||
public:
|
public:
|
||||||
//! [6] //! [7]
|
//! [6] //! [7]
|
||||||
LcdNumber(QWidget *parent = 0);
|
LcdNumber(QWidget *parent = nullptr);
|
||||||
//! [7]
|
//! [7]
|
||||||
|
|
||||||
//! [8]
|
//! [8]
|
||||||
|
@ -330,7 +330,7 @@
|
|||||||
arguments can have default values. Consider QObject::destroyed():
|
arguments can have default values. Consider QObject::destroyed():
|
||||||
|
|
||||||
\code
|
\code
|
||||||
void destroyed(QObject* = 0);
|
void destroyed(QObject* = nullptr);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
When a QObject is deleted, it emits this QObject::destroyed()
|
When a QObject is deleted, it emits this QObject::destroyed()
|
||||||
@ -339,7 +339,7 @@
|
|||||||
A suitable slot signature might be:
|
A suitable slot signature might be:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
void objectDestroyed(QObject* obj = 0);
|
void objectDestroyed(QObject* obj = nullptr);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
To connect the signal to the slot, we use QObject::connect().
|
To connect the signal to the slot, we use QObject::connect().
|
||||||
|
@ -120,15 +120,30 @@ private:
|
|||||||
return category; \
|
return category; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define qCDebug(category, ...) \
|
#if !defined(QT_NO_DEBUG_OUTPUT)
|
||||||
|
# define qCDebug(category, ...) \
|
||||||
for (bool qt_category_enabled = category().isDebugEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
for (bool qt_category_enabled = category().isDebugEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
||||||
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).debug(__VA_ARGS__)
|
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).debug(__VA_ARGS__)
|
||||||
#define qCInfo(category, ...) \
|
#else
|
||||||
|
# define qCDebug(category, ...) QT_NO_QDEBUG_MACRO()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(QT_NO_INFO_OUTPUT)
|
||||||
|
# define qCInfo(category, ...) \
|
||||||
for (bool qt_category_enabled = category().isInfoEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
for (bool qt_category_enabled = category().isInfoEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
||||||
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).info(__VA_ARGS__)
|
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).info(__VA_ARGS__)
|
||||||
#define qCWarning(category, ...) \
|
#else
|
||||||
|
# define qCInfo(category, ...) QT_NO_QDEBUG_MACRO()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(QT_NO_WARNING_OUTPUT)
|
||||||
|
# define qCWarning(category, ...) \
|
||||||
for (bool qt_category_enabled = category().isWarningEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
for (bool qt_category_enabled = category().isWarningEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
||||||
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).warning(__VA_ARGS__)
|
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).warning(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
# define qCWarning(category, ...) QT_NO_QDEBUG_MACRO()
|
||||||
|
#endif
|
||||||
|
|
||||||
#define qCCritical(category, ...) \
|
#define qCCritical(category, ...) \
|
||||||
for (bool qt_category_enabled = category().isCriticalEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
for (bool qt_category_enabled = category().isCriticalEnabled(); qt_category_enabled; qt_category_enabled = false) \
|
||||||
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).critical(__VA_ARGS__)
|
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).critical(__VA_ARGS__)
|
||||||
@ -144,26 +159,28 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check for enabled category inside QMessageLogger.
|
// check for enabled category inside QMessageLogger.
|
||||||
#define qCDebug qDebug
|
#if !defined(QT_NO_DEBUG_OUTPUT)
|
||||||
#define qCInfo qInfo
|
# define qCDebug qDebug
|
||||||
#define qCWarning qWarning
|
#else
|
||||||
|
# define qCDebug(category) QT_NO_QDEBUG_MACRO()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(QT_NO_INFO_OUTPUT)
|
||||||
|
# define qCInfo qInfo
|
||||||
|
#else
|
||||||
|
# define qCInfo(category) QT_NO_QDEBUG_MACRO()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(QT_NO_WARNING_OUTPUT)
|
||||||
|
# define qCWarning qWarning
|
||||||
|
#else
|
||||||
|
# define qCWarning(category) QT_NO_QDEBUG_MACRO()
|
||||||
|
#endif
|
||||||
|
|
||||||
#define qCCritical qCritical
|
#define qCCritical qCritical
|
||||||
|
|
||||||
#endif // Q_COMPILER_VARIADIC_MACROS || defined(Q_MOC_RUN)
|
#endif // Q_COMPILER_VARIADIC_MACROS || defined(Q_MOC_RUN)
|
||||||
|
|
||||||
#if defined(QT_NO_DEBUG_OUTPUT)
|
|
||||||
# undef qCDebug
|
|
||||||
# define qCDebug(category) QT_NO_QDEBUG_MACRO()
|
|
||||||
#endif
|
|
||||||
#if defined(QT_NO_INFO_OUTPUT)
|
|
||||||
# undef qCInfo
|
|
||||||
# define qCInfo(category) QT_NO_QDEBUG_MACRO()
|
|
||||||
#endif
|
|
||||||
#if defined(QT_NO_WARNING_OUTPUT)
|
|
||||||
# undef qCWarning
|
|
||||||
# define qCWarning(category) QT_NO_QDEBUG_MACRO()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QLOGGINGCATEGORY_H
|
#endif // QLOGGINGCATEGORY_H
|
||||||
|
@ -48,22 +48,24 @@
|
|||||||
|
|
||||||
QT_REQUIRE_CONFIG(processenvironment);
|
QT_REQUIRE_CONFIG(processenvironment);
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
typedef struct _PROCESS_INFORMATION *Q_PID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
|
||||||
|
typedef struct _SECURITY_ATTRIBUTES Q_SECURITY_ATTRIBUTES;
|
||||||
|
typedef struct _STARTUPINFOW Q_STARTUPINFO;
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QProcessPrivate;
|
class QProcessPrivate;
|
||||||
|
|
||||||
#if !defined(Q_OS_WIN)
|
|
||||||
typedef qint64 Q_PID;
|
|
||||||
#else
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
typedef struct _PROCESS_INFORMATION *Q_PID;
|
|
||||||
typedef struct _SECURITY_ATTRIBUTES Q_SECURITY_ATTRIBUTES;
|
|
||||||
typedef struct _STARTUPINFOW Q_STARTUPINFO;
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class QProcessEnvironmentPrivate;
|
class QProcessEnvironmentPrivate;
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
|
typedef qint64 Q_PID;
|
||||||
|
#endif
|
||||||
|
|
||||||
class Q_CORE_EXPORT QProcessEnvironment
|
class Q_CORE_EXPORT QProcessEnvironment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -420,7 +420,7 @@ QDebug operator<<(QDebug dbg, QCborKnownTags tag)
|
|||||||
\value IllegalSimpleType The CBOR stream contains a Simple Type encoded incorrectly (data is
|
\value IllegalSimpleType The CBOR stream contains a Simple Type encoded incorrectly (data is
|
||||||
corrupt and the error is not recoverable).
|
corrupt and the error is not recoverable).
|
||||||
\value InvalidUtf8String The CBOR stream contains a text string that does not decode properly
|
\value InvalidUtf8String The CBOR stream contains a text string that does not decode properly
|
||||||
as UTF (data is corrupt and the error is not recoverable).
|
as UTF-8 (data is corrupt and the error is not recoverable).
|
||||||
\value DataTooLarge CBOR string, map or array is too big and cannot be parsed by Qt
|
\value DataTooLarge CBOR string, map or array is too big and cannot be parsed by Qt
|
||||||
(internal limitation, but the error is not recoverable).
|
(internal limitation, but the error is not recoverable).
|
||||||
\value NestingTooDeep Too many levels of arrays or maps encountered while processing the
|
\value NestingTooDeep Too many levels of arrays or maps encountered while processing the
|
||||||
@ -429,6 +429,24 @@ QDebug operator<<(QDebug dbg, QCborKnownTags tag)
|
|||||||
support (internal limitation, but the error is not recoverable).
|
support (internal limitation, but the error is not recoverable).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Convert from CborError to QCborError.
|
||||||
|
//
|
||||||
|
// Centralized in a function in case we need to make more adjustments in the
|
||||||
|
// future.
|
||||||
|
static QCborError fromCborError(CborError err)
|
||||||
|
{
|
||||||
|
return { QCborError::Code(int(err)) };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert to CborError from QCborError.
|
||||||
|
//
|
||||||
|
// Centralized in a function in case we need to make more adjustments in the
|
||||||
|
// future.
|
||||||
|
static CborError toCborError(QCborError c)
|
||||||
|
{
|
||||||
|
return CborError(int(c.c));
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\variable QCborError::c
|
\variable QCborError::c
|
||||||
\internal
|
\internal
|
||||||
@ -499,8 +517,8 @@ QString QCborError::toString() const
|
|||||||
return QStringLiteral("Internal limitation: unsupported type");
|
return QStringLiteral("Internal limitation: unsupported type");
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the error from TinyCBOR
|
// get the error string from TinyCBOR
|
||||||
CborError err = CborError(int(c));
|
CborError err = toCborError(*this);
|
||||||
return QString::fromLatin1(cbor_error_string(err));
|
return QString::fromLatin1(cbor_error_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1839,8 +1857,7 @@ public:
|
|||||||
if (err != CborErrorUnexpectedEOF)
|
if (err != CborErrorUnexpectedEOF)
|
||||||
corrupt = true;
|
corrupt = true;
|
||||||
|
|
||||||
// our error codes are the same (for now)
|
lastError = fromCborError(err);
|
||||||
lastError = { QCborError::Code(err) };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateBufferAfterString(qsizetype offset, qsizetype size)
|
void updateBufferAfterString(qsizetype offset, qsizetype size)
|
||||||
|
@ -37,6 +37,12 @@ QT_BEGIN_NAMESPACE
|
|||||||
a scope.
|
a scope.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! \fn template <typename F> void QScopeGuard<F>::dismiss()
|
||||||
|
|
||||||
|
Disarms the scope guard, so that the function \e F will not be called at
|
||||||
|
the end of the scope.
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn template <typename F> const QScopeGuard<F> qScopeGuard(F f)
|
\fn template <typename F> const QScopeGuard<F> qScopeGuard(F f)
|
||||||
\inmodule QtCore
|
\inmodule QtCore
|
||||||
|
@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QIconPrivate;
|
class QIconPrivate;
|
||||||
class QIconEngine;
|
class QIconEngine;
|
||||||
|
class QPainter;
|
||||||
|
|
||||||
class Q_GUI_EXPORT QIcon
|
class Q_GUI_EXPORT QIcon
|
||||||
{
|
{
|
||||||
|
@ -313,7 +313,7 @@ QOpenGLContext *qt_gl_global_share_context()
|
|||||||
|
|
||||||
\section1 Context Resource Sharing
|
\section1 Context Resource Sharing
|
||||||
|
|
||||||
Resources, such as framebuffer objects, textures, and vertex buffer objects
|
Resources such as textures and vertex buffer objects
|
||||||
can be shared between contexts. Use setShareContext() before calling
|
can be shared between contexts. Use setShareContext() before calling
|
||||||
create() to specify that the contexts should share these resources.
|
create() to specify that the contexts should share these resources.
|
||||||
QOpenGLContext internally keeps track of a QOpenGLContextGroup object which
|
QOpenGLContext internally keeps track of a QOpenGLContextGroup object which
|
||||||
|
@ -4348,7 +4348,7 @@ QOpenGLTexture::DepthStencilMode QOpenGLTexture::depthStencilMode() const
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
\since 5.5
|
\since 5.5
|
||||||
|
|
||||||
Sets the texture comparison function on this texture to \a function. The texture
|
Sets the texture comparison function on this texture to \a function. The texture
|
||||||
|
@ -3407,7 +3407,7 @@ bool QRasterPaintEngine::requiresPretransformedGlyphPositions(QFontEngine *fontE
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Indicates whether glyph caching is supported by the font engine
|
Returns whether glyph caching is supported by the font engine
|
||||||
\a fontEngine with the given transform \a m applied.
|
\a fontEngine with the given transform \a m applied.
|
||||||
*/
|
*/
|
||||||
bool QRasterPaintEngine::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
|
bool QRasterPaintEngine::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
|
||||||
|
@ -1128,8 +1128,8 @@ QList<QSslCertificate> QSslSocket::peerCertificateChain() const
|
|||||||
handshake phase begins.
|
handshake phase begins.
|
||||||
|
|
||||||
\sa QSslConfiguration::ciphers(), QSslConfiguration::setCiphers(),
|
\sa QSslConfiguration::ciphers(), QSslConfiguration::setCiphers(),
|
||||||
QSslConfiguration::setDefaultCiphers(),
|
QSslConfiguration::setCiphers(),
|
||||||
QSslConfiguration::defaultCiphers(),
|
QSslConfiguration::ciphers(),
|
||||||
QSslConfiguration::supportedCiphers()
|
QSslConfiguration::supportedCiphers()
|
||||||
*/
|
*/
|
||||||
QSslCipher QSslSocket::sessionCipher() const
|
QSslCipher QSslSocket::sessionCipher() const
|
||||||
@ -1498,7 +1498,7 @@ QList<QSslCertificate> QSslSocket::caCertificates() const
|
|||||||
Each SSL socket's CA certificate database is initialized to the
|
Each SSL socket's CA certificate database is initialized to the
|
||||||
default CA certificate database.
|
default CA certificate database.
|
||||||
|
|
||||||
\sa QSslConfiguration::defaultCaCertificates(), addCaCertificates(),
|
\sa QSslConfiguration::caCertificates(), addCaCertificates(),
|
||||||
addDefaultCaCertificate()
|
addDefaultCaCertificate()
|
||||||
*/
|
*/
|
||||||
bool QSslSocket::addDefaultCaCertificates(const QString &path, QSsl::EncodingFormat encoding,
|
bool QSslSocket::addDefaultCaCertificates(const QString &path, QSsl::EncodingFormat encoding,
|
||||||
@ -1524,7 +1524,7 @@ void QSslSocket::addDefaultCaCertificate(const QSslCertificate &certificate)
|
|||||||
SSL socket's CA certificate database is initialized to the default
|
SSL socket's CA certificate database is initialized to the default
|
||||||
CA certificate database.
|
CA certificate database.
|
||||||
|
|
||||||
\sa QSslConfiguration::defaultCaCertificates(), addCaCertificates()
|
\sa QSslConfiguration::caCertificates(), addCaCertificates()
|
||||||
*/
|
*/
|
||||||
void QSslSocket::addDefaultCaCertificates(const QList<QSslCertificate> &certificates)
|
void QSslSocket::addDefaultCaCertificates(const QList<QSslCertificate> &certificates)
|
||||||
{
|
{
|
||||||
|
@ -695,7 +695,12 @@ int QWasmEventTranslator::wheel_cb(int eventType, const EmscriptenWheelEvent *wh
|
|||||||
|
|
||||||
int QWasmEventTranslator::touchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
|
int QWasmEventTranslator::touchCallback(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData)
|
||||||
{
|
{
|
||||||
QWasmEventTranslator *eventTranslator = static_cast<QWasmEventTranslator *>(userData);
|
auto translator = reinterpret_cast<QWasmEventTranslator*>(userData);
|
||||||
|
return translator->handleTouch(eventType, touchEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
int QWasmEventTranslator::handleTouch(int eventType, const EmscriptenTouchEvent *touchEvent)
|
||||||
|
{
|
||||||
QList<QWindowSystemInterface::TouchPoint> touchPointList;
|
QList<QWindowSystemInterface::TouchPoint> touchPointList;
|
||||||
touchPointList.reserve(touchEvent->numTouches);
|
touchPointList.reserve(touchEvent->numTouches);
|
||||||
QWindow *window2;
|
QWindow *window2;
|
||||||
@ -704,50 +709,68 @@ int QWasmEventTranslator::touchCallback(int eventType, const EmscriptenTouchEven
|
|||||||
|
|
||||||
const EmscriptenTouchPoint *touches = &touchEvent->touches[i];
|
const EmscriptenTouchPoint *touches = &touchEvent->touches[i];
|
||||||
|
|
||||||
QPoint point(touches->canvasX, touches->canvasY);
|
QPoint point(touches->targetX, touches->targetY);
|
||||||
window2 = eventTranslator->screen()->compositor()->windowAt(point, 5);
|
window2 = this->screen()->compositor()->windowAt(point, 5);
|
||||||
|
|
||||||
QWindowSystemInterface::TouchPoint touchPoint;
|
QWindowSystemInterface::TouchPoint touchPoint;
|
||||||
|
|
||||||
auto cX = point.x();
|
|
||||||
auto cY = point.y();
|
|
||||||
touchPoint.area = QRect(0, 0, 8, 8);
|
touchPoint.area = QRect(0, 0, 8, 8);
|
||||||
touchPoint.area.moveCenter(QPointF(cX,cY)); // simulate area
|
|
||||||
|
|
||||||
touchPoint.id = touches->identifier;
|
touchPoint.id = touches->identifier;
|
||||||
touchPoint.normalPosition = QPointF(cX / window2->width(), cY / window2->height());
|
touchPoint.pressure = 1.0;
|
||||||
|
|
||||||
|
const QPointF screenPos(point);
|
||||||
|
|
||||||
|
touchPoint.area.moveCenter(screenPos);
|
||||||
|
|
||||||
|
const auto tp = pressedTouchIds.constFind(touchPoint.id);
|
||||||
|
if (tp != pressedTouchIds.constEnd())
|
||||||
|
touchPoint.normalPosition = tp.value();
|
||||||
|
|
||||||
|
QPointF normalPosition(screenPos.x() / window2->width(),
|
||||||
|
screenPos.y() / window2->height());
|
||||||
|
|
||||||
|
const bool stationaryTouchPoint = (normalPosition == touchPoint.normalPosition);
|
||||||
|
touchPoint.normalPosition = normalPosition;
|
||||||
|
|
||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case EMSCRIPTEN_EVENT_TOUCHSTART:
|
case EMSCRIPTEN_EVENT_TOUCHSTART:
|
||||||
touchPoint.state = Qt::TouchPointPressed;
|
if (tp != pressedTouchIds.constEnd()) {
|
||||||
|
touchPoint.state = (stationaryTouchPoint
|
||||||
|
? Qt::TouchPointStationary
|
||||||
|
: Qt::TouchPointMoved);
|
||||||
|
} else {
|
||||||
|
touchPoint.state = Qt::TouchPointPressed;
|
||||||
|
}
|
||||||
|
pressedTouchIds.insert(touchPoint.id, touchPoint.normalPosition);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case EMSCRIPTEN_EVENT_TOUCHEND:
|
case EMSCRIPTEN_EVENT_TOUCHEND:
|
||||||
touchPoint.state = Qt::TouchPointReleased;
|
touchPoint.state = Qt::TouchPointReleased;
|
||||||
|
pressedTouchIds.remove(touchPoint.id);
|
||||||
break;
|
break;
|
||||||
case EMSCRIPTEN_EVENT_TOUCHMOVE:
|
case EMSCRIPTEN_EVENT_TOUCHMOVE:
|
||||||
touchPoint.state = Qt::TouchPointMoved;
|
touchPoint.state = (stationaryTouchPoint
|
||||||
|
? Qt::TouchPointStationary
|
||||||
|
: Qt::TouchPointMoved);
|
||||||
|
|
||||||
|
pressedTouchIds.insert(touchPoint.id, touchPoint.normalPosition);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Q_UNREACHABLE();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
touchPointList.append(touchPoint);
|
touchPointList.append(touchPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWasmEventTranslator *wasmEventTranslator = (QWasmEventTranslator*)userData;
|
QFlags<Qt::KeyboardModifier> keyModifier = translatKeyModifier(touchEvent);
|
||||||
QFlags<Qt::KeyboardModifier> keyModifier = wasmEventTranslator->translatKeyModifier(touchEvent);
|
|
||||||
|
|
||||||
if (eventType != EMSCRIPTEN_EVENT_TOUCHCANCEL)
|
QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(
|
||||||
QWindowSystemInterface::handleTouchEvent
|
window2, getTimestamp(), touchDevice, touchPointList, keyModifier);
|
||||||
<QWindowSystemInterface::SynchronousDelivery>(window2, wasmEventTranslator->getTimestamp(),
|
|
||||||
wasmEventTranslator->touchDevice,
|
if (eventType == EMSCRIPTEN_EVENT_TOUCHCANCEL)
|
||||||
touchPointList, keyModifier);
|
QWindowSystemInterface::handleTouchCancelEvent(window2, getTimestamp(), touchDevice, keyModifier);
|
||||||
else
|
|
||||||
QWindowSystemInterface::handleTouchCancelEvent(window2, wasmEventTranslator->getTimestamp(),
|
|
||||||
wasmEventTranslator->touchDevice, keyModifier);
|
|
||||||
|
|
||||||
QWasmEventDispatcher::maintainTimers();
|
QWasmEventDispatcher::maintainTimers();
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 QWasmEventTranslator::getTimestamp()
|
quint64 QWasmEventTranslator::getTimestamp()
|
||||||
|
@ -61,6 +61,7 @@ public:
|
|||||||
|
|
||||||
void processEvents();
|
void processEvents();
|
||||||
void initEventHandlers();
|
void initEventHandlers();
|
||||||
|
int handleTouch(int eventType, const EmscriptenTouchEvent *touchEvent);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void getWindowAt(const QPoint &point, QWindow **window);
|
void getWindowAt(const QPoint &point, QWindow **window);
|
||||||
@ -114,6 +115,8 @@ private:
|
|||||||
{ Qt::Key_U, Qt::Key_Ucircumflex}
|
{ Qt::Key_U, Qt::Key_Ucircumflex}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QMap <int, QPointF> pressedTouchIds;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QWindow *draggedWindow;
|
QWindow *draggedWindow;
|
||||||
QWindow *pressedWindow;
|
QWindow *pressedWindow;
|
||||||
|
@ -291,4 +291,13 @@ QVariant QWindowsNativeInterface::gpu() const
|
|||||||
return GpuDescription::detect().toVariant();
|
return GpuDescription::detect().toVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariant QWindowsNativeInterface::gpuList() const
|
||||||
|
{
|
||||||
|
QVariantList result;
|
||||||
|
const auto gpus = GpuDescription::detectAll();
|
||||||
|
for (const auto &gpu : gpus)
|
||||||
|
result.append(gpu.toVariant());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -66,6 +66,7 @@ class QWindowsNativeInterface : public QPlatformNativeInterface
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(bool asyncExpose READ asyncExpose WRITE setAsyncExpose)
|
Q_PROPERTY(bool asyncExpose READ asyncExpose WRITE setAsyncExpose)
|
||||||
Q_PROPERTY(QVariant gpu READ gpu STORED false)
|
Q_PROPERTY(QVariant gpu READ gpu STORED false)
|
||||||
|
Q_PROPERTY(QVariant gpuList READ gpuList STORED false)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void *nativeResourceForIntegration(const QByteArray &resource) override;
|
void *nativeResourceForIntegration(const QByteArray &resource) override;
|
||||||
@ -91,6 +92,7 @@ public:
|
|||||||
void setAsyncExpose(bool value);
|
void setAsyncExpose(bool value);
|
||||||
|
|
||||||
QVariant gpu() const;
|
QVariant gpu() const;
|
||||||
|
QVariant gpuList() const;
|
||||||
|
|
||||||
QVariantMap windowProperties(QPlatformWindow *window) const override;
|
QVariantMap windowProperties(QPlatformWindow *window) const override;
|
||||||
QVariant windowProperty(QPlatformWindow *window, const QString &name) const override;
|
QVariant windowProperty(QPlatformWindow *window, const QString &name) const override;
|
||||||
|
@ -62,19 +62,70 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
static const DWORD VENDOR_ID_AMD = 0x1002;
|
static const DWORD VENDOR_ID_AMD = 0x1002;
|
||||||
|
|
||||||
|
static GpuDescription adapterIdentifierToGpuDescription(const D3DADAPTER_IDENTIFIER9 &adapterIdentifier)
|
||||||
|
{
|
||||||
|
GpuDescription result;
|
||||||
|
result.vendorId = adapterIdentifier.VendorId;
|
||||||
|
result.deviceId = adapterIdentifier.DeviceId;
|
||||||
|
result.revision = adapterIdentifier.Revision;
|
||||||
|
result.subSysId = adapterIdentifier.SubSysId;
|
||||||
|
QVector<int> version(4, 0);
|
||||||
|
version[0] = HIWORD(adapterIdentifier.DriverVersion.HighPart); // Product
|
||||||
|
version[1] = LOWORD(adapterIdentifier.DriverVersion.HighPart); // Version
|
||||||
|
version[2] = HIWORD(adapterIdentifier.DriverVersion.LowPart); // Sub version
|
||||||
|
version[3] = LOWORD(adapterIdentifier.DriverVersion.LowPart); // build
|
||||||
|
result.driverVersion = QVersionNumber(version);
|
||||||
|
result.driverName = adapterIdentifier.Driver;
|
||||||
|
result.description = adapterIdentifier.Description;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
class QDirect3D9Handle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Q_DISABLE_COPY(QDirect3D9Handle)
|
||||||
|
|
||||||
|
QDirect3D9Handle();
|
||||||
|
~QDirect3D9Handle();
|
||||||
|
|
||||||
|
bool isValid() const { return m_direct3D9 != nullptr; }
|
||||||
|
|
||||||
|
UINT adapterCount() const { return m_direct3D9 ? m_direct3D9->GetAdapterCount() : 0u; }
|
||||||
|
bool retrieveAdapterIdentifier(UINT n, D3DADAPTER_IDENTIFIER9 *adapterIdentifier) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QSystemLibrary m_d3d9lib;
|
||||||
|
IDirect3D9 *m_direct3D9 = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
QDirect3D9Handle::QDirect3D9Handle() :
|
||||||
|
m_d3d9lib(QStringLiteral("d3d9"))
|
||||||
|
{
|
||||||
|
using PtrDirect3DCreate9 = IDirect3D9 *(WINAPI *)(UINT);
|
||||||
|
|
||||||
|
if (m_d3d9lib.load()) {
|
||||||
|
if (auto direct3DCreate9 = (PtrDirect3DCreate9)m_d3d9lib.resolve("Direct3DCreate9"))
|
||||||
|
m_direct3D9 = direct3DCreate9(D3D_SDK_VERSION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QDirect3D9Handle::~QDirect3D9Handle()
|
||||||
|
{
|
||||||
|
if (m_direct3D9)
|
||||||
|
m_direct3D9->Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QDirect3D9Handle::retrieveAdapterIdentifier(UINT n, D3DADAPTER_IDENTIFIER9 *adapterIdentifier) const
|
||||||
|
{
|
||||||
|
return m_direct3D9
|
||||||
|
&& SUCCEEDED(m_direct3D9->GetAdapterIdentifier(n, 0, adapterIdentifier));
|
||||||
|
}
|
||||||
|
|
||||||
GpuDescription GpuDescription::detect()
|
GpuDescription GpuDescription::detect()
|
||||||
{
|
{
|
||||||
typedef IDirect3D9 * (WINAPI *PtrDirect3DCreate9)(UINT);
|
|
||||||
|
|
||||||
GpuDescription result;
|
GpuDescription result;
|
||||||
QSystemLibrary d3d9lib(QStringLiteral("d3d9"));
|
QDirect3D9Handle direct3D9;
|
||||||
if (!d3d9lib.load())
|
if (!direct3D9.isValid())
|
||||||
return result;
|
|
||||||
PtrDirect3DCreate9 direct3DCreate9 = (PtrDirect3DCreate9)d3d9lib.resolve("Direct3DCreate9");
|
|
||||||
if (!direct3DCreate9)
|
|
||||||
return result;
|
|
||||||
IDirect3D9 *direct3D9 = direct3DCreate9(D3D_SDK_VERSION);
|
|
||||||
if (!direct3D9)
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
D3DADAPTER_IDENTIFIER9 adapterIdentifier;
|
D3DADAPTER_IDENTIFIER9 adapterIdentifier;
|
||||||
@ -85,20 +136,8 @@ GpuDescription GpuDescription::detect()
|
|||||||
// and D3D uses by default. Therefore querying any additional adapters is
|
// and D3D uses by default. Therefore querying any additional adapters is
|
||||||
// futile and not useful for our purposes in general, except for
|
// futile and not useful for our purposes in general, except for
|
||||||
// identifying a few special cases later on.
|
// identifying a few special cases later on.
|
||||||
HRESULT hr = direct3D9->GetAdapterIdentifier(0, 0, &adapterIdentifier);
|
if (direct3D9.retrieveAdapterIdentifier(0, &adapterIdentifier)) {
|
||||||
if (SUCCEEDED(hr)) {
|
result = adapterIdentifierToGpuDescription(adapterIdentifier);
|
||||||
result.vendorId = adapterIdentifier.VendorId;
|
|
||||||
result.deviceId = adapterIdentifier.DeviceId;
|
|
||||||
result.revision = adapterIdentifier.Revision;
|
|
||||||
result.subSysId = adapterIdentifier.SubSysId;
|
|
||||||
QVector<int> version(4, 0);
|
|
||||||
version[0] = HIWORD(adapterIdentifier.DriverVersion.HighPart); // Product
|
|
||||||
version[1] = LOWORD(adapterIdentifier.DriverVersion.HighPart); // Version
|
|
||||||
version[2] = HIWORD(adapterIdentifier.DriverVersion.LowPart); // Sub version
|
|
||||||
version[3] = LOWORD(adapterIdentifier.DriverVersion.LowPart); // build
|
|
||||||
result.driverVersion = QVersionNumber(version);
|
|
||||||
result.driverName = adapterIdentifier.Driver;
|
|
||||||
result.description = adapterIdentifier.Description;
|
|
||||||
isAMD = result.vendorId == VENDOR_ID_AMD;
|
isAMD = result.vendorId == VENDOR_ID_AMD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,30 +145,41 @@ GpuDescription GpuDescription::detect()
|
|||||||
// when starting apps on a screen connected to the Intel card) by looking
|
// when starting apps on a screen connected to the Intel card) by looking
|
||||||
// for a default AMD adapter and an additional non-AMD one.
|
// for a default AMD adapter and an additional non-AMD one.
|
||||||
if (isAMD) {
|
if (isAMD) {
|
||||||
const UINT adapterCount = direct3D9->GetAdapterCount();
|
const UINT adapterCount = direct3D9.adapterCount();
|
||||||
for (UINT adp = 1; adp < adapterCount; ++adp) {
|
for (UINT adp = 1; adp < adapterCount; ++adp) {
|
||||||
hr = direct3D9->GetAdapterIdentifier(adp, 0, &adapterIdentifier);
|
if (direct3D9.retrieveAdapterIdentifier(adp, &adapterIdentifier)
|
||||||
if (SUCCEEDED(hr)) {
|
&& adapterIdentifier.VendorId != VENDOR_ID_AMD) {
|
||||||
if (adapterIdentifier.VendorId != VENDOR_ID_AMD) {
|
// Bingo. Now figure out the display for the AMD card.
|
||||||
// Bingo. Now figure out the display for the AMD card.
|
DISPLAY_DEVICE dd;
|
||||||
DISPLAY_DEVICE dd;
|
memset(&dd, 0, sizeof(dd));
|
||||||
memset(&dd, 0, sizeof(dd));
|
dd.cb = sizeof(dd);
|
||||||
dd.cb = sizeof(dd);
|
for (int dev = 0; EnumDisplayDevices(nullptr, dev, &dd, 0); ++dev) {
|
||||||
for (int dev = 0; EnumDisplayDevices(nullptr, dev, &dd, 0); ++dev) {
|
if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
|
||||||
if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) {
|
// DeviceName is something like \\.\DISPLAY1 which can be used to
|
||||||
// DeviceName is something like \\.\DISPLAY1 which can be used to
|
// match with the MONITORINFOEX::szDevice queried by QWindowsScreen.
|
||||||
// match with the MONITORINFOEX::szDevice queried by QWindowsScreen.
|
result.gpuSuitableScreen = QString::fromWCharArray(dd.DeviceName);
|
||||||
result.gpuSuitableScreen = QString::fromWCharArray(dd.DeviceName);
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
direct3D9->Release();
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVector<GpuDescription> GpuDescription::detectAll()
|
||||||
|
{
|
||||||
|
QVector<GpuDescription> result;
|
||||||
|
QDirect3D9Handle direct3D9;
|
||||||
|
if (const UINT adapterCount = direct3D9.adapterCount()) {
|
||||||
|
for (UINT adp = 0; adp < adapterCount; ++adp) {
|
||||||
|
D3DADAPTER_IDENTIFIER9 adapterIdentifier;
|
||||||
|
if (direct3D9.retrieveAdapterIdentifier(adp, &adapterIdentifier))
|
||||||
|
result.append(adapterIdentifierToGpuDescription(adapterIdentifier));
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include <QtCore/qbytearray.h>
|
#include <QtCore/qbytearray.h>
|
||||||
#include <QtCore/qflags.h>
|
#include <QtCore/qflags.h>
|
||||||
|
#include <QtCore/qvector.h>
|
||||||
#include <QtCore/qversionnumber.h>
|
#include <QtCore/qversionnumber.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -52,6 +53,7 @@ class QVariant;
|
|||||||
struct GpuDescription
|
struct GpuDescription
|
||||||
{
|
{
|
||||||
static GpuDescription detect();
|
static GpuDescription detect();
|
||||||
|
static QVector<GpuDescription> detectAll();
|
||||||
QString toString() const;
|
QString toString() const;
|
||||||
QVariant toVariant() const;
|
QVariant toVariant() const;
|
||||||
|
|
||||||
|
@ -746,7 +746,8 @@ QWindowsWindowData
|
|||||||
const QWindowCreationContextPtr context(new QWindowCreationContext(w, data.geometry, rect, data.customMargins, style, exStyle));
|
const QWindowCreationContextPtr context(new QWindowCreationContext(w, data.geometry, rect, data.customMargins, style, exStyle));
|
||||||
QWindowsContext::instance()->setWindowCreationContext(context);
|
QWindowsContext::instance()->setWindowCreationContext(context);
|
||||||
|
|
||||||
QMargins invMargins = topLevel && !(result.flags & Qt::FramelessWindowHint) && QWindowsGeometryHint::positionIncludesFrame(w)
|
const bool hasFrame = (style & (WS_DLGFRAME | WS_THICKFRAME));
|
||||||
|
QMargins invMargins = topLevel && hasFrame && QWindowsGeometryHint::positionIncludesFrame(w)
|
||||||
? invisibleMargins(QPoint(context->frameX, context->frameY)) : QMargins();
|
? invisibleMargins(QPoint(context->frameX, context->frameY)) : QMargins();
|
||||||
|
|
||||||
qCDebug(lcQpaWindows).nospace()
|
qCDebug(lcQpaWindows).nospace()
|
||||||
@ -777,6 +778,7 @@ QWindowsWindowData
|
|||||||
result.geometry = context->obtainedGeometry;
|
result.geometry = context->obtainedGeometry;
|
||||||
result.fullFrameMargins = context->margins;
|
result.fullFrameMargins = context->margins;
|
||||||
result.embedded = embedded;
|
result.embedded = embedded;
|
||||||
|
result.hasFrame = hasFrame;
|
||||||
result.customMargins = context->customMargins;
|
result.customMargins = context->customMargins;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -2233,7 +2235,7 @@ void QWindowsWindow::setFullFrameMargins(const QMargins &newMargins)
|
|||||||
QMargins QWindowsWindow::frameMargins() const
|
QMargins QWindowsWindow::frameMargins() const
|
||||||
{
|
{
|
||||||
QMargins result = fullFrameMargins();
|
QMargins result = fullFrameMargins();
|
||||||
if (isTopLevel() && !(m_data.flags & Qt::FramelessWindowHint))
|
if (isTopLevel() && m_data.hasFrame)
|
||||||
result -= invisibleMargins(geometry().topLeft());
|
result -= invisibleMargins(geometry().topLeft());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,7 @@ struct QWindowsWindowData
|
|||||||
QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
|
QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
|
||||||
HWND hwnd = 0;
|
HWND hwnd = 0;
|
||||||
bool embedded = false;
|
bool embedded = false;
|
||||||
|
bool hasFrame = false;
|
||||||
|
|
||||||
static QWindowsWindowData create(const QWindow *w,
|
static QWindowsWindowData create(const QWindow *w,
|
||||||
const QWindowsWindowData ¶meters,
|
const QWindowsWindowData ¶meters,
|
||||||
|
@ -185,10 +185,10 @@ public:
|
|||||||
QXcbWindow *platformWindowFromId(xcb_window_t id);
|
QXcbWindow *platformWindowFromId(xcb_window_t id);
|
||||||
|
|
||||||
inline xcb_timestamp_t time() const { return m_time; }
|
inline xcb_timestamp_t time() const { return m_time; }
|
||||||
inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; }
|
inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; }
|
||||||
|
|
||||||
inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; }
|
inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; }
|
||||||
inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; }
|
inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; }
|
||||||
|
|
||||||
xcb_timestamp_t getTimestamp();
|
xcb_timestamp_t getTimestamp();
|
||||||
xcb_window_t getSelectionOwner(xcb_atom_t atom) const;
|
xcb_window_t getSelectionOwner(xcb_atom_t atom) const;
|
||||||
@ -264,6 +264,8 @@ private:
|
|||||||
void destroyScreen(QXcbScreen *screen);
|
void destroyScreen(QXcbScreen *screen);
|
||||||
void initializeScreens();
|
void initializeScreens();
|
||||||
bool compressEvent(xcb_generic_event_t *event) const;
|
bool compressEvent(xcb_generic_event_t *event) const;
|
||||||
|
inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const
|
||||||
|
{ return static_cast<int32_t>(a - b) > 0 || b == XCB_CURRENT_TIME; }
|
||||||
|
|
||||||
#if QT_CONFIG(xcb_xinput)
|
#if QT_CONFIG(xcb_xinput)
|
||||||
void xi2SetupDevice(void *info, bool removeExisting = true);
|
void xi2SetupDevice(void *info, bool removeExisting = true);
|
||||||
|
@ -1722,7 +1722,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
|
|||||||
|
|
||||||
QStringList importPaths;
|
QStringList importPaths;
|
||||||
importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml"));
|
importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml"));
|
||||||
importPaths += rootPath;
|
importPaths += shellQuote(rootPath);
|
||||||
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths))
|
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths))
|
||||||
importPaths += shellQuote(qmlImportPath);
|
importPaths += shellQuote(qmlImportPath);
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ qint32 main(qint32 argc, char **argv)
|
|||||||
fid.write("#include <QtCore/qfloat16.h>\n\n");
|
fid.write("#include <QtCore/qfloat16.h>\n\n");
|
||||||
|
|
||||||
fid.write("QT_BEGIN_NAMESPACE\n\n");
|
fid.write("QT_BEGIN_NAMESPACE\n\n");
|
||||||
|
fid.write("#if !defined(__F16C__) && !defined(__ARM_FP16_FORMAT_IEEE)\n\n");
|
||||||
|
|
||||||
fid.write("const quint32 qfloat16::mantissatable[2048] = {\n");
|
fid.write("const quint32 qfloat16::mantissatable[2048] = {\n");
|
||||||
fid.write("0,\n");
|
fid.write("0,\n");
|
||||||
@ -155,6 +156,7 @@ qint32 main(qint32 argc, char **argv)
|
|||||||
|
|
||||||
fid.write("};\n\n");
|
fid.write("};\n\n");
|
||||||
|
|
||||||
|
fid.write("#endif // !__F16C__ && !__ARM_FP16_FORMAT_IEEE\n\n");
|
||||||
fid.write("QT_END_NAMESPACE\n");
|
fid.write("QT_END_NAMESPACE\n");
|
||||||
fid.close();
|
fid.close();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -752,9 +752,9 @@ void WriteInitialization::acceptWidget(DomWidget *node)
|
|||||||
static const QLatin1String realPropertyNames[] = {
|
static const QLatin1String realPropertyNames[] = {
|
||||||
QLatin1String("visible"),
|
QLatin1String("visible"),
|
||||||
QLatin1String("cascadingSectionResizes"),
|
QLatin1String("cascadingSectionResizes"),
|
||||||
|
QLatin1String("minimumSectionSize"), // before defaultSectionSize
|
||||||
QLatin1String("defaultSectionSize"),
|
QLatin1String("defaultSectionSize"),
|
||||||
QLatin1String("highlightSections"),
|
QLatin1String("highlightSections"),
|
||||||
QLatin1String("minimumSectionSize"),
|
|
||||||
QLatin1String("showSortIndicator"),
|
QLatin1String("showSortIndicator"),
|
||||||
QLatin1String("stretchLastSection"),
|
QLatin1String("stretchLastSection"),
|
||||||
};
|
};
|
||||||
|
@ -3324,6 +3324,9 @@ void QGraphicsScene::advance()
|
|||||||
\l{QWidget::}{enterEvent()} and \l{QWidget::}{leaveEvent()}. Use this
|
\l{QWidget::}{enterEvent()} and \l{QWidget::}{leaveEvent()}. Use this
|
||||||
function to obtain those events instead.
|
function to obtain those events instead.
|
||||||
|
|
||||||
|
Returns \c true if \a event has been recognized and processed; otherwise,
|
||||||
|
returns \c false.
|
||||||
|
|
||||||
\sa contextMenuEvent(), keyPressEvent(), keyReleaseEvent(),
|
\sa contextMenuEvent(), keyPressEvent(), keyReleaseEvent(),
|
||||||
mousePressEvent(), mouseMoveEvent(), mouseReleaseEvent(),
|
mousePressEvent(), mouseMoveEvent(), mouseReleaseEvent(),
|
||||||
mouseDoubleClickEvent(), focusInEvent(), focusOutEvent()
|
mouseDoubleClickEvent(), focusInEvent(), focusOutEvent()
|
||||||
|
@ -1232,6 +1232,9 @@ QVariant QGraphicsWidget::propertyChange(const QString &propertyName, const QVar
|
|||||||
event() or in any of the convenience functions; you should not have to
|
event() or in any of the convenience functions; you should not have to
|
||||||
reimplement this function in a subclass of QGraphicsWidget.
|
reimplement this function in a subclass of QGraphicsWidget.
|
||||||
|
|
||||||
|
Returns \c true if \a event has been recognized and processed; otherwise,
|
||||||
|
returns \c false.
|
||||||
|
|
||||||
\sa QGraphicsItem::sceneEvent()
|
\sa QGraphicsItem::sceneEvent()
|
||||||
*/
|
*/
|
||||||
bool QGraphicsWidget::sceneEvent(QEvent *event)
|
bool QGraphicsWidget::sceneEvent(QEvent *event)
|
||||||
|
@ -1689,6 +1689,9 @@ bool QAbstractItemView::event(QEvent *event)
|
|||||||
This? mode, if the given \a event is a QEvent::ToolTip,or a
|
This? mode, if the given \a event is a QEvent::ToolTip,or a
|
||||||
QEvent::WhatsThis. It passes all other
|
QEvent::WhatsThis. It passes all other
|
||||||
events on to its base class viewportEvent() handler.
|
events on to its base class viewportEvent() handler.
|
||||||
|
|
||||||
|
Returns \c true if \a event has been recognized and processed; otherwise,
|
||||||
|
returns \c false.
|
||||||
*/
|
*/
|
||||||
bool QAbstractItemView::viewportEvent(QEvent *event)
|
bool QAbstractItemView::viewportEvent(QEvent *event)
|
||||||
{
|
{
|
||||||
|
@ -244,6 +244,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
|
|||||||
case QVariant::Bool: {
|
case QVariant::Bool: {
|
||||||
QBooleanComboBox *cb = new QBooleanComboBox(parent);
|
QBooleanComboBox *cb = new QBooleanComboBox(parent);
|
||||||
cb->setFrame(false);
|
cb->setFrame(false);
|
||||||
|
cb->setSizePolicy(QSizePolicy::Ignored, cb->sizePolicy().verticalPolicy());
|
||||||
return cb; }
|
return cb; }
|
||||||
#endif
|
#endif
|
||||||
#if QT_CONFIG(spinbox)
|
#if QT_CONFIG(spinbox)
|
||||||
@ -252,12 +253,14 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
|
|||||||
sb->setFrame(false);
|
sb->setFrame(false);
|
||||||
sb->setMinimum(0);
|
sb->setMinimum(0);
|
||||||
sb->setMaximum(INT_MAX);
|
sb->setMaximum(INT_MAX);
|
||||||
|
sb->setSizePolicy(QSizePolicy::Ignored, sb->sizePolicy().verticalPolicy());
|
||||||
return sb; }
|
return sb; }
|
||||||
case QVariant::Int: {
|
case QVariant::Int: {
|
||||||
QSpinBox *sb = new QSpinBox(parent);
|
QSpinBox *sb = new QSpinBox(parent);
|
||||||
sb->setFrame(false);
|
sb->setFrame(false);
|
||||||
sb->setMinimum(INT_MIN);
|
sb->setMinimum(INT_MIN);
|
||||||
sb->setMaximum(INT_MAX);
|
sb->setMaximum(INT_MAX);
|
||||||
|
sb->setSizePolicy(QSizePolicy::Ignored, sb->sizePolicy().verticalPolicy());
|
||||||
return sb; }
|
return sb; }
|
||||||
#endif
|
#endif
|
||||||
#if QT_CONFIG(datetimeedit)
|
#if QT_CONFIG(datetimeedit)
|
||||||
@ -284,6 +287,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
|
|||||||
sb->setFrame(false);
|
sb->setFrame(false);
|
||||||
sb->setMinimum(-DBL_MAX);
|
sb->setMinimum(-DBL_MAX);
|
||||||
sb->setMaximum(DBL_MAX);
|
sb->setMaximum(DBL_MAX);
|
||||||
|
sb->setSizePolicy(QSizePolicy::Ignored, sb->sizePolicy().verticalPolicy());
|
||||||
return sb; }
|
return sb; }
|
||||||
#endif
|
#endif
|
||||||
#if QT_CONFIG(lineedit)
|
#if QT_CONFIG(lineedit)
|
||||||
|
@ -2930,7 +2930,7 @@ bool QPlainTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool QTextEdit::find(const QRegularExpression &exp, QTextDocument::FindFlags options)
|
\fn bool QPlainTextEdit::find(const QRegularExpression &exp, QTextDocument::FindFlags options)
|
||||||
|
|
||||||
\since 5.13
|
\since 5.13
|
||||||
\overload
|
\overload
|
||||||
|
@ -1078,7 +1078,11 @@ bool QToolBarAreaLayout::insertGap(const QList<int> &path, QLayoutItem *item)
|
|||||||
void QToolBarAreaLayout::remove(const QList<int> &path)
|
void QToolBarAreaLayout::remove(const QList<int> &path)
|
||||||
{
|
{
|
||||||
Q_ASSERT(path.count() == 3);
|
Q_ASSERT(path.count() == 3);
|
||||||
docks[path.at(0)].lines[path.at(1)].toolBarItems.removeAt(path.at(2));
|
QToolBarAreaLayoutInfo &dock = docks[path.at(0)];
|
||||||
|
QToolBarAreaLayoutLine &line = dock.lines[path.at(1)];
|
||||||
|
line.toolBarItems.removeAt(path.at(2));
|
||||||
|
if (line.toolBarItems.isEmpty())
|
||||||
|
dock.lines.removeAt(path.at(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QToolBarAreaLayout::remove(QLayoutItem *item)
|
void QToolBarAreaLayout::remove(QLayoutItem *item)
|
||||||
|
@ -53,6 +53,7 @@ void tst_QNoDebug::noDebugOutput() const
|
|||||||
// should do nothing
|
// should do nothing
|
||||||
qDebug() << "foo";
|
qDebug() << "foo";
|
||||||
qCDebug(cat) << "foo";
|
qCDebug(cat) << "foo";
|
||||||
|
qCDebug(cat, "foo");
|
||||||
|
|
||||||
// qWarning still works, though
|
// qWarning still works, though
|
||||||
QTest::ignoreMessage(QtWarningMsg, "bar");
|
QTest::ignoreMessage(QtWarningMsg, "bar");
|
||||||
|
111
tests/manual/widgets/widgets/qmainwindow/saveStateSize/main.cpp
Normal file
111
tests/manual/widgets/widgets/qmainwindow/saveStateSize/main.cpp
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2019 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
// Test that the size of the saved state bytearray does not change due to moving a
|
||||||
|
// toolbar from one area to another. It should stay the same size as the first time
|
||||||
|
// it had that toolbar in it
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
class MainWindow : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MainWindow() : QMainWindow()
|
||||||
|
{
|
||||||
|
auto *tb = new QToolBar(this);
|
||||||
|
tb->setObjectName("Toolbar");
|
||||||
|
tb->addAction("Test action");
|
||||||
|
tb->addAction("Test action");
|
||||||
|
addToolBar(Qt::TopToolBarArea, tb);
|
||||||
|
auto *movableTb = new QToolBar(this);
|
||||||
|
movableTb->setObjectName("Movable Toolbar");
|
||||||
|
movableTb->addAction("Test action");
|
||||||
|
movableTb->addAction("Test action");
|
||||||
|
addToolBar(Qt::TopToolBarArea, movableTb);
|
||||||
|
auto *widget = new QWidget;
|
||||||
|
auto *vbox = new QVBoxLayout;
|
||||||
|
auto *label = new QLabel;
|
||||||
|
label->setText("1. Click on check state size to save initial state\n"
|
||||||
|
"2. Drag the movable toolbar in the top dock area to the left area."
|
||||||
|
" Click on check state size to save moved state\n"
|
||||||
|
"3. Drag the movable toolbar from the left dock area to the top area."
|
||||||
|
" Click on check state size to compare the state sizes.\n"
|
||||||
|
"4. Drag the movable toolbar in the top dock area to the left area."
|
||||||
|
" Click on check state size to compare the state sizes.\n"
|
||||||
|
"5. Drag the movable toolbar from the left dock area to the top area."
|
||||||
|
" Click on check state size to compare the state sizes.\n");
|
||||||
|
vbox->addWidget(label);
|
||||||
|
auto *pushButton = new QPushButton("Check state size");
|
||||||
|
connect(pushButton, &QPushButton::clicked, this, &MainWindow::checkState);
|
||||||
|
vbox->addWidget(pushButton);
|
||||||
|
widget->setLayout(vbox);
|
||||||
|
setCentralWidget(widget);
|
||||||
|
}
|
||||||
|
public slots:
|
||||||
|
void checkState()
|
||||||
|
{
|
||||||
|
stepCounter++;
|
||||||
|
QString messageText;
|
||||||
|
if (stepCounter == 1) {
|
||||||
|
beforeMoveStateData = saveState();
|
||||||
|
messageText = QLatin1String("Initial state saved");
|
||||||
|
} else if (stepCounter == 2) {
|
||||||
|
afterMoveStateData = saveState();
|
||||||
|
messageText = QLatin1String("Moved state saved");
|
||||||
|
} else {
|
||||||
|
const int currentSaveSize = saveState().size();
|
||||||
|
const int compareValue = (stepCounter == 4) ? afterMoveStateData.size() : beforeMoveStateData.size();
|
||||||
|
messageText = QString::fromLatin1("%1 step %2")
|
||||||
|
.arg((currentSaveSize == compareValue) ? QLatin1String("SUCCESS") : QLatin1String("FAIL"))
|
||||||
|
.arg(stepCounter);
|
||||||
|
}
|
||||||
|
QMessageBox::information(this, "Step done", messageText);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
int stepCounter = 0;
|
||||||
|
QByteArray beforeMoveStateData;
|
||||||
|
QByteArray afterMoveStateData;
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "main.moc"
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
MainWindow mw;
|
||||||
|
mw.show();
|
||||||
|
return a.exec();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
QT += widgets
|
||||||
|
TEMPLATE = app
|
||||||
|
TARGET = saveStateSize
|
||||||
|
SOURCES += main.cpp
|
Loading…
x
Reference in New Issue
Block a user