Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I2bf3b4ceb79364330eae4cbf3cdee9a82d1be46d
This commit is contained in:
commit
e608b5d555
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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"),
|
||||||
};
|
};
|
||||||
|
@ -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)
|
||||||
|
@ -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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user