Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: src/corelib/codecs/qicucodec.cpp src/dbus/qdbusserver.cpp src/gui/painting/qbezier.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/printsupport/cups/qppdprintdevice.cpp Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
This commit is contained in:
commit
6a36fe904c
@ -281,6 +281,7 @@ Gui, printing, widget options:
|
|||||||
es2 (default on Windows), desktop (default on Unix),
|
es2 (default on Windows), desktop (default on Unix),
|
||||||
dynamic (Windows only)
|
dynamic (Windows only)
|
||||||
-opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
|
-opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
|
||||||
|
-egl ................. Enable EGL support [auto]
|
||||||
-angle ............... Use bundled ANGLE to support OpenGL ES 2.0 [auto]
|
-angle ............... Use bundled ANGLE to support OpenGL ES 2.0 [auto]
|
||||||
(Windows only)
|
(Windows only)
|
||||||
-combined-angle-lib .. Merge LibEGL and LibGLESv2 into LibANGLE (Windows only)
|
-combined-angle-lib .. Merge LibEGL and LibGLESv2 into LibANGLE (Windows only)
|
||||||
|
@ -843,9 +843,6 @@ defineTest(qtConfOutput_preparePaths) {
|
|||||||
addConfStr($$[QMAKE_SPEC])
|
addConfStr($$[QMAKE_SPEC])
|
||||||
|
|
||||||
$${currentConfig}.output.qconfigSource = \
|
$${currentConfig}.output.qconfigSource = \
|
||||||
"/* Installation date */" \
|
|
||||||
"static const char qt_configure_installation [12+11] = \"qt_instdate=2012-12-20\";" \
|
|
||||||
"" \
|
|
||||||
"/* Installation Info */" \
|
"/* Installation Info */" \
|
||||||
"static const char qt_configure_prefix_path_str [12+256] = \"qt_prfxpath=$$config.input.prefix\";" \
|
"static const char qt_configure_prefix_path_str [12+256] = \"qt_prfxpath=$$config.input.prefix\";" \
|
||||||
"$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \
|
"$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \
|
||||||
|
@ -270,7 +270,7 @@ xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identif
|
|||||||
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
|
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
|
||||||
|
|
||||||
!macx-xcode {
|
!macx-xcode {
|
||||||
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_) $$QMAKE_ARGS
|
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
|
||||||
generate_xcode_project.target = xcodeproj
|
generate_xcode_project.target = xcodeproj
|
||||||
QMAKE_EXTRA_VARIABLES += _PRO_FILE_
|
QMAKE_EXTRA_VARIABLES += _PRO_FILE_
|
||||||
QMAKE_EXTRA_TARGETS += generate_xcode_project
|
QMAKE_EXTRA_TARGETS += generate_xcode_project
|
||||||
|
@ -1,2 +1,6 @@
|
|||||||
# bitcode (release mode) is incompatible with splitting sections.
|
# bitcode (release mode) is incompatible with splitting sections.
|
||||||
!bitcode|!release: load(gc_binaries)
|
# We have to explicitly exclude Xcode, as that supports both debug
|
||||||
|
# and release builds in the same project. Xcode already has a settting
|
||||||
|
# for dead code stripping which is enabled by default, so we'll still
|
||||||
|
# strip any libraries build with split sections.
|
||||||
|
!bitcode|if(!macx-xcode:!release): load(gc_binaries)
|
||||||
|
@ -6,16 +6,6 @@ exists($$QMAKE_QT_CONFIG) {
|
|||||||
qtConfig(thread) {
|
qtConfig(thread) {
|
||||||
|
|
||||||
EMCC_THREAD_LFLAGS += -s USE_PTHREADS=1
|
EMCC_THREAD_LFLAGS += -s USE_PTHREADS=1
|
||||||
# Hardcode wasm memory size. Emscripten does not currently support memory growth
|
|
||||||
# (ALLOW_MEMORY_GROWTH) in pthreads mode, and requires specifying the memory size
|
|
||||||
# at build time. Further, browsers limit the maximum initial memory size to 1GB.
|
|
||||||
TOTAL_MEMORY = 1GB
|
|
||||||
!isEmpty(QMAKE_WASM_TOTAL_MEMORY) {
|
|
||||||
TOTAL_MEMORY = $$QMAKE_WASM_TOTAL_MEMORY
|
|
||||||
}
|
|
||||||
|
|
||||||
message("Setting TOTAL_MEMORY to" $$TOTAL_MEMORY)
|
|
||||||
EMCC_THREAD_LFLAGS += -s TOTAL_MEMORY=$$TOTAL_MEMORY
|
|
||||||
|
|
||||||
# Create worker threads at startup. This is supposed to be an optimization,
|
# Create worker threads at startup. This is supposed to be an optimization,
|
||||||
# however exceeding the pool size has been obesverved to hang the application.
|
# however exceeding the pool size has been obesverved to hang the application.
|
||||||
@ -29,6 +19,20 @@ exists($$QMAKE_QT_CONFIG) {
|
|||||||
} else {
|
} else {
|
||||||
EMCC_THREAD_LFLAGS += -s ALLOW_MEMORY_GROWTH=1
|
EMCC_THREAD_LFLAGS += -s ALLOW_MEMORY_GROWTH=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qtConfig(thread) | !isEmpty(QMAKE_WASM_TOTAL_MEMORY) {
|
||||||
|
|
||||||
|
# Hardcode wasm memory size. Emscripten does not currently support memory growth
|
||||||
|
# (ALLOW_MEMORY_GROWTH) in pthreads mode, and requires specifying the memory size
|
||||||
|
# at build time. Further, browsers limit the maximum initial memory size to 1GB.
|
||||||
|
# QMAKE_WASM_TOTAL_MEMORY must be a multiple of 64KB
|
||||||
|
TOTAL_MEMORY = 1GB
|
||||||
|
!isEmpty(QMAKE_WASM_TOTAL_MEMORY) {
|
||||||
|
TOTAL_MEMORY = $$QMAKE_WASM_TOTAL_MEMORY
|
||||||
|
}
|
||||||
|
message("Setting TOTAL_MEMORY to" $$TOTAL_MEMORY)
|
||||||
|
EMCC_THREAD_LFLAGS += -s TOTAL_MEMORY=$$TOTAL_MEMORY
|
||||||
|
}
|
||||||
QMAKE_LFLAGS += $$EMCC_THREAD_LFLAGS
|
QMAKE_LFLAGS += $$EMCC_THREAD_LFLAGS
|
||||||
QMAKE_LFLAGS_DEBUG += $$EMCC_THREAD_LFLAGS
|
QMAKE_LFLAGS_DEBUG += $$EMCC_THREAD_LFLAGS
|
||||||
QMAKE_CFLAGS += $$EMCC_THREAD_LFLAGS
|
QMAKE_CFLAGS += $$EMCC_THREAD_LFLAGS
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QString project_builtin_regx() //calculate the builtin regular expression..
|
static QString project_builtin_regx() //calculate the builtin regular expression..
|
||||||
{
|
{
|
||||||
QString ret;
|
QString ret;
|
||||||
QStringList builtin_exts;
|
QStringList builtin_exts;
|
||||||
|
@ -1568,21 +1568,12 @@ bool VCLinkerTool::parseOption(const char* option)
|
|||||||
const char* str = option+6;
|
const char* str = option+6;
|
||||||
if (*str == 'S')
|
if (*str == 'S')
|
||||||
ShowProgress = linkProgressAll;
|
ShowProgress = linkProgressAll;
|
||||||
#ifndef Q_OS_WIN
|
else if (qstricmp(str, "pginstrument") == 0)
|
||||||
else if (strncasecmp(str, "pginstrument", 12))
|
|
||||||
LinkTimeCodeGeneration = optLTCGInstrument;
|
LinkTimeCodeGeneration = optLTCGInstrument;
|
||||||
else if (strncasecmp(str, "pgoptimize", 10))
|
else if (qstricmp(str, "pgoptimize") == 0)
|
||||||
LinkTimeCodeGeneration = optLTCGOptimize;
|
LinkTimeCodeGeneration = optLTCGOptimize;
|
||||||
else if (strncasecmp(str, "pgupdate", 8 ))
|
else if (qstricmp(str, "pgupdate") == 0)
|
||||||
LinkTimeCodeGeneration = optLTCGUpdate;
|
LinkTimeCodeGeneration = optLTCGUpdate;
|
||||||
#else
|
|
||||||
else if (_stricmp(str, "pginstrument"))
|
|
||||||
LinkTimeCodeGeneration = optLTCGInstrument;
|
|
||||||
else if (_stricmp(str, "pgoptimize"))
|
|
||||||
LinkTimeCodeGeneration = optLTCGOptimize;
|
|
||||||
else if (_stricmp(str, "pgupdate"))
|
|
||||||
LinkTimeCodeGeneration = optLTCGUpdate;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
AdditionalOptions.append(option);
|
AdditionalOptions.append(option);
|
||||||
|
@ -242,6 +242,39 @@ static int doLink(int argc, char **argv)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool setFilePermissions(QFile &file, QFileDevice::Permissions permissions)
|
||||||
|
{
|
||||||
|
if (file.setPermissions(permissions))
|
||||||
|
return true;
|
||||||
|
fprintf(stderr, "Error setting permissions on %s: %s\n",
|
||||||
|
qPrintable(file.fileName()), qPrintable(file.errorString()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool copyFileTimes(QFile &targetFile, const QString &sourceFilePath,
|
||||||
|
bool mustEnsureWritability, QString *errorString)
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
bool mustRestorePermissions = false;
|
||||||
|
QFileDevice::Permissions targetPermissions;
|
||||||
|
if (mustEnsureWritability) {
|
||||||
|
targetPermissions = targetFile.permissions();
|
||||||
|
if (!targetPermissions.testFlag(QFileDevice::WriteUser)) {
|
||||||
|
mustRestorePermissions = true;
|
||||||
|
if (!setFilePermissions(targetFile, targetPermissions | QFileDevice::WriteUser))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!IoUtils::touchFile(targetFile.fileName(), sourceFilePath, errorString))
|
||||||
|
return false;
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
if (mustRestorePermissions && !setFilePermissions(targetFile, targetPermissions))
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static int installFile(const QString &source, const QString &target, bool exe = false,
|
static int installFile(const QString &source, const QString &target, bool exe = false,
|
||||||
bool preservePermissions = false)
|
bool preservePermissions = false)
|
||||||
{
|
{
|
||||||
@ -270,18 +303,15 @@ static int installFile(const QString &source, const QString &target, bool exe =
|
|||||||
targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
|
targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
|
||||||
QFileDevice::ExeGroup | QFileDevice::ExeOther;
|
QFileDevice::ExeGroup | QFileDevice::ExeOther;
|
||||||
}
|
}
|
||||||
if (!targetFile.setPermissions(targetPermissions)) {
|
if (!setFilePermissions(targetFile, targetPermissions))
|
||||||
fprintf(stderr, "Error setting permissions on %s: %s\n",
|
|
||||||
qPrintable(target), qPrintable(targetFile.errorString()));
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
|
||||||
|
|
||||||
// Copy file times
|
|
||||||
QString error;
|
QString error;
|
||||||
if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
|
if (!copyFileTimes(targetFile, sourceFile.fileName(), preservePermissions, &error)) {
|
||||||
fprintf(stderr, "%s", qPrintable(error));
|
fprintf(stderr, "%s", qPrintable(error));
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,6 @@ static QString detectProjectFile(const QString &path)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString project_builtin_regx();
|
|
||||||
bool usage(const char *a0)
|
bool usage(const char *a0)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "Usage: %s [mode] [options] [files]\n"
|
fprintf(stdout, "Usage: %s [mode] [options] [files]\n"
|
||||||
@ -133,9 +132,9 @@ bool usage(const char *a0)
|
|||||||
"\n"
|
"\n"
|
||||||
"Mode:\n"
|
"Mode:\n"
|
||||||
" -project Put qmake into project file generation mode%s\n"
|
" -project Put qmake into project file generation mode%s\n"
|
||||||
" In this mode qmake interprets files as files to\n"
|
" In this mode qmake interprets [files] as files to\n"
|
||||||
" be built,\n"
|
" be added to the .pro file. By default, all files with\n"
|
||||||
" defaults to %s\n"
|
" known source extensions are added.\n"
|
||||||
" Note: The created .pro file probably will \n"
|
" Note: The created .pro file probably will \n"
|
||||||
" need to be edited. For example add the QT variable to \n"
|
" need to be edited. For example add the QT variable to \n"
|
||||||
" specify what modules are required.\n"
|
" specify what modules are required.\n"
|
||||||
@ -183,7 +182,7 @@ bool usage(const char *a0)
|
|||||||
" -nomoc Don't generate moc targets [makefile mode only]\n"
|
" -nomoc Don't generate moc targets [makefile mode only]\n"
|
||||||
" -nopwd Don't look for files in pwd [project mode only]\n"
|
" -nopwd Don't look for files in pwd [project mode only]\n"
|
||||||
,a0,
|
,a0,
|
||||||
default_mode(a0) == Option::QMAKE_GENERATE_PROJECT ? " (default)" : "", project_builtin_regx().toLatin1().constData(),
|
default_mode(a0) == Option::QMAKE_GENERATE_PROJECT ? " (default)" : "",
|
||||||
default_mode(a0) == Option::QMAKE_GENERATE_MAKEFILE ? " (default)" : ""
|
default_mode(a0) == Option::QMAKE_GENERATE_MAKEFILE ? " (default)" : ""
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
|
@ -42,16 +42,17 @@
|
|||||||
#include "qtextcodec_p.h"
|
#include "qtextcodec_p.h"
|
||||||
#include "qutfcodec_p.h"
|
#include "qutfcodec_p.h"
|
||||||
#include "qlatincodec_p.h"
|
#include "qlatincodec_p.h"
|
||||||
#if QT_CONFIG(codecs)
|
|
||||||
#include "qtsciicodec_p.h"
|
|
||||||
#include "qisciicodec_p.h"
|
|
||||||
#endif
|
|
||||||
#include "qsimplecodec_p.h"
|
#include "qsimplecodec_p.h"
|
||||||
#include "private/qcoreglobaldata_p.h"
|
#include "private/qcoreglobaldata_p.h"
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
|
|
||||||
#include "unicode/ucnv.h"
|
#include "unicode/ucnv.h"
|
||||||
|
|
||||||
|
#if QT_CONFIG(codecs)
|
||||||
|
#include "qtsciicodec_p.h"
|
||||||
|
#include "qisciicodec_p.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
typedef QList<QTextCodec*>::ConstIterator TextCodecListConstIt;
|
typedef QList<QTextCodec*>::ConstIterator TextCodecListConstIt;
|
||||||
|
@ -884,7 +884,7 @@
|
|||||||
},
|
},
|
||||||
"datestring": {
|
"datestring": {
|
||||||
"label": "QDate/QTime/QDateTime",
|
"label": "QDate/QTime/QDateTime",
|
||||||
"purpose": "Provides convertion between dates and strings.",
|
"purpose": "Provides conversion between dates and strings.",
|
||||||
"section": "Data structures",
|
"section": "Data structures",
|
||||||
"condition": "features.textdate",
|
"condition": "features.textdate",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
|
@ -274,7 +274,7 @@ QLibraryInfo::licensedProducts()
|
|||||||
QDate
|
QDate
|
||||||
QLibraryInfo::buildDate()
|
QLibraryInfo::buildDate()
|
||||||
{
|
{
|
||||||
return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
|
return QDate::fromString(QString::fromLatin1("2012-12-20"), Qt::ISODate);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif // datestring
|
#endif // datestring
|
||||||
|
@ -1910,12 +1910,14 @@ void qErrnoWarning(const char *msg, ...)
|
|||||||
{
|
{
|
||||||
// qt_error_string() will allocate anyway, so we don't have
|
// qt_error_string() will allocate anyway, so we don't have
|
||||||
// to be careful here (like we do in plain qWarning())
|
// to be careful here (like we do in plain qWarning())
|
||||||
|
QString error_string = qt_error_string(-1); // before vasprintf changes errno/GetLastError()
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, msg);
|
va_start(ap, msg);
|
||||||
QString buf = QString::vasprintf(msg, ap);
|
QString buf = QString::vasprintf(msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
buf += QLatin1String(" (") + qt_error_string(-1) + QLatin1Char(')');
|
buf += QLatin1String(" (") + error_string + QLatin1Char(')');
|
||||||
QMessageLogContext context;
|
QMessageLogContext context;
|
||||||
qt_message_output(QtCriticalMsg, context, buf);
|
qt_message_output(QtCriticalMsg, context, buf);
|
||||||
}
|
}
|
||||||
|
@ -70,14 +70,16 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
|
|||||||
|
|
||||||
QLoggingCategory represents a certain logging category - identified by a
|
QLoggingCategory represents a certain logging category - identified by a
|
||||||
string - at runtime. A category can be configured to enable or disable
|
string - at runtime. A category can be configured to enable or disable
|
||||||
logging of messages per message type. Whether a message type is enabled or
|
logging of messages per message type.
|
||||||
not can be checked with the \l isDebugEnabled(), \l isInfoEnabled(),
|
|
||||||
\l isWarningEnabled(), and \l isCriticalEnabled() methods.
|
|
||||||
|
|
||||||
All objects are meant to be configured by a common registry (see also
|
To check whether a message type is enabled or not, use one of these methods:
|
||||||
\l{Configuring Categories}). Different objects can also represent the same
|
\l isDebugEnabled(), \l isInfoEnabled(), \l isWarningEnabled(), and
|
||||||
category. It is therefore not recommended to export objects across module
|
\l isCriticalEnabled().
|
||||||
boundaries, nor to manipulate the objects directly, nor to inherit from
|
|
||||||
|
All objects are meant to be configured by a common registry, as described in
|
||||||
|
\l{Configuring Categories}. Different objects can also represent the same
|
||||||
|
category. Therefore, it's \b{not} recommended to export objects across
|
||||||
|
module boundaries, to manipulate the objects directly, or to inherit from
|
||||||
QLoggingCategory.
|
QLoggingCategory.
|
||||||
|
|
||||||
\section1 Creating Category Objects
|
\section1 Creating Category Objects
|
||||||
@ -87,17 +89,17 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
|
|||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 1
|
\snippet qloggingcategory/main.cpp 1
|
||||||
|
|
||||||
\note Category names are free text. However, to allow easy configuration
|
Category names are free text; to configure categories using \l{Logging Rules}, their
|
||||||
of the categories using \l{Logging Rules} the names should follow some rules:
|
names should follow this convention:
|
||||||
\list
|
\list
|
||||||
\li Use letters and numbers only.
|
\li Use letters and numbers only.
|
||||||
\li Further structure categories into common areas by using dots.
|
\li Use dots to further structure categories into common areas.
|
||||||
\li Avoid the category names \c{debug}, \c{info}, \c{warning}, and \c{critical}.
|
\li Avoid the category names: \c{debug}, \c{info}, \c{warning}, and \c{critical}.
|
||||||
\li Category names starting with \c{qt} are reserved for Qt modules.
|
\li Category names with the \c{qt} prefix are solely reserved for Qt modules.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
QLoggingCategory objects implicitly defined by Q_LOGGING_CATEGORY()
|
QLoggingCategory objects that are implicitly defined by Q_LOGGING_CATEGORY()
|
||||||
are created on first use in a thread-safe manner.
|
are created on first use, in a thread-safe manner.
|
||||||
|
|
||||||
\section1 Checking Category Configuration
|
\section1 Checking Category Configuration
|
||||||
|
|
||||||
@ -105,8 +107,8 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
|
|||||||
\l isWarningEnabled(), \l isCriticalEnabled(), as well as \l isEnabled()
|
\l isWarningEnabled(), \l isCriticalEnabled(), as well as \l isEnabled()
|
||||||
to check whether messages for the given message type should be logged.
|
to check whether messages for the given message type should be logged.
|
||||||
|
|
||||||
\note The qCDebug(), qCWarning(), qCCritical() macros prevent arguments
|
The qCDebug(), qCWarning(), and qCCritical() macros prevent arguments from
|
||||||
from being evaluated if the respective message types are not enabled for the
|
being evaluated if the respective message types are not enabled for the
|
||||||
category, so explicit checking is not needed:
|
category, so explicit checking is not needed:
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 4
|
\snippet qloggingcategory/main.cpp 4
|
||||||
@ -119,28 +121,27 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
|
|||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 5
|
\snippet qloggingcategory/main.cpp 5
|
||||||
|
|
||||||
will log messages of type \c QtWarningMsg, \c QtCriticalMsg, \c QtFatalMsg, but will
|
logs messages of type \c QtWarningMsg, \c QtCriticalMsg, \c QtFatalMsg, but
|
||||||
ignore messages of type \c QtDebugMsg and \c QtInfoMsg.
|
ignores messages of type \c QtDebugMsg and \c QtInfoMsg.
|
||||||
|
|
||||||
If no argument is passed, all messages will be logged.
|
If no argument is passed, all messages are logged.
|
||||||
|
|
||||||
\section1 Configuring Categories
|
\section1 Configuring Categories
|
||||||
|
|
||||||
The default configuration of categories can be overridden either by setting logging
|
You can override the default configuration for categories either by setting
|
||||||
rules, or by installing a custom filter.
|
logging rules, or by installing a custom filter.
|
||||||
|
|
||||||
\section2 Logging Rules
|
\section2 Logging Rules
|
||||||
|
|
||||||
Logging rules allow logging for categories to be enabled or disabled in a
|
Logging rules let you enable or disable logging for categories in a flexible
|
||||||
flexible way. Rules are specified in text, where every line must have the
|
way. Rules are specified in text, where every line must have the format:
|
||||||
format
|
|
||||||
|
|
||||||
\snippet code/src_corelib_io_qloggingcategory.cpp 0
|
\snippet code/src_corelib_io_qloggingcategory.cpp 0
|
||||||
|
|
||||||
\c <category> is the name of the category, potentially with \c{*} as a
|
\c <category> is the name of the category, potentially with \c{*} as a
|
||||||
wildcard symbol as the first or last character (or at both positions).
|
wildcard symbol for the first or last character; or at both positions.
|
||||||
The optional \c <type> must be either \c debug, \c info, \c warning, or \c critical.
|
The optional \c <type> must be \c debug, \c info, \c warning, or \c critical.
|
||||||
Lines that do not fit this scheme are ignored.
|
Lines that don't fit this scheme are ignored.
|
||||||
|
|
||||||
Rules are evaluated in text order, from first to last. That is, if two rules
|
Rules are evaluated in text order, from first to last. That is, if two rules
|
||||||
apply to a category/type, the rule that comes later is applied.
|
apply to a category/type, the rule that comes later is applied.
|
||||||
@ -149,47 +150,37 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
|
|||||||
|
|
||||||
\snippet code/src_corelib_io_qloggingcategory.cpp 1
|
\snippet code/src_corelib_io_qloggingcategory.cpp 1
|
||||||
|
|
||||||
Since Qt 5.3, logging rules are also
|
Logging rules are automatically loaded from the \c [Rules] section in a logging
|
||||||
automatically loaded from the \c [Rules] section of a logging
|
configuration file. These configuration files are looked up in the QtProject
|
||||||
configuration file. Such configuration files are looked up in the QtProject
|
configuration directory, or explicitly set in a \c QT_LOGGING_CONF environment
|
||||||
configuration directory, or explicitly set in a \c QT_LOGGING_CONF
|
variable:
|
||||||
environment variable:
|
|
||||||
|
|
||||||
\snippet code/src_corelib_io_qloggingcategory.cpp 2
|
\snippet code/src_corelib_io_qloggingcategory.cpp 2
|
||||||
|
|
||||||
Since Qt 5.3, logging rules can also be specified in a \c QT_LOGGING_RULES
|
Logging rules can also be specified in a \c QT_LOGGING_RULES environment variable;
|
||||||
environment variable. And since Qt 5.6, multiple rules can also be
|
multiple rules can also be separated by semicolons:
|
||||||
separated by semicolons:
|
|
||||||
|
|
||||||
\snippet code/src_corelib_io_qloggingcategory.cpp 3
|
\snippet code/src_corelib_io_qloggingcategory.cpp 3
|
||||||
|
|
||||||
Rules set by \l setFilterRules() take precedence over rules specified
|
Rules set by \l setFilterRules() take precedence over rules specified in the
|
||||||
in the QtProject configuration directory, and can, in turn, be
|
QtProject configuration directory. In turn, these rules can be overwritten by those
|
||||||
overwritten by rules from the configuration file specified by
|
from the configuration file specified by \c QT_LOGGING_CONF, and those set by
|
||||||
\c QT_LOGGING_CONF, and rules set by \c QT_LOGGING_RULES.
|
\c QT_LOGGING_RULES.
|
||||||
|
|
||||||
Order of evaluation:
|
The order of evaluation is as follows:
|
||||||
\list
|
\list 1
|
||||||
\li [QLibraryInfo::DataPath]/qtlogging.ini
|
\li [QLibraryInfo::DataPath]/qtlogging.ini
|
||||||
\li QtProject/qtlogging.ini
|
\li QtProject/qtlogging.ini
|
||||||
\li \l setFilterRules()
|
\li \l setFilterRules()
|
||||||
\li \c QT_LOGGING_CONF
|
\li \c QT_LOGGING_CONF
|
||||||
\li \c QT_LOGGING_RULES
|
\li \c QT_LOGGING_RULES
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The \c QtProject/qtlogging.ini file is looked up in all directories returned
|
The \c QtProject/qtlogging.ini file is looked up in all directories returned
|
||||||
by QStandardPaths::GenericConfigLocation, e.g.
|
by QStandardPaths::GenericConfigLocation.
|
||||||
|
|
||||||
\list
|
Set the \c QT_LOGGING_DEBUG environment variable to find out where you logging
|
||||||
\li on \macos and iOS: \c ~/Library/Preferences
|
rules are loaded from.
|
||||||
\li on Unix: \c ~/.config, \c /etc/xdg
|
|
||||||
\li on Windows: \c %LOCALAPPDATA%, \c %ProgramData%,
|
|
||||||
\l QCoreApplication::applicationDirPath(),
|
|
||||||
QCoreApplication::applicationDirPath() + \c "/data"
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
Set the \c QT_LOGGING_DEBUG environment variable to see from where
|
|
||||||
logging rules are loaded.
|
|
||||||
|
|
||||||
\section2 Installing a Custom Filter
|
\section2 Installing a Custom Filter
|
||||||
|
|
||||||
@ -211,7 +202,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
|
|||||||
|
|
||||||
If \a category is \c{0}, the category name is changed to \c "default".
|
If \a category is \c{0}, the category name is changed to \c "default".
|
||||||
|
|
||||||
Note that \a category must be kept valid during the lifetime of this object.
|
\note \a category must be kept valid during the lifetime of this object.
|
||||||
*/
|
*/
|
||||||
QLoggingCategory::QLoggingCategory(const char *category)
|
QLoggingCategory::QLoggingCategory(const char *category)
|
||||||
: d(nullptr),
|
: d(nullptr),
|
||||||
@ -226,7 +217,7 @@ QLoggingCategory::QLoggingCategory(const char *category)
|
|||||||
|
|
||||||
If \a category is \c{0}, the category name is changed to \c "default".
|
If \a category is \c{0}, the category name is changed to \c "default".
|
||||||
|
|
||||||
Note that \a category must be kept valid during the lifetime of this object.
|
\note \a category must be kept valid during the lifetime of this object.
|
||||||
|
|
||||||
\since 5.4
|
\since 5.4
|
||||||
*/
|
*/
|
||||||
@ -251,7 +242,7 @@ void QLoggingCategory::init(const char *category, QtMsgType severityLevel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Destructs a QLoggingCategory object.
|
Destroys a QLoggingCategory object.
|
||||||
*/
|
*/
|
||||||
QLoggingCategory::~QLoggingCategory()
|
QLoggingCategory::~QLoggingCategory()
|
||||||
{
|
{
|
||||||
@ -268,24 +259,24 @@ QLoggingCategory::~QLoggingCategory()
|
|||||||
/*!
|
/*!
|
||||||
\fn bool QLoggingCategory::isDebugEnabled() const
|
\fn bool QLoggingCategory::isDebugEnabled() const
|
||||||
|
|
||||||
Returns \c true if debug messages should be shown for this category.
|
Returns \c true if debug messages should be shown for this category;
|
||||||
Returns \c false otherwise.
|
\c false otherwise.
|
||||||
|
|
||||||
\note The \l qCDebug() macro already does this check before executing any
|
\note The \l qCDebug() macro already does this check before running any
|
||||||
code. However, calling this method may be useful to avoid
|
code. However, calling this method may be useful to avoid the
|
||||||
expensive generation of data that is only used for debug output.
|
expensive generation of data for debug output only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool QLoggingCategory::isInfoEnabled() const
|
\fn bool QLoggingCategory::isInfoEnabled() const
|
||||||
|
|
||||||
Returns \c true if informational messages should be shown for this category.
|
Returns \c true if informational messages should be shown for this category;
|
||||||
Returns \c false otherwise.
|
\c false otherwise.
|
||||||
|
|
||||||
\note The \l qCInfo() macro already does this check before executing any
|
\note The \l qCInfo() macro already does this check before executing any
|
||||||
code. However, calling this method may be useful to avoid
|
code. However, calling this method may be useful to avoid the
|
||||||
expensive generation of data that is only used for debug output.
|
expensive generation of data for debug output only.
|
||||||
|
|
||||||
\since 5.5
|
\since 5.5
|
||||||
*/
|
*/
|
||||||
@ -294,28 +285,28 @@ QLoggingCategory::~QLoggingCategory()
|
|||||||
/*!
|
/*!
|
||||||
\fn bool QLoggingCategory::isWarningEnabled() const
|
\fn bool QLoggingCategory::isWarningEnabled() const
|
||||||
|
|
||||||
Returns \c true if warning messages should be shown for this category.
|
Returns \c true if warning messages should be shown for this category;
|
||||||
Returns \c false otherwise.
|
\c false otherwise.
|
||||||
|
|
||||||
\note The \l qCWarning() macro already does this check before executing any
|
\note The \l qCWarning() macro already does this check before executing any
|
||||||
code. However, calling this method may be useful to avoid
|
code. However, calling this method may be useful to avoid the
|
||||||
expensive generation of data that is only used for debug output.
|
expensive generation of data for debug output only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool QLoggingCategory::isCriticalEnabled() const
|
\fn bool QLoggingCategory::isCriticalEnabled() const
|
||||||
|
|
||||||
Returns \c true if critical messages should be shown for this category.
|
Returns \c true if critical messages should be shown for this category;
|
||||||
Returns \c false otherwise.
|
\c false otherwise.
|
||||||
|
|
||||||
\note The \l qCCritical() macro already does this check before executing any
|
\note The \l qCCritical() macro already does this check before executing any
|
||||||
code. However, calling this method may be useful to avoid
|
code. However, calling this method may be useful to avoid the
|
||||||
expensive generation of data that is only used for debug output.
|
expensive generation of data for debug output only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns \c true if a message of type \a msgtype for the category should be
|
Returns \c true if a message of type \a msgtype for the category should be
|
||||||
shown. Returns \c false otherwise.
|
shown; \c false otherwise.
|
||||||
*/
|
*/
|
||||||
bool QLoggingCategory::isEnabled(QtMsgType msgtype) const
|
bool QLoggingCategory::isEnabled(QtMsgType msgtype) const
|
||||||
{
|
{
|
||||||
@ -332,11 +323,11 @@ bool QLoggingCategory::isEnabled(QtMsgType msgtype) const
|
|||||||
/*!
|
/*!
|
||||||
Changes the message type \a type for the category to \a enable.
|
Changes the message type \a type for the category to \a enable.
|
||||||
|
|
||||||
This method is meant to be used only from inside a filter
|
This method is meant for use only from inside a filter installed with
|
||||||
installed by \l installFilter(). See \l {Configuring Categories} for
|
\l installFilter(). For an overview on how to configure categories globally,
|
||||||
an overview on how to configure categories globally.
|
see \l {Configuring Categories}.
|
||||||
|
|
||||||
\note \c QtFatalMsg cannot be changed. It will always remain \c true.
|
\note \c QtFatalMsg cannot be changed; it will always remain \c true.
|
||||||
*/
|
*/
|
||||||
void QLoggingCategory::setEnabled(QtMsgType type, bool enable)
|
void QLoggingCategory::setEnabled(QtMsgType type, bool enable)
|
||||||
{
|
{
|
||||||
@ -359,28 +350,25 @@ void QLoggingCategory::setEnabled(QtMsgType type, bool enable)
|
|||||||
/*!
|
/*!
|
||||||
\fn QLoggingCategory &QLoggingCategory::operator()()
|
\fn QLoggingCategory &QLoggingCategory::operator()()
|
||||||
|
|
||||||
Returns the object itself. This allows both a QLoggingCategory variable, and
|
Returns the object itself. This allows for both: a QLoggingCategory variable, and
|
||||||
a factory method returning a QLoggingCategory, to be used in \l qCDebug(),
|
a factory method that returns a QLoggingCategory, to be used in \l qCDebug(),
|
||||||
\l qCWarning(), \l qCCritical() macros.
|
\l qCWarning(), or \l qCCritical() macros.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn const QLoggingCategory &QLoggingCategory::operator()() const
|
\fn const QLoggingCategory &QLoggingCategory::operator()() const
|
||||||
|
|
||||||
Returns the object itself. This allows both a QLoggingCategory variable, and
|
Returns the object itself. This allows for both: a QLoggingCategory variable, and
|
||||||
a factory method returning a QLoggingCategory, to be used in \l qCDebug(),
|
a factory method that returns a QLoggingCategory, to be used in \l qCDebug(),
|
||||||
\l qCWarning(), \l qCCritical() macros.
|
\l qCWarning(), or \l qCCritical() macros.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a pointer to the global category \c "default" that
|
Returns a pointer to the global category \c "default" that is used, for
|
||||||
is used e.g. by qDebug(), qInfo(), qWarning(), qCritical(), qFatal().
|
example, by qDebug(), qInfo(), qWarning(), qCritical(), or qFatal().
|
||||||
|
|
||||||
\note The returned pointer may be null during destruction of
|
\note The pointer returned may be null during destruction of static objects.
|
||||||
static objects.
|
Also, don't \c delete this pointer, as ownership of the category isn't transferred.
|
||||||
|
|
||||||
\note Ownership of the category is not transferred, do not
|
|
||||||
\c delete the returned pointer.
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
QLoggingCategory *QLoggingCategory::defaultCategory()
|
QLoggingCategory *QLoggingCategory::defaultCategory()
|
||||||
@ -391,8 +379,7 @@ QLoggingCategory *QLoggingCategory::defaultCategory()
|
|||||||
/*!
|
/*!
|
||||||
\typedef QLoggingCategory::CategoryFilter
|
\typedef QLoggingCategory::CategoryFilter
|
||||||
|
|
||||||
This is a typedef for a pointer to a function with the following
|
This is a typedef for a pointer to a function with the following signature:
|
||||||
signature:
|
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 20
|
\snippet qloggingcategory/main.cpp 20
|
||||||
|
|
||||||
@ -408,14 +395,13 @@ QLoggingCategory *QLoggingCategory::defaultCategory()
|
|||||||
filter is free to change the respective category configuration with
|
filter is free to change the respective category configuration with
|
||||||
\l setEnabled().
|
\l setEnabled().
|
||||||
|
|
||||||
The filter might be called from different threads, but never concurrently.
|
When you define your filter, note that it can be called from different threads; but never
|
||||||
The filter shall not call any static functions of QLoggingCategory.
|
concurrently. This filter cannot call any static functions from QLoggingCategory.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
\snippet qloggingcategory/main.cpp 21
|
\snippet qloggingcategory/main.cpp 21
|
||||||
|
|
||||||
An alternative way of configuring the default filter is via
|
Alternatively, you can configure the default filter via \l setFilterRules().
|
||||||
\l setFilterRules().
|
|
||||||
*/
|
*/
|
||||||
QLoggingCategory::CategoryFilter
|
QLoggingCategory::CategoryFilter
|
||||||
QLoggingCategory::installFilter(QLoggingCategory::CategoryFilter filter)
|
QLoggingCategory::installFilter(QLoggingCategory::CategoryFilter filter)
|
||||||
@ -425,15 +411,15 @@ QLoggingCategory::installFilter(QLoggingCategory::CategoryFilter filter)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Configures which categories and message types should be enabled through a
|
Configures which categories and message types should be enabled through a
|
||||||
a set of \a rules.
|
set of \a rules.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 2
|
\snippet qloggingcategory/main.cpp 2
|
||||||
|
|
||||||
\note The rules might be ignored if a custom category filter is installed
|
\note The rules might be ignored if a custom category filter is installed
|
||||||
with \l installFilter(), or if the user defined \c QT_LOGGING_CONF or \c QT_LOGGING_RULES
|
with \l installFilter(), or if the user has defined the \c QT_LOGGING_CONF
|
||||||
environment variable.
|
or the \c QT_LOGGING_RULES environment variable.
|
||||||
*/
|
*/
|
||||||
void QLoggingCategory::setFilterRules(const QString &rules)
|
void QLoggingCategory::setFilterRules(const QString &rules)
|
||||||
{
|
{
|
||||||
@ -446,7 +432,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.2
|
\since 5.2
|
||||||
|
|
||||||
Returns an output stream for debug messages in the logging category
|
Returns an output stream for debug messages in the logging category,
|
||||||
\a category.
|
\a category.
|
||||||
|
|
||||||
The macro expands to code that checks whether
|
The macro expands to code that checks whether
|
||||||
@ -457,8 +443,8 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 10
|
\snippet qloggingcategory/main.cpp 10
|
||||||
|
|
||||||
\note Arguments are not processed if debug output for the category is not
|
\note Arguments aren't processed if the debug output for that \a category is not
|
||||||
enabled, so do not rely on any side effects.
|
enabled, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qDebug()
|
\sa qDebug()
|
||||||
*/
|
*/
|
||||||
@ -469,16 +455,16 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.3
|
\since 5.3
|
||||||
|
|
||||||
Logs a debug message \a message in the logging category \a category.
|
Logs a debug message, \a message, in the logging category, \a category.
|
||||||
\a message might contain place holders that are replaced by additional
|
\a message may contain place holders to be replaced by additional arguments,
|
||||||
arguments, similar to the C printf() function.
|
similar to the C printf() function.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 13
|
\snippet qloggingcategory/main.cpp 13
|
||||||
|
|
||||||
\note Arguments might not be processed if debug output for the category is
|
\note Arguments aren't processed if the debug output for that \a category is not
|
||||||
not enabled, so do not rely on any side effects.
|
enabled, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qDebug()
|
\sa qDebug()
|
||||||
*/
|
*/
|
||||||
@ -489,7 +475,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.5
|
\since 5.5
|
||||||
|
|
||||||
Returns an output stream for informational messages in the logging category
|
Returns an output stream for informational messages in the logging category,
|
||||||
\a category.
|
\a category.
|
||||||
|
|
||||||
The macro expands to code that checks whether
|
The macro expands to code that checks whether
|
||||||
@ -500,8 +486,8 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
|
|
||||||
\snippet qloggingcategory/main.cpp qcinfo_stream
|
\snippet qloggingcategory/main.cpp qcinfo_stream
|
||||||
|
|
||||||
\note Arguments are not processed if debug output for the category is not
|
\note If the debug output for a particular category isn't enabled, arguments
|
||||||
enabled, so do not rely on any side effects.
|
won't be processed, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qInfo()
|
\sa qInfo()
|
||||||
*/
|
*/
|
||||||
@ -512,16 +498,16 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.5
|
\since 5.5
|
||||||
|
|
||||||
Logs an informational message \a message in the logging category \a category.
|
Logs an informational message, \a message, in the logging category, \a category.
|
||||||
\a message might contain place holders that are replaced by additional
|
\a message may contain place holders to be replaced by additional arguments,
|
||||||
arguments, similar to the C printf() function.
|
similar to the C printf() function.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp qcinfo_printf
|
\snippet qloggingcategory/main.cpp qcinfo_printf
|
||||||
|
|
||||||
\note Arguments might not be processed if debug output for the category is
|
\note If the debug output for a particular category isn't enabled, arguments
|
||||||
not enabled, so do not rely on any side effects.
|
won't be processed, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qInfo()
|
\sa qInfo()
|
||||||
*/
|
*/
|
||||||
@ -532,7 +518,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.2
|
\since 5.2
|
||||||
|
|
||||||
Returns an output stream for warning messages in the logging category
|
Returns an output stream for warning messages in the logging category,
|
||||||
\a category.
|
\a category.
|
||||||
|
|
||||||
The macro expands to code that checks whether
|
The macro expands to code that checks whether
|
||||||
@ -543,8 +529,8 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 11
|
\snippet qloggingcategory/main.cpp 11
|
||||||
|
|
||||||
\note Arguments are not processed if warning output for the category is not
|
\note If the warning output for a particular category isn't enabled, arguments
|
||||||
enabled, so do not rely on any side effects.
|
won't be processed, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qWarning()
|
\sa qWarning()
|
||||||
*/
|
*/
|
||||||
@ -555,16 +541,16 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.3
|
\since 5.3
|
||||||
|
|
||||||
Logs a warning message \a message in the logging category \a category.
|
Logs a warning message, \a message, in the logging category, \a category.
|
||||||
\a message might contain place holders that are replaced by additional
|
\a message may contain place holders to be replaced by additional arguments,
|
||||||
arguments, similar to the C printf() function.
|
similar to the C printf() function.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 14
|
\snippet qloggingcategory/main.cpp 14
|
||||||
|
|
||||||
\note Arguments might not be processed if warning output for the category is
|
\note If the warning output for a particular category isn't enabled, arguments
|
||||||
not enabled, so do not rely on any side effects.
|
won't be processed, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qWarning()
|
\sa qWarning()
|
||||||
*/
|
*/
|
||||||
@ -575,7 +561,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.2
|
\since 5.2
|
||||||
|
|
||||||
Returns an output stream for critical messages in the logging category
|
Returns an output stream for critical messages in the logging category,
|
||||||
\a category.
|
\a category.
|
||||||
|
|
||||||
The macro expands to code that checks whether
|
The macro expands to code that checks whether
|
||||||
@ -586,8 +572,9 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 12
|
\snippet qloggingcategory/main.cpp 12
|
||||||
|
|
||||||
\note Arguments are not processed if critical output for the category is not
|
|
||||||
enabled, so do not rely on any side effects.
|
\note If the critical output for a particular category isn't enabled, arguments
|
||||||
|
won't be processed, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qCritical()
|
\sa qCritical()
|
||||||
*/
|
*/
|
||||||
@ -598,16 +585,16 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\threadsafe
|
\threadsafe
|
||||||
\since 5.3
|
\since 5.3
|
||||||
|
|
||||||
Logs a critical message \a message in the logging category \a category.
|
Logs a critical message, \a message, in the logging category, \a category.
|
||||||
\a message might contain place holders that are replaced by additional
|
\a message may contain place holders to be replaced by additional arguments,
|
||||||
arguments, similar to the C printf() function.
|
similar to the C printf() function.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
\snippet qloggingcategory/main.cpp 15
|
\snippet qloggingcategory/main.cpp 15
|
||||||
|
|
||||||
\note Arguments might not be processed if critical output for the category
|
\note If the critical output for a particular category isn't enabled, arguments
|
||||||
is not enabled, so do not rely on any side effects.
|
won't be processed, so don't rely on any side effects.
|
||||||
|
|
||||||
\sa qCritical()
|
\sa qCritical()
|
||||||
*/
|
*/
|
||||||
@ -633,7 +620,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
\a string identifier. By default, all message types are enabled.
|
\a string identifier. By default, all message types are enabled.
|
||||||
|
|
||||||
Only one translation unit in a library or executable can define a category
|
Only one translation unit in a library or executable can define a category
|
||||||
with a specific name. The implicitly defined QLoggingCategory object is
|
with a specific name. The implicitly-defined QLoggingCategory object is
|
||||||
created on first use, in a thread-safe manner.
|
created on first use, in a thread-safe manner.
|
||||||
|
|
||||||
This macro must be used outside of a class or method.
|
This macro must be used outside of a class or method.
|
||||||
@ -650,7 +637,7 @@ void QLoggingCategory::setFilterRules(const QString &rules)
|
|||||||
and more severe are enabled, types with a lower severity are disabled.
|
and more severe are enabled, types with a lower severity are disabled.
|
||||||
|
|
||||||
Only one translation unit in a library or executable can define a category
|
Only one translation unit in a library or executable can define a category
|
||||||
with a specific name. The implicitly defined QLoggingCategory object is
|
with a specific name. The implicitly-defined QLoggingCategory object is
|
||||||
created on first use, in a thread-safe manner.
|
created on first use, in a thread-safe manner.
|
||||||
|
|
||||||
This macro must be used outside of a class or method. It is only defined
|
This macro must be used outside of a class or method. It is only defined
|
||||||
|
@ -243,9 +243,15 @@ bool QSaveFile::open(OpenMode mode)
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool requiresDirectWrite = false;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// check if it is an Alternate Data Stream
|
// check if it is an Alternate Data Stream
|
||||||
if (d->finalFileName == d->fileName && d->fileName.indexOf(QLatin1Char(':'), 2) > 1) {
|
requiresDirectWrite = d->finalFileName == d->fileName && d->fileName.indexOf(QLatin1Char(':'), 2) > 1;
|
||||||
|
#elif defined(Q_OS_ANDROID)
|
||||||
|
// check if it is a content:// URL
|
||||||
|
requiresDirectWrite = d->fileName.startsWith(QLatin1String("content://"));
|
||||||
|
#endif
|
||||||
|
if (requiresDirectWrite) {
|
||||||
// yes, we can't rename onto it...
|
// yes, we can't rename onto it...
|
||||||
if (d->directWriteFallback) {
|
if (d->directWriteFallback) {
|
||||||
if (openDirectly())
|
if (openDirectly())
|
||||||
@ -254,14 +260,12 @@ bool QSaveFile::open(OpenMode mode)
|
|||||||
d->fileEngine.reset();
|
d->fileEngine.reset();
|
||||||
} else {
|
} else {
|
||||||
QString msg =
|
QString msg =
|
||||||
QSaveFile::tr("QSaveFile cannot open '%1' without direct write fallback "
|
QSaveFile::tr("QSaveFile cannot open '%1' without direct write fallback enabled.")
|
||||||
"enabled: path contains an Alternate Data Stream specifier")
|
.arg(QDir::toNativeSeparators(d->fileName));
|
||||||
.arg(QDir::toNativeSeparators(d->fileName));
|
|
||||||
d->setError(QFileDevice::OpenError, msg);
|
d->setError(QFileDevice::OpenError, msg);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
d->fileEngine.reset(new QTemporaryFileEngine(&d->finalFileName, QTemporaryFileEngine::Win32NonShared));
|
d->fileEngine.reset(new QTemporaryFileEngine(&d->finalFileName, QTemporaryFileEngine::Win32NonShared));
|
||||||
// if the target file exists, we'll copy its permissions below,
|
// if the target file exists, we'll copy its permissions below,
|
||||||
|
@ -112,6 +112,13 @@ QT_BEGIN_NAMESPACE
|
|||||||
are returned by classInfo(), and you can search for pairs with
|
are returned by classInfo(), and you can search for pairs with
|
||||||
indexOfClassInfo().
|
indexOfClassInfo().
|
||||||
|
|
||||||
|
\note Operations that use the meta object system are generally thread-
|
||||||
|
safe, as QMetaObjects are typically static read-only instances
|
||||||
|
generated at compile time. However, if meta objects are dynamically
|
||||||
|
modified by the application (for instance, when using QQmlPropertyMap),
|
||||||
|
then the application has to explicitly synchronize access to the
|
||||||
|
respective meta object.
|
||||||
|
|
||||||
\sa QMetaClassInfo, QMetaEnum, QMetaMethod, QMetaProperty, QMetaType,
|
\sa QMetaClassInfo, QMetaEnum, QMetaMethod, QMetaProperty, QMetaType,
|
||||||
{Meta-Object System}
|
{Meta-Object System}
|
||||||
*/
|
*/
|
||||||
|
@ -332,7 +332,7 @@ QVariant QJsonDocument::toVariant() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Converts the QJsonDocument to a UTF-8 encoded JSON document.
|
Converts the QJsonDocument to an indented, UTF-8 encoded JSON document.
|
||||||
|
|
||||||
\sa fromJson()
|
\sa fromJson()
|
||||||
*/
|
*/
|
||||||
|
@ -3008,12 +3008,10 @@ int QRegExpEngine::getEscape()
|
|||||||
yyCharClass->addSingleton(0x005f); // '_'
|
yyCharClass->addSingleton(0x005f); // '_'
|
||||||
return Tok_CharClass;
|
return Tok_CharClass;
|
||||||
case 'I':
|
case 'I':
|
||||||
if (xmlSchemaExtensions) {
|
if (!xmlSchemaExtensions)
|
||||||
yyCharClass->setNegative(!yyCharClass->negative());
|
|
||||||
Q_FALLTHROUGH();
|
|
||||||
} else {
|
|
||||||
break;
|
break;
|
||||||
}
|
yyCharClass->setNegative(!yyCharClass->negative());
|
||||||
|
Q_FALLTHROUGH();
|
||||||
case 'i':
|
case 'i':
|
||||||
if (xmlSchemaExtensions) {
|
if (xmlSchemaExtensions) {
|
||||||
yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) |
|
yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) |
|
||||||
@ -3048,12 +3046,10 @@ int QRegExpEngine::getEscape()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'C':
|
case 'C':
|
||||||
if (xmlSchemaExtensions) {
|
if (!xmlSchemaExtensions)
|
||||||
yyCharClass->setNegative(!yyCharClass->negative());
|
|
||||||
Q_FALLTHROUGH();
|
|
||||||
} else {
|
|
||||||
break;
|
break;
|
||||||
}
|
yyCharClass->setNegative(!yyCharClass->negative());
|
||||||
|
Q_FALLTHROUGH();
|
||||||
case 'c':
|
case 'c':
|
||||||
if (xmlSchemaExtensions) {
|
if (xmlSchemaExtensions) {
|
||||||
yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) |
|
yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) |
|
||||||
@ -3094,12 +3090,10 @@ int QRegExpEngine::getEscape()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'P':
|
case 'P':
|
||||||
if (xmlSchemaExtensions) {
|
if (!xmlSchemaExtensions)
|
||||||
yyCharClass->setNegative(!yyCharClass->negative());
|
|
||||||
Q_FALLTHROUGH();
|
|
||||||
} else {
|
|
||||||
break;
|
break;
|
||||||
}
|
yyCharClass->setNegative(!yyCharClass->negative());
|
||||||
|
Q_FALLTHROUGH();
|
||||||
case 'p':
|
case 'p':
|
||||||
if (xmlSchemaExtensions) {
|
if (xmlSchemaExtensions) {
|
||||||
if (yyCh != '{') {
|
if (yyCh != '{') {
|
||||||
|
@ -1193,10 +1193,10 @@ static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensit
|
|||||||
|
|
||||||
static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
|
static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
|
||||||
{
|
{
|
||||||
if (cs == Qt::CaseInsensitive)
|
|
||||||
return qstrnicmp(lhs.data(), lhs.size(), rhs.data(), rhs.size());
|
|
||||||
if (lhs.isEmpty())
|
if (lhs.isEmpty())
|
||||||
return lencmp(0, rhs.size());
|
return lencmp(0, rhs.size());
|
||||||
|
if (cs == Qt::CaseInsensitive)
|
||||||
|
return qstrnicmp(lhs.data(), lhs.size(), rhs.data(), rhs.size());
|
||||||
const auto l = std::min(lhs.size(), rhs.size());
|
const auto l = std::min(lhs.size(), rhs.size());
|
||||||
int r = qstrncmp(lhs.data(), rhs.data(), l);
|
int r = qstrncmp(lhs.data(), rhs.data(), l);
|
||||||
return r ? r : lencmp(lhs.size(), rhs.size());
|
return r ? r : lencmp(lhs.size(), rhs.size());
|
||||||
|
@ -111,12 +111,16 @@ QDBusServer::QDBusServer(QObject *parent)
|
|||||||
*/
|
*/
|
||||||
QDBusServer::~QDBusServer()
|
QDBusServer::~QDBusServer()
|
||||||
{
|
{
|
||||||
QWriteLocker locker(&d->lock);
|
QMutex *managerMutex = nullptr;
|
||||||
|
if (QDBusConnectionManager::instance())
|
||||||
|
managerMutex = &QDBusConnectionManager::instance()->mutex;
|
||||||
|
QMutexLocker locker(managerMutex);
|
||||||
|
QWriteLocker writeLocker(&d->lock);
|
||||||
if (QDBusConnectionManager::instance()) {
|
if (QDBusConnectionManager::instance()) {
|
||||||
const auto locker = qt_scoped_lock(QDBusConnectionManager::instance()->mutex);
|
|
||||||
for (const QString &name : qAsConst(d->serverConnectionNames))
|
for (const QString &name : qAsConst(d->serverConnectionNames))
|
||||||
QDBusConnectionManager::instance()->removeConnection(name);
|
QDBusConnectionManager::instance()->removeConnection(name);
|
||||||
d->serverConnectionNames.clear();
|
d->serverConnectionNames.clear();
|
||||||
|
locker.unlock();
|
||||||
}
|
}
|
||||||
d->serverObject = nullptr;
|
d->serverObject = nullptr;
|
||||||
d->ref.storeRelaxed(0);
|
d->ref.storeRelaxed(0);
|
||||||
|
@ -3322,8 +3322,11 @@ void QGuiApplication::setFont(const QFont &font)
|
|||||||
*QGuiApplicationPrivate::app_font = font;
|
*QGuiApplicationPrivate::app_font = font;
|
||||||
applicationResourceFlags |= ApplicationFontExplicitlySet;
|
applicationResourceFlags |= ApplicationFontExplicitlySet;
|
||||||
|
|
||||||
if (emitChange && qGuiApp)
|
if (emitChange && qGuiApp) {
|
||||||
emit qGuiApp->fontChanged(*QGuiApplicationPrivate::app_font);
|
auto font = *QGuiApplicationPrivate::app_font;
|
||||||
|
locker.unlock();
|
||||||
|
emit qGuiApp->fontChanged(font);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -263,10 +263,9 @@ public:
|
|||||||
|
|
||||||
bool QOpenGLProgramBinaryCache::load(const QByteArray &cacheKey, uint programId)
|
bool QOpenGLProgramBinaryCache::load(const QByteArray &cacheKey, uint programId)
|
||||||
{
|
{
|
||||||
if (m_memCache.contains(cacheKey)) {
|
QMutexLocker lock(&m_mutex);
|
||||||
const MemCacheEntry *e = m_memCache[cacheKey];
|
if (const MemCacheEntry *e = m_memCache.object(cacheKey))
|
||||||
return setProgramBinary(programId, e->format, e->blob.constData(), e->blob.size());
|
return setProgramBinary(programId, e->format, e->blob.constData(), e->blob.size());
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray buf;
|
QByteArray buf;
|
||||||
const QString fn = cacheFileName(cacheKey);
|
const QString fn = cacheFileName(cacheKey);
|
||||||
@ -401,6 +400,7 @@ void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId)
|
|||||||
GLint outSize = 0;
|
GLint outSize = 0;
|
||||||
#if defined(QT_OPENGL_ES_2)
|
#if defined(QT_OPENGL_ES_2)
|
||||||
if (context->isOpenGLES() && context->format().majorVersion() < 3) {
|
if (context->isOpenGLES() && context->format().majorVersion() < 3) {
|
||||||
|
QMutexLocker lock(&m_mutex);
|
||||||
initializeProgramBinaryOES(context);
|
initializeProgramBinaryOES(context);
|
||||||
getProgramBinaryOES(programId, blobSize, &outSize, &blobFormat, p);
|
getProgramBinaryOES(programId, blobSize, &outSize, &blobFormat, p);
|
||||||
} else
|
} else
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include <QtGui/qtguiglobal.h>
|
#include <QtGui/qtguiglobal.h>
|
||||||
#include <QtGui/qopenglshaderprogram.h>
|
#include <QtGui/qopenglshaderprogram.h>
|
||||||
#include <QtCore/qcache.h>
|
#include <QtCore/qcache.h>
|
||||||
|
#include <QtCore/qmutex.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -99,6 +100,7 @@ private:
|
|||||||
void initializeProgramBinaryOES(QOpenGLContext *context);
|
void initializeProgramBinaryOES(QOpenGLContext *context);
|
||||||
bool m_programBinaryOESInitialized = false;
|
bool m_programBinaryOESInitialized = false;
|
||||||
#endif
|
#endif
|
||||||
|
QMutex m_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
43
src/gui/painting/XCONSORTIUM_LICENSE.txt
Normal file
43
src/gui/painting/XCONSORTIUM_LICENSE.txt
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
Copyright (c) 1987, 1988 X Consortium
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of the X Consortium shall not be
|
||||||
|
used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
|
in this Software without prior written authorization from the X Consortium.
|
||||||
|
|
||||||
|
|
||||||
|
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
|
All Rights Reserved
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
|
documentation for any purpose and without fee is hereby granted,
|
||||||
|
provided that the above copyright notice appear in all copies and that
|
||||||
|
both that copyright notice and this permission notice appear in
|
||||||
|
supporting documentation, and that the name of Digital not be
|
||||||
|
used in advertising or publicity pertaining to distribution of the
|
||||||
|
software without specific, written prior permission.
|
||||||
|
|
||||||
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||||
|
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||||
|
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||||
|
SOFTWARE.
|
@ -95,6 +95,11 @@ public:
|
|||||||
QBackingStore::QBackingStore(QWindow *window)
|
QBackingStore::QBackingStore(QWindow *window)
|
||||||
: d_ptr(new QBackingStorePrivate(window))
|
: d_ptr(new QBackingStorePrivate(window))
|
||||||
{
|
{
|
||||||
|
if (window->handle()) {
|
||||||
|
// Create platform backingstore up front if we have a platform window,
|
||||||
|
// otherwise delay the creation until absolutely necessary.
|
||||||
|
handle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -106,10 +106,10 @@ void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold
|
|||||||
int levels[10];
|
int levels[10];
|
||||||
beziers[0] = *this;
|
beziers[0] = *this;
|
||||||
levels[0] = 9;
|
levels[0] = 9;
|
||||||
QBezier *b = beziers;
|
int top = 0;
|
||||||
int *lvl = levels;
|
|
||||||
|
|
||||||
while (b >= beziers) {
|
while (top >= 0) {
|
||||||
|
QBezier *b = &beziers[top];
|
||||||
// check if we can pop the top bezier curve from the stack
|
// check if we can pop the top bezier curve from the stack
|
||||||
qreal y4y1 = b->y4 - b->y1;
|
qreal y4y1 = b->y4 - b->y1;
|
||||||
qreal x4x1 = b->x4 - b->x1;
|
qreal x4x1 = b->x4 - b->x1;
|
||||||
@ -123,17 +123,15 @@ void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold
|
|||||||
qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
|
qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
|
||||||
l = 1.;
|
l = 1.;
|
||||||
}
|
}
|
||||||
if (d < bezier_flattening_threshold*l || *lvl == 0) {
|
if (d < bezier_flattening_threshold * l || levels[top] == 0) {
|
||||||
// good enough, we pop it off and add the endpoint
|
// good enough, we pop it off and add the endpoint
|
||||||
polygon->append(QPointF(b->x4, b->y4));
|
polygon->append(QPointF(b->x4, b->y4));
|
||||||
--b;
|
--top;
|
||||||
--lvl;
|
|
||||||
} else {
|
} else {
|
||||||
// split, second half of the polygon goes lower into the stack
|
// split, second half of the polygon goes lower into the stack
|
||||||
std::tie(b[1], b[0]) = b->split();
|
std::tie(b[1], b[0]) = b->split();
|
||||||
lvl[1] = --lvl[0];
|
levels[top + 1] = --levels[top];
|
||||||
++b;
|
++top;
|
||||||
++lvl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,10 +142,10 @@ void QBezier::addToPolygon(QDataBuffer<QPointF> &polygon, qreal bezier_flattenin
|
|||||||
int levels[10];
|
int levels[10];
|
||||||
beziers[0] = *this;
|
beziers[0] = *this;
|
||||||
levels[0] = 9;
|
levels[0] = 9;
|
||||||
QBezier *b = beziers;
|
int top = 0;
|
||||||
int *lvl = levels;
|
|
||||||
|
|
||||||
while (b >= beziers) {
|
while (top >= 0) {
|
||||||
|
QBezier *b = &beziers[top];
|
||||||
// check if we can pop the top bezier curve from the stack
|
// check if we can pop the top bezier curve from the stack
|
||||||
qreal y4y1 = b->y4 - b->y1;
|
qreal y4y1 = b->y4 - b->y1;
|
||||||
qreal x4x1 = b->x4 - b->x1;
|
qreal x4x1 = b->x4 - b->x1;
|
||||||
@ -161,17 +159,15 @@ void QBezier::addToPolygon(QDataBuffer<QPointF> &polygon, qreal bezier_flattenin
|
|||||||
qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
|
qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
|
||||||
l = 1.;
|
l = 1.;
|
||||||
}
|
}
|
||||||
if (d < bezier_flattening_threshold*l || *lvl == 0) {
|
if (d < bezier_flattening_threshold * l || levels[top] == 0) {
|
||||||
// good enough, we pop it off and add the endpoint
|
// good enough, we pop it off and add the endpoint
|
||||||
polygon.add(QPointF(b->x4, b->y4));
|
polygon.add(QPointF(b->x4, b->y4));
|
||||||
--b;
|
--top;
|
||||||
--lvl;
|
|
||||||
} else {
|
} else {
|
||||||
// split, second half of the polygon goes lower into the stack
|
// split, second half of the polygon goes lower into the stack
|
||||||
std::tie(b[1], b[0]) = b->split();
|
std::tie(b[1], b[0]) = b->split();
|
||||||
lvl[1] = --lvl[0];
|
levels[top + 1] = --levels[top];
|
||||||
++b;
|
++top;
|
||||||
++lvl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,60 +88,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
Example of using complex regions:
|
Example of using complex regions:
|
||||||
\snippet code/src_gui_painting_qregion.cpp 0
|
\snippet code/src_gui_painting_qregion.cpp 0
|
||||||
|
|
||||||
\section1 Additional License Information
|
|
||||||
|
|
||||||
On Embedded Linux and X11 platforms, parts of this class rely on
|
|
||||||
code obtained under the following licenses:
|
|
||||||
|
|
||||||
\legalese
|
|
||||||
Copyright (c) 1987 X Consortium
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
Except as contained in this notice, the name of the X Consortium shall not be
|
|
||||||
used in advertising or otherwise to promote the sale, use or other dealings
|
|
||||||
in this Software without prior written authorization from the X Consortium.
|
|
||||||
\endlegalese
|
|
||||||
|
|
||||||
\br
|
|
||||||
|
|
||||||
\legalese
|
|
||||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
|
||||||
|
|
||||||
All Rights Reserved
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
|
||||||
documentation for any purpose and without fee is hereby granted,
|
|
||||||
provided that the above copyright notice appear in all copies and that
|
|
||||||
both that copyright notice and this permission notice appear in
|
|
||||||
supporting documentation, and that the name of Digital not be
|
|
||||||
used in advertising or publicity pertaining to distribution of the
|
|
||||||
software without specific, written prior permission.
|
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
|
||||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
|
||||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
||||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
||||||
SOFTWARE.
|
|
||||||
\endlegalese
|
|
||||||
|
|
||||||
\sa QPainter::setClipRegion(), QPainter::setClipRect(), QPainterPath
|
\sa QPainter::setClipRegion(), QPainter::setClipRect(), QPainterPath
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -41,5 +41,20 @@
|
|||||||
"LicenseId": "MIT",
|
"LicenseId": "MIT",
|
||||||
"LicenseFile": "WEBGRADIENTS_LICENSE.txt",
|
"LicenseFile": "WEBGRADIENTS_LICENSE.txt",
|
||||||
"Copyright": "Copyright (c) 2017 itmeo"
|
"Copyright": "Copyright (c) 2017 itmeo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "xserverhelper",
|
||||||
|
"Name": "X Server helper",
|
||||||
|
"QDocModule": "qtgui",
|
||||||
|
"QtUsage": "Used in Qt GUI (QRegion).",
|
||||||
|
"Files": "qregion.cpp",
|
||||||
|
|
||||||
|
"Description": "Code from X11's region.h, Region.c, poly.h, and PolyReg.c",
|
||||||
|
"Homepage": "https://www.x.org/",
|
||||||
|
"License": "X11 License and Historical Permission Notice and Disclaimer",
|
||||||
|
"LicenseId": "X11 AND HPND",
|
||||||
|
"LicenseFile": "XCONSORTIUM_LICENSE.txt",
|
||||||
|
"Copyright": "Copyright (c) 1987, 1988 X Consortium
|
||||||
|
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -758,8 +758,9 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
|
|||||||
quint64 requestStartOffset = requestRange.left(index).toULongLong();
|
quint64 requestStartOffset = requestRange.left(index).toULongLong();
|
||||||
quint64 requestEndOffset = requestRange.mid(index + 1).toULongLong();
|
quint64 requestEndOffset = requestRange.mid(index + 1).toULongLong();
|
||||||
|
|
||||||
|
// In case an end offset is not given it is skipped from the request range
|
||||||
requestRange = "bytes=" + QByteArray::number(resumeOffset + requestStartOffset) +
|
requestRange = "bytes=" + QByteArray::number(resumeOffset + requestStartOffset) +
|
||||||
'-' + QByteArray::number(requestEndOffset);
|
'-' + (requestEndOffset ? QByteArray::number(requestEndOffset) : QByteArray());
|
||||||
|
|
||||||
httpRequest.setHeaderField("Range", requestRange);
|
httpRequest.setHeaderField("Range", requestRange);
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,6 +63,8 @@ static void q_requestErrorCallback(val event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
val xhr = event["target"];
|
val xhr = event["target"];
|
||||||
|
if (xhr.isNull() || xhr.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
quintptr func = xhr["data-handler"].as<quintptr>();
|
quintptr func = xhr["data-handler"].as<quintptr>();
|
||||||
QNetworkReplyWasmImplPrivate *reply = reinterpret_cast<QNetworkReplyWasmImplPrivate*>(func);
|
QNetworkReplyWasmImplPrivate *reply = reinterpret_cast<QNetworkReplyWasmImplPrivate*>(func);
|
||||||
@ -84,6 +86,8 @@ static void q_progressCallback(val event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
val xhr = event["target"];
|
val xhr = event["target"];
|
||||||
|
if (xhr.isNull() || xhr.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
QNetworkReplyWasmImplPrivate *reply =
|
QNetworkReplyWasmImplPrivate *reply =
|
||||||
reinterpret_cast<QNetworkReplyWasmImplPrivate*>(xhr["data-handler"].as<quintptr>());
|
reinterpret_cast<QNetworkReplyWasmImplPrivate*>(xhr["data-handler"].as<quintptr>());
|
||||||
@ -99,6 +103,8 @@ static void q_loadCallback(val event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
val xhr = event["target"];
|
val xhr = event["target"];
|
||||||
|
if (xhr.isNull() || xhr.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
QNetworkReplyWasmImplPrivate *reply =
|
QNetworkReplyWasmImplPrivate *reply =
|
||||||
reinterpret_cast<QNetworkReplyWasmImplPrivate*>(xhr["data-handler"].as<quintptr>());
|
reinterpret_cast<QNetworkReplyWasmImplPrivate*>(xhr["data-handler"].as<quintptr>());
|
||||||
@ -123,8 +129,13 @@ static void q_loadCallback(val event)
|
|||||||
} else if (responseType == "arraybuffer" || responseType == "blob") {
|
} else if (responseType == "arraybuffer" || responseType == "blob") {
|
||||||
// handle this data in the FileReader, triggered by the call to readAsArrayBuffer
|
// handle this data in the FileReader, triggered by the call to readAsArrayBuffer
|
||||||
val blob = xhr["response"];
|
val blob = xhr["response"];
|
||||||
|
if (blob.isNull() || blob.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
val reader = val::global("FileReader").new_();
|
val reader = val::global("FileReader").new_();
|
||||||
|
if (reader.isNull() || reader.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
reader.set("onload", val::module_property("qt_QNetworkReplyWasmImplPrivate_readBinary"));
|
reader.set("onload", val::module_property("qt_QNetworkReplyWasmImplPrivate_readBinary"));
|
||||||
reader.set("data-handler", xhr["data-handler"]);
|
reader.set("data-handler", xhr["data-handler"]);
|
||||||
|
|
||||||
@ -151,6 +162,8 @@ static void q_responseHeadersCallback(val event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
val xhr = event["target"];
|
val xhr = event["target"];
|
||||||
|
if (xhr.isNull() || xhr.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
if (xhr["readyState"].as<int>() == 2) { // HEADERS_RECEIVED
|
if (xhr["readyState"].as<int>() == 2) { // HEADERS_RECEIVED
|
||||||
std::string responseHeaders = xhr.call<std::string>("getAllResponseHeaders");
|
std::string responseHeaders = xhr.call<std::string>("getAllResponseHeaders");
|
||||||
@ -170,6 +183,8 @@ static void q_readBinary(val event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
val fileReader = event["target"];
|
val fileReader = event["target"];
|
||||||
|
if (fileReader.isNull() || fileReader.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
QNetworkReplyWasmImplPrivate *reply =
|
QNetworkReplyWasmImplPrivate *reply =
|
||||||
reinterpret_cast<QNetworkReplyWasmImplPrivate*>(fileReader["data-handler"].as<quintptr>());
|
reinterpret_cast<QNetworkReplyWasmImplPrivate*>(fileReader["data-handler"].as<quintptr>());
|
||||||
@ -180,6 +195,9 @@ static void q_readBinary(val event)
|
|||||||
|
|
||||||
// Set up source typed array
|
// Set up source typed array
|
||||||
val result = fileReader["result"]; // ArrayBuffer
|
val result = fileReader["result"]; // ArrayBuffer
|
||||||
|
if (result.isNull() || result.isUndefined())
|
||||||
|
return;
|
||||||
|
|
||||||
val Uint8Array = val::global("Uint8Array");
|
val Uint8Array = val::global("Uint8Array");
|
||||||
val sourceTypedArray = Uint8Array.new_(result);
|
val sourceTypedArray = Uint8Array.new_(result);
|
||||||
|
|
||||||
|
@ -385,7 +385,11 @@
|
|||||||
"purpose": "Provides bearer management for the network stack.",
|
"purpose": "Provides bearer management for the network stack.",
|
||||||
"section": "Networking",
|
"section": "Networking",
|
||||||
"condition": "features.thread && features.library && features.networkinterface && features.properties",
|
"condition": "features.thread && features.library && features.networkinterface && features.properties",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [
|
||||||
|
"publicFeature",
|
||||||
|
"feature",
|
||||||
|
{ "type": "define", "negative": true, "name": "QT_NO_BEARERMANAGEMENT" }
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"localserver": {
|
"localserver": {
|
||||||
"label": "QLocalServer",
|
"label": "QLocalServer",
|
||||||
|
@ -485,6 +485,7 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
|
|||||||
struct ifreq req;
|
struct ifreq req;
|
||||||
};
|
};
|
||||||
int socket = -1;
|
int socket = -1;
|
||||||
|
memset(&mediareq, 0, sizeof(mediareq));
|
||||||
|
|
||||||
// ensure both structs start with the name field, of size IFNAMESIZ
|
// ensure both structs start with the name field, of size IFNAMESIZ
|
||||||
Q_STATIC_ASSERT(sizeof(mediareq.ifm_name) == sizeof(req.ifr_name));
|
Q_STATIC_ASSERT(sizeof(mediareq.ifm_name) == sizeof(req.ifr_name));
|
||||||
|
@ -157,32 +157,36 @@ SSL* QSslContext::createSsl()
|
|||||||
for (int a = 0; a < protocols.count(); ++a) {
|
for (int a = 0; a < protocols.count(); ++a) {
|
||||||
if (protocols.at(a).size() > 255) {
|
if (protocols.at(a).size() > 255) {
|
||||||
qCWarning(lcSsl) << "TLS NPN extension" << protocols.at(a)
|
qCWarning(lcSsl) << "TLS NPN extension" << protocols.at(a)
|
||||||
<< "is too long and will be truncated to 255 characters.";
|
<< "is too long and will be ignored.";
|
||||||
protocols[a] = protocols.at(a).left(255);
|
continue;
|
||||||
|
} else if (protocols.at(a).isEmpty()) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
m_supportedNPNVersions.append(protocols.at(a).size()).append(protocols.at(a));
|
m_supportedNPNVersions.append(protocols.at(a).size()).append(protocols.at(a));
|
||||||
}
|
}
|
||||||
m_npnContext.data = reinterpret_cast<unsigned char *>(m_supportedNPNVersions.data());
|
if (m_supportedNPNVersions.size()) {
|
||||||
m_npnContext.len = m_supportedNPNVersions.count();
|
m_npnContext.data = reinterpret_cast<unsigned char *>(m_supportedNPNVersions.data());
|
||||||
m_npnContext.status = QSslConfiguration::NextProtocolNegotiationNone;
|
m_npnContext.len = m_supportedNPNVersions.count();
|
||||||
|
m_npnContext.status = QSslConfiguration::NextProtocolNegotiationNone;
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||||
if (QSslSocket::sslLibraryVersionNumber() >= 0x10002000L) {
|
if (QSslSocket::sslLibraryVersionNumber() >= 0x10002000L) {
|
||||||
// Callback's type has a parameter 'const unsigned char ** out'
|
// Callback's type has a parameter 'const unsigned char ** out'
|
||||||
// since it was introduced in 1.0.2. Internally, OpenSSL's own code
|
// since it was introduced in 1.0.2. Internally, OpenSSL's own code
|
||||||
// (tests/examples) cast it to unsigned char * (since it's 'out').
|
// (tests/examples) cast it to unsigned char * (since it's 'out').
|
||||||
// We just re-use our NPN callback and cast here:
|
// We just re-use our NPN callback and cast here:
|
||||||
typedef int (*alpn_callback_t) (SSL *, const unsigned char **, unsigned char *,
|
typedef int (*alpn_callback_t) (SSL *, const unsigned char **, unsigned char *,
|
||||||
const unsigned char *, unsigned int, void *);
|
const unsigned char *, unsigned int, void *);
|
||||||
// With ALPN callback is for a server side only, for a client m_npnContext.status
|
// With ALPN callback is for a server side only, for a client m_npnContext.status
|
||||||
// will stay in NextProtocolNegotiationNone.
|
// will stay in NextProtocolNegotiationNone.
|
||||||
q_SSL_CTX_set_alpn_select_cb(ctx, alpn_callback_t(next_proto_cb), &m_npnContext);
|
q_SSL_CTX_set_alpn_select_cb(ctx, alpn_callback_t(next_proto_cb), &m_npnContext);
|
||||||
// Client:
|
// Client:
|
||||||
q_SSL_set_alpn_protos(ssl, m_npnContext.data, m_npnContext.len);
|
q_SSL_set_alpn_protos(ssl, m_npnContext.data, m_npnContext.len);
|
||||||
}
|
}
|
||||||
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ...
|
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ...
|
||||||
|
|
||||||
// And in case our peer does not support ALPN, but supports NPN:
|
// And in case our peer does not support ALPN, but supports NPN:
|
||||||
q_SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &m_npnContext);
|
q_SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &m_npnContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
|
#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
|
||||||
|
|
||||||
|
@ -928,6 +928,13 @@ bool QSslSocketBackendPrivate::initSslContext()
|
|||||||
QCFType<CFMutableArrayRef> cfNames(CFArrayCreateMutable(nullptr, 0, &kCFTypeArrayCallBacks));
|
QCFType<CFMutableArrayRef> cfNames(CFArrayCreateMutable(nullptr, 0, &kCFTypeArrayCallBacks));
|
||||||
if (cfNames) {
|
if (cfNames) {
|
||||||
for (const QByteArray &name : protocolNames) {
|
for (const QByteArray &name : protocolNames) {
|
||||||
|
if (name.size() > 255) {
|
||||||
|
qCWarning(lcSsl) << "TLS ALPN extension" << name
|
||||||
|
<< "is too long and will be ignored.";
|
||||||
|
continue;
|
||||||
|
} else if (name.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
QCFString cfName(QString::fromLatin1(name).toCFString());
|
QCFString cfName(QString::fromLatin1(name).toCFString());
|
||||||
CFArrayAppendValue(cfNames, cfName);
|
CFArrayAppendValue(cfNames, cfName);
|
||||||
}
|
}
|
||||||
|
@ -408,13 +408,17 @@ QByteArray createAlpnString(const QByteArrayList &nextAllowedProtocols)
|
|||||||
for (QByteArray proto : nextAllowedProtocols) {
|
for (QByteArray proto : nextAllowedProtocols) {
|
||||||
if (proto.size() > 255) {
|
if (proto.size() > 255) {
|
||||||
qCWarning(lcSsl) << "TLS ALPN extension" << proto
|
qCWarning(lcSsl) << "TLS ALPN extension" << proto
|
||||||
<< "is too long and will be truncated to 255 characters.";
|
<< "is too long and will be ignored.";
|
||||||
proto = proto.left(255);
|
continue;
|
||||||
|
} else if (proto.isEmpty()) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
protocolString += char(proto.length()) + proto;
|
protocolString += char(proto.length()) + proto;
|
||||||
}
|
}
|
||||||
return protocolString;
|
return protocolString;
|
||||||
}();
|
}();
|
||||||
|
if (names.isEmpty())
|
||||||
|
return alpnString;
|
||||||
|
|
||||||
const quint16 namesSize = names.size();
|
const quint16 namesSize = names.size();
|
||||||
const quint32 alpnId = SecApplicationProtocolNegotiationExt_ALPN;
|
const quint32 alpnId = SecApplicationProtocolNegotiationExt_ALPN;
|
||||||
|
@ -355,10 +355,14 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
|
|||||||
}
|
}
|
||||||
qCDebug(qLcKmsDebug) << "Physical size is" << physSize << "mm" << "for output" << connectorName;
|
qCDebug(qLcKmsDebug) << "Physical size is" << physSize << "mm" << "for output" << connectorName;
|
||||||
|
|
||||||
const QByteArray formatStr = userConnectorConfig.value(QStringLiteral("format"), QStringLiteral("xrgb8888"))
|
const QByteArray formatStr = userConnectorConfig.value(QStringLiteral("format"), QString())
|
||||||
.toByteArray().toLower();
|
.toByteArray().toLower();
|
||||||
uint32_t drmFormat;
|
uint32_t drmFormat;
|
||||||
if (formatStr == "xrgb8888") {
|
bool drmFormatExplicit = true;
|
||||||
|
if (formatStr.isEmpty()) {
|
||||||
|
drmFormat = DRM_FORMAT_XRGB8888;
|
||||||
|
drmFormatExplicit = false;
|
||||||
|
} else if (formatStr == "xrgb8888") {
|
||||||
drmFormat = DRM_FORMAT_XRGB8888;
|
drmFormat = DRM_FORMAT_XRGB8888;
|
||||||
} else if (formatStr == "xbgr8888") {
|
} else if (formatStr == "xbgr8888") {
|
||||||
drmFormat = DRM_FORMAT_XBGR8888;
|
drmFormat = DRM_FORMAT_XBGR8888;
|
||||||
@ -381,7 +385,10 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
|
|||||||
} else {
|
} else {
|
||||||
qWarning("Invalid pixel format \"%s\" for output %s", formatStr.constData(), connectorName.constData());
|
qWarning("Invalid pixel format \"%s\" for output %s", formatStr.constData(), connectorName.constData());
|
||||||
drmFormat = DRM_FORMAT_XRGB8888;
|
drmFormat = DRM_FORMAT_XRGB8888;
|
||||||
|
drmFormatExplicit = false;
|
||||||
}
|
}
|
||||||
|
qCDebug(qLcKmsDebug) << "Format is" << hex << drmFormat << dec << "requested_by_user =" << drmFormatExplicit
|
||||||
|
<< "for output" << connectorName;
|
||||||
|
|
||||||
const QString cloneSource = userConnectorConfig.value(QStringLiteral("clones")).toString();
|
const QString cloneSource = userConnectorConfig.value(QStringLiteral("clones")).toString();
|
||||||
if (!cloneSource.isEmpty())
|
if (!cloneSource.isEmpty())
|
||||||
@ -427,6 +434,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
|
|||||||
output.forced_plane_id = 0;
|
output.forced_plane_id = 0;
|
||||||
output.forced_plane_set = false;
|
output.forced_plane_set = false;
|
||||||
output.drm_format = drmFormat;
|
output.drm_format = drmFormat;
|
||||||
|
output.drm_format_requested_by_user = drmFormatExplicit;
|
||||||
output.clone_source = cloneSource;
|
output.clone_source = cloneSource;
|
||||||
output.size = framebufferSize;
|
output.size = framebufferSize;
|
||||||
|
|
||||||
|
@ -202,6 +202,7 @@ struct QKmsOutput
|
|||||||
uint32_t forced_plane_id = 0;
|
uint32_t forced_plane_id = 0;
|
||||||
bool forced_plane_set = false;
|
bool forced_plane_set = false;
|
||||||
uint32_t drm_format = DRM_FORMAT_XRGB8888;
|
uint32_t drm_format = DRM_FORMAT_XRGB8888;
|
||||||
|
bool drm_format_requested_by_user = false;
|
||||||
QString clone_source;
|
QString clone_source;
|
||||||
QVector<QKmsPlane> available_planes;
|
QVector<QKmsPlane> available_planes;
|
||||||
struct QKmsPlane *eglfs_plane = nullptr;
|
struct QKmsPlane *eglfs_plane = nullptr;
|
||||||
|
@ -21,8 +21,6 @@ SOURCES += main.mm \
|
|||||||
qcocoamenuloader.mm \
|
qcocoamenuloader.mm \
|
||||||
qcocoahelpers.mm \
|
qcocoahelpers.mm \
|
||||||
qmultitouch_mac.mm \
|
qmultitouch_mac.mm \
|
||||||
qcocoaaccessibilityelement.mm \
|
|
||||||
qcocoaaccessibility.mm \
|
|
||||||
qcocoacursor.mm \
|
qcocoacursor.mm \
|
||||||
qcocoaclipboard.mm \
|
qcocoaclipboard.mm \
|
||||||
qcocoadrag.mm \
|
qcocoadrag.mm \
|
||||||
@ -57,8 +55,6 @@ HEADERS += qcocoaintegration.h \
|
|||||||
qcocoamenuloader.h \
|
qcocoamenuloader.h \
|
||||||
qcocoahelpers.h \
|
qcocoahelpers.h \
|
||||||
qmultitouch_mac_p.h \
|
qmultitouch_mac_p.h \
|
||||||
qcocoaaccessibilityelement.h \
|
|
||||||
qcocoaaccessibility.h \
|
|
||||||
qcocoacursor.h \
|
qcocoacursor.h \
|
||||||
qcocoaclipboard.h \
|
qcocoaclipboard.h \
|
||||||
qcocoadrag.h \
|
qcocoadrag.h \
|
||||||
@ -83,13 +79,21 @@ qtConfig(vulkan) {
|
|||||||
HEADERS += qcocoavulkaninstance.h
|
HEADERS += qcocoavulkaninstance.h
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qtConfig(accessibility) {
|
||||||
|
QT += accessibility_support-private
|
||||||
|
SOURCES += qcocoaaccessibilityelement.mm \
|
||||||
|
qcocoaaccessibility.mm
|
||||||
|
HEADERS += qcocoaaccessibilityelement.h \
|
||||||
|
qcocoaaccessibility.h
|
||||||
|
}
|
||||||
|
|
||||||
RESOURCES += qcocoaresources.qrc
|
RESOURCES += qcocoaresources.qrc
|
||||||
|
|
||||||
LIBS += -framework AppKit -framework CoreServices -framework Carbon -framework IOKit -framework QuartzCore -framework CoreVideo -framework Metal -framework IOSurface -lcups
|
LIBS += -framework AppKit -framework CoreServices -framework Carbon -framework IOKit -framework QuartzCore -framework CoreVideo -framework Metal -framework IOSurface -lcups
|
||||||
|
|
||||||
QT += \
|
QT += \
|
||||||
core-private gui-private \
|
core-private gui-private \
|
||||||
accessibility_support-private clipboard_support-private theme_support-private \
|
clipboard_support-private theme_support-private \
|
||||||
fontdatabase_support-private graphics_support-private
|
fontdatabase_support-private graphics_support-private
|
||||||
|
|
||||||
qtConfig(vulkan): QT += vulkan_support-private
|
qtConfig(vulkan): QT += vulkan_support-private
|
||||||
@ -99,17 +103,20 @@ CONFIG += no_app_extension_api_only
|
|||||||
qtHaveModule(widgets) {
|
qtHaveModule(widgets) {
|
||||||
QT_FOR_CONFIG += widgets
|
QT_FOR_CONFIG += widgets
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += qpaintengine_mac.mm
|
||||||
qpaintengine_mac.mm \
|
HEADERS += qpaintengine_mac_p.h
|
||||||
qprintengine_mac.mm \
|
|
||||||
qcocoaprintersupport.mm \
|
|
||||||
qcocoaprintdevice.mm \
|
|
||||||
|
|
||||||
HEADERS += \
|
qtHaveModule(printsupport) {
|
||||||
qpaintengine_mac_p.h \
|
QT += printsupport-private
|
||||||
qprintengine_mac_p.h \
|
SOURCES += \
|
||||||
qcocoaprintersupport.h \
|
qprintengine_mac.mm \
|
||||||
qcocoaprintdevice.h \
|
qcocoaprintersupport.mm \
|
||||||
|
qcocoaprintdevice.mm
|
||||||
|
HEADERS += \
|
||||||
|
qcocoaprintersupport.h \
|
||||||
|
qcocoaprintdevice.h \
|
||||||
|
qprintengine_mac_p.h
|
||||||
|
}
|
||||||
|
|
||||||
qtConfig(colordialog) {
|
qtConfig(colordialog) {
|
||||||
SOURCES += qcocoacolordialoghelper.mm
|
SOURCES += qcocoacolordialoghelper.mm
|
||||||
@ -126,7 +133,7 @@ qtHaveModule(widgets) {
|
|||||||
HEADERS += qcocoafontdialoghelper.h
|
HEADERS += qcocoafontdialoghelper.h
|
||||||
}
|
}
|
||||||
|
|
||||||
QT += widgets-private printsupport-private
|
QT += widgets-private
|
||||||
}
|
}
|
||||||
|
|
||||||
OTHER_FILES += cocoa.json
|
OTHER_FILES += cocoa.json
|
||||||
|
@ -54,6 +54,8 @@ class QCocoaBackingStore : public QRasterBackingStore
|
|||||||
protected:
|
protected:
|
||||||
QCocoaBackingStore(QWindow *window);
|
QCocoaBackingStore(QWindow *window);
|
||||||
QCFType<CGColorSpaceRef> colorSpace() const;
|
QCFType<CGColorSpaceRef> colorSpace() const;
|
||||||
|
QMacNotificationObserver m_backingPropertiesObserver;
|
||||||
|
virtual void backingPropertiesChanged() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QNSWindowBackingStore : public QCocoaBackingStore
|
class QNSWindowBackingStore : public QCocoaBackingStore
|
||||||
@ -69,6 +71,7 @@ private:
|
|||||||
bool windowHasUnifiedToolbar() const;
|
bool windowHasUnifiedToolbar() const;
|
||||||
QImage::Format format() const override;
|
QImage::Format format() const override;
|
||||||
void redrawRoundedBottomCorners(CGRect) const;
|
void redrawRoundedBottomCorners(CGRect) const;
|
||||||
|
void backingPropertiesChanged() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QCALayerBackingStore : public QCocoaBackingStore
|
class QCALayerBackingStore : public QCocoaBackingStore
|
||||||
@ -115,6 +118,8 @@ private:
|
|||||||
bool recreateBackBufferIfNeeded();
|
bool recreateBackBufferIfNeeded();
|
||||||
bool prepareForFlush();
|
bool prepareForFlush();
|
||||||
|
|
||||||
|
void backingPropertiesChanged() override;
|
||||||
|
|
||||||
std::list<std::unique_ptr<GraphicsBuffer>> m_buffers;
|
std::list<std::unique_ptr<GraphicsBuffer>> m_buffers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,6 +51,17 @@ QT_BEGIN_NAMESPACE
|
|||||||
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
|
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
|
||||||
: QRasterBackingStore(window)
|
: QRasterBackingStore(window)
|
||||||
{
|
{
|
||||||
|
// Ideally this would be plumbed from the platform layer to QtGui, and
|
||||||
|
// the QBackingStore would be recreated, but we don't have that code yet,
|
||||||
|
// so at least make sure we invalidate our backingstore when the backing
|
||||||
|
// properties (color space e.g.) are changed.
|
||||||
|
NSView *view = static_cast<QCocoaWindow *>(window->handle())->view();
|
||||||
|
m_backingPropertiesObserver = QMacNotificationObserver(view.window,
|
||||||
|
NSWindowDidChangeBackingPropertiesNotification, [this]() {
|
||||||
|
qCDebug(lcQpaBackingStore) << "Backing properties for"
|
||||||
|
<< this->window() << "did change";
|
||||||
|
backingPropertiesChanged();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QCFType<CGColorSpaceRef> QCocoaBackingStore::colorSpace() const
|
QCFType<CGColorSpaceRef> QCocoaBackingStore::colorSpace() const
|
||||||
@ -64,6 +75,37 @@ QCFType<CGColorSpaceRef> QCocoaBackingStore::colorSpace() const
|
|||||||
QNSWindowBackingStore::QNSWindowBackingStore(QWindow *window)
|
QNSWindowBackingStore::QNSWindowBackingStore(QWindow *window)
|
||||||
: QCocoaBackingStore(window)
|
: QCocoaBackingStore(window)
|
||||||
{
|
{
|
||||||
|
// Choose an appropriate window depth based on the requested surface format.
|
||||||
|
// On deep color displays the default bit depth is 16-bit, so unless we need
|
||||||
|
// that level of precision we opt out of it (and the expensive RGB32 -> RGB64
|
||||||
|
// conversions that come with it if our backingstore depth does not match).
|
||||||
|
|
||||||
|
NSWindow *nsWindow = static_cast<QCocoaWindow *>(window->handle())->view().window;
|
||||||
|
auto colorSpaceName = NSColorSpaceFromDepth(nsWindow.depthLimit);
|
||||||
|
|
||||||
|
static const int kDefaultBitDepth = 8;
|
||||||
|
auto surfaceFormat = window->requestedFormat();
|
||||||
|
auto bitsPerSample = qMax(kDefaultBitDepth, qMax(surfaceFormat.redBufferSize(),
|
||||||
|
qMax(surfaceFormat.greenBufferSize(), surfaceFormat.blueBufferSize())));
|
||||||
|
|
||||||
|
// NSBestDepth does not seem to guarantee a window depth deep enough for the
|
||||||
|
// given bits per sample, even if documented as such. For example, requesting
|
||||||
|
// 10 bits per sample will not give us a 16-bit format, even if that's what's
|
||||||
|
// available. Work around this by manually bumping the bit depth.
|
||||||
|
bitsPerSample = !(bitsPerSample & (bitsPerSample - 1))
|
||||||
|
? bitsPerSample : qNextPowerOfTwo(bitsPerSample);
|
||||||
|
|
||||||
|
auto bestDepth = NSBestDepth(colorSpaceName, bitsPerSample, 0, NO, nullptr);
|
||||||
|
|
||||||
|
// Disable dynamic depth limit, otherwise our depth limit will be overwritten
|
||||||
|
// by AppKit if the window moves to a screen with a different depth. We call
|
||||||
|
// this before setting the depth limit, as the call will reset the depth to 0.
|
||||||
|
[nsWindow setDynamicDepthLimit:NO];
|
||||||
|
|
||||||
|
qCDebug(lcQpaBackingStore) << "Using" << NSBitsPerSampleFromDepth(bestDepth)
|
||||||
|
<< "bit window depth for" << nsWindow;
|
||||||
|
|
||||||
|
nsWindow.depthLimit = bestDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
QNSWindowBackingStore::~QNSWindowBackingStore()
|
QNSWindowBackingStore::~QNSWindowBackingStore()
|
||||||
@ -212,9 +254,6 @@ void QNSWindowBackingStore::flush(QWindow *window, const QRegion ®ion, const
|
|||||||
|
|
||||||
CGRect viewRect = viewLocalRect.toCGRect();
|
CGRect viewRect = viewLocalRect.toCGRect();
|
||||||
|
|
||||||
if (windowHasUnifiedToolbar())
|
|
||||||
NSDrawWindowBackground(viewRect);
|
|
||||||
|
|
||||||
[backingStoreImage drawInRect:viewRect fromRect:backingStoreRect.toCGRect()
|
[backingStoreImage drawInRect:viewRect fromRect:backingStoreRect.toCGRect()
|
||||||
operation:compositingOperation fraction:1.0 respectFlipped:YES hints:nil];
|
operation:compositingOperation fraction:1.0 respectFlipped:YES hints:nil];
|
||||||
|
|
||||||
@ -302,6 +341,11 @@ void QNSWindowBackingStore::redrawRoundedBottomCorners(CGRect windowRect) const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QNSWindowBackingStore::backingPropertiesChanged()
|
||||||
|
{
|
||||||
|
m_image = QImage();
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
QCALayerBackingStore::QCALayerBackingStore(QWindow *window)
|
QCALayerBackingStore::QCALayerBackingStore(QWindow *window)
|
||||||
@ -565,6 +609,12 @@ QImage QCALayerBackingStore::toImage() const
|
|||||||
return imageCopy;
|
return imageCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QCALayerBackingStore::backingPropertiesChanged()
|
||||||
|
{
|
||||||
|
m_buffers.clear();
|
||||||
|
m_buffers.resize(1);
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformGraphicsBuffer *QCALayerBackingStore::graphicsBuffer() const
|
QPlatformGraphicsBuffer *QCALayerBackingStore::graphicsBuffer() const
|
||||||
{
|
{
|
||||||
return m_buffers.back().get();
|
return m_buffers.back().get();
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
#include "qguiapplication.h"
|
#include "qguiapplication.h"
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
#ifndef QT_NO_WIDGETS
|
#if !defined(QT_NO_WIDGETS) && defined(QT_PRINTSUPPORT_LIB)
|
||||||
#include "qcocoaprintersupport.h"
|
#include "qcocoaprintersupport.h"
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
#include <qpa/qplatformprintersupport.h>
|
#include <qpa/qplatformprintersupport.h>
|
||||||
@ -153,24 +153,24 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QCocoaNativeInter
|
|||||||
|
|
||||||
QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport()
|
QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport()
|
||||||
{
|
{
|
||||||
#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER)
|
#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER) && defined(QT_PRINTSUPPORT_LIB)
|
||||||
return new QCocoaPrinterSupport();
|
return new QCocoaPrinterSupport();
|
||||||
#else
|
#else
|
||||||
qFatal("Printing is not supported when Qt is configured with -no-widgets");
|
qFatal("Printing is not supported when Qt is configured with -no-widgets or -no-feature-printer");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
|
void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
|
||||||
{
|
{
|
||||||
#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER)
|
#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER) && defined(QT_PRINTSUPPORT_LIB)
|
||||||
QMacPrintEnginePrivate *macPrintEnginePriv = static_cast<QMacPrintEngine *>(printEngine)->d_func();
|
QMacPrintEnginePrivate *macPrintEnginePriv = static_cast<QMacPrintEngine *>(printEngine)->d_func();
|
||||||
if (macPrintEnginePriv->state == QPrinter::Idle && !macPrintEnginePriv->isPrintSessionInitialized())
|
if (macPrintEnginePriv->state == QPrinter::Idle && !macPrintEnginePriv->isPrintSessionInitialized())
|
||||||
macPrintEnginePriv->initialize();
|
macPrintEnginePriv->initialize();
|
||||||
return macPrintEnginePriv->printInfo;
|
return macPrintEnginePriv->printInfo;
|
||||||
#else
|
#else
|
||||||
Q_UNUSED(printEngine);
|
Q_UNUSED(printEngine);
|
||||||
qFatal("Printing is not supported when Qt is configured with -no-widgets");
|
qFatal("Printing is not supported when Qt is configured with -no-widgets or -no-feature-printer");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -161,6 +161,7 @@ public:
|
|||||||
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
|
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
|
||||||
Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
|
Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
|
||||||
Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
|
Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
|
||||||
|
Q_NOTIFICATION_HANDLER(NSWindowDidChangeBackingPropertiesNotification) void windowDidChangeBackingProperties();
|
||||||
Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
|
Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
|
||||||
|
|
||||||
bool windowShouldClose();
|
bool windowShouldClose();
|
||||||
|
@ -1262,6 +1262,17 @@ void QCocoaWindow::windowDidChangeScreen()
|
|||||||
currentScreen->requestUpdate();
|
currentScreen->requestUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
The window's backing scale factor or color space has changed.
|
||||||
|
*/
|
||||||
|
void QCocoaWindow::windowDidChangeBackingProperties()
|
||||||
|
{
|
||||||
|
// Ideally we would plumb this thought QPA in a way that lets clients
|
||||||
|
// invalidate their own caches, and recreate QBackingStore. For now we
|
||||||
|
// trigger an expose, and let QCocoaBackingStore deal with its own
|
||||||
|
// buffer invalidation.
|
||||||
|
[m_view setNeedsDisplay:YES];
|
||||||
|
}
|
||||||
|
|
||||||
void QCocoaWindow::windowWillClose()
|
void QCocoaWindow::windowWillClose()
|
||||||
{
|
{
|
||||||
@ -1649,21 +1660,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
|
|||||||
|
|
||||||
applyContentBorderThickness(nsWindow);
|
applyContentBorderThickness(nsWindow);
|
||||||
|
|
||||||
// Prevent CoreGraphics RGB32 -> RGB64 backing store conversions on deep color
|
|
||||||
// displays by forcing 8-bit components, unless a deep color format has been
|
|
||||||
// requested. This conversion uses significant CPU time.
|
|
||||||
QSurface::SurfaceType surfaceType = QPlatformWindow::window()->surfaceType();
|
|
||||||
bool usesCoreGraphics = surfaceType == QSurface::RasterSurface || surfaceType == QSurface::RasterGLSurface;
|
|
||||||
QSurfaceFormat surfaceFormat = QPlatformWindow::window()->format();
|
|
||||||
bool usesDeepColor = surfaceFormat.redBufferSize() > 8 ||
|
|
||||||
surfaceFormat.greenBufferSize() > 8 ||
|
|
||||||
surfaceFormat.blueBufferSize() > 8;
|
|
||||||
bool usesLayer = view().layer;
|
|
||||||
if (usesCoreGraphics && !usesDeepColor && !usesLayer) {
|
|
||||||
[nsWindow setDynamicDepthLimit:NO];
|
|
||||||
[nsWindow setDepthLimit:NSWindowDepthTwentyfourBitRGB];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (format().colorSpace() == QSurfaceFormat::sRGBColorSpace)
|
if (format().colorSpace() == QSurfaceFormat::sRGBColorSpace)
|
||||||
nsWindow.colorSpace = NSColorSpace.sRGBColorSpace;
|
nsWindow.colorSpace = NSColorSpace.sRGBColorSpace;
|
||||||
|
|
||||||
|
@ -394,14 +394,16 @@
|
|||||||
}
|
}
|
||||||
// Close the popups if the click was outside.
|
// Close the popups if the click was outside.
|
||||||
if (!inside) {
|
if (!inside) {
|
||||||
|
bool selfClosed = false;
|
||||||
Qt::WindowType type = QCocoaIntegration::instance()->activePopupWindow()->window()->type();
|
Qt::WindowType type = QCocoaIntegration::instance()->activePopupWindow()->window()->type();
|
||||||
while (QCocoaWindow *popup = QCocoaIntegration::instance()->popPopupWindow()) {
|
while (QCocoaWindow *popup = QCocoaIntegration::instance()->popPopupWindow()) {
|
||||||
|
selfClosed = self == popup->view();
|
||||||
QWindowSystemInterface::handleCloseEvent(popup->window());
|
QWindowSystemInterface::handleCloseEvent(popup->window());
|
||||||
QWindowSystemInterface::flushWindowSystemEvents();
|
QWindowSystemInterface::flushWindowSystemEvents();
|
||||||
}
|
}
|
||||||
// Consume the mouse event when closing the popup, except for tool tips
|
// Consume the mouse event when closing the popup, except for tool tips
|
||||||
// were it's expected that the event is processed normally.
|
// were it's expected that the event is processed normally.
|
||||||
if (type != Qt::ToolTip)
|
if (type != Qt::ToolTip || selfClosed)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,20 +253,10 @@ static bool isMouseEvent(NSEvent *ev)
|
|||||||
return m_platformWindow ? m_platformWindow->isOpaque() : [super isOpaque];
|
return m_platformWindow ? m_platformWindow->isOpaque() : [super isOpaque];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
Borderless windows need a transparent background
|
|
||||||
|
|
||||||
Technically windows with NSWindowStyleMaskTexturedBackground
|
|
||||||
(such as windows with unified toolbars) need to draw the textured
|
|
||||||
background of the NSWindow, and can't have a transparent
|
|
||||||
background, but as NSWindowStyleMaskBorderless is 0, you can't
|
|
||||||
have a window with NSWindowStyleMaskTexturedBackground that is
|
|
||||||
also borderless.
|
|
||||||
*/
|
|
||||||
- (NSColor *)backgroundColor
|
- (NSColor *)backgroundColor
|
||||||
{
|
{
|
||||||
return self.styleMask == NSWindowStyleMaskBorderless
|
return self.styleMask & NSWindowStyleMaskTexturedBackground ?
|
||||||
? [NSColor clearColor] : [super backgroundColor];
|
[super backgroundColor] : [NSColor clearColor];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sendEvent:(NSEvent*)theEvent
|
- (void)sendEvent:(NSEvent*)theEvent
|
||||||
|
@ -38,14 +38,18 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qpaintengine_mac_p.h"
|
#include "qpaintengine_mac_p.h"
|
||||||
|
#if defined(QT_PRINTSUPPORT_LIB)
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <qbitmap.h>
|
#include <qbitmap.h>
|
||||||
#include <qpaintdevice.h>
|
#include <qpaintdevice.h>
|
||||||
#include <qpainterpath.h>
|
#include <qpainterpath.h>
|
||||||
#include <qpixmapcache.h>
|
#include <qpixmapcache.h>
|
||||||
#include <private/qpaintengine_raster_p.h>
|
#include <private/qpaintengine_raster_p.h>
|
||||||
|
#if defined(QT_PRINTSUPPORT_LIB)
|
||||||
#include <qprinter.h>
|
#include <qprinter.h>
|
||||||
|
#endif
|
||||||
#include <qstack.h>
|
#include <qstack.h>
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
#include <qvarlengtharray.h>
|
#include <qvarlengtharray.h>
|
||||||
|
@ -155,20 +155,33 @@ gbm_surface *QEglFSKmsGbmScreen::createSurface(EGLConfig eglConfig)
|
|||||||
qCDebug(qLcEglfsKmsDebug, "Creating gbm_surface for screen %s", qPrintable(name()));
|
qCDebug(qLcEglfsKmsDebug, "Creating gbm_surface for screen %s", qPrintable(name()));
|
||||||
|
|
||||||
const auto gbmDevice = static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice();
|
const auto gbmDevice = static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice();
|
||||||
EGLint native_format = -1;
|
// If there was no format override given in the config file,
|
||||||
EGLBoolean success = eglGetConfigAttrib(display(), eglConfig, EGL_NATIVE_VISUAL_ID, &native_format);
|
// query the native (here, gbm) format from the EGL config.
|
||||||
qCDebug(qLcEglfsKmsDebug) << "Got native format" << Qt::hex << native_format << Qt::dec << "from eglGetConfigAttrib() with return code" << bool(success);
|
const bool queryFromEgl = !m_output.drm_format_requested_by_user;
|
||||||
|
if (queryFromEgl) {
|
||||||
|
EGLint native_format = -1;
|
||||||
|
EGLBoolean success = eglGetConfigAttrib(display(), eglConfig, EGL_NATIVE_VISUAL_ID, &native_format);
|
||||||
|
qCDebug(qLcEglfsKmsDebug) << "Got native format" << Qt::hex << native_format << Qt::dec
|
||||||
|
<< "from eglGetConfigAttrib() with return code" << bool(success);
|
||||||
|
|
||||||
if (success)
|
if (success) {
|
||||||
m_gbm_surface = gbm_surface_create(gbmDevice,
|
m_gbm_surface = gbm_surface_create(gbmDevice,
|
||||||
rawGeometry().width(),
|
rawGeometry().width(),
|
||||||
rawGeometry().height(),
|
rawGeometry().height(),
|
||||||
native_format,
|
native_format,
|
||||||
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
|
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
|
||||||
|
if (m_gbm_surface)
|
||||||
|
m_output.drm_format = gbmFormatToDrmFormat(native_format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_gbm_surface) { // fallback for older drivers
|
// Fallback for older drivers, and when "format" is explicitly specified
|
||||||
|
// in the output config. (not guaranteed that the requested format works
|
||||||
|
// of course, but do what we are told to)
|
||||||
|
if (!m_gbm_surface) {
|
||||||
uint32_t gbmFormat = drmFormatToGbmFormat(m_output.drm_format);
|
uint32_t gbmFormat = drmFormatToGbmFormat(m_output.drm_format);
|
||||||
qCDebug(qLcEglfsKmsDebug, "Could not create surface with EGL_NATIVE_VISUAL_ID, falling back to format %x", gbmFormat);
|
if (queryFromEgl)
|
||||||
|
qCDebug(qLcEglfsKmsDebug, "Could not create surface with EGL_NATIVE_VISUAL_ID, falling back to format %x", gbmFormat);
|
||||||
m_gbm_surface = gbm_surface_create(gbmDevice,
|
m_gbm_surface = gbm_surface_create(gbmDevice,
|
||||||
rawGeometry().width(),
|
rawGeometry().width(),
|
||||||
rawGeometry().height(),
|
rawGeometry().height(),
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
- (id)accessibilityElementAtIndex:(NSInteger)index
|
- (id)accessibilityElementAtIndex:(NSInteger)index
|
||||||
{
|
{
|
||||||
[self initAccessibility];
|
[self initAccessibility];
|
||||||
if (index >= [m_accessibleElements count])
|
if (NSUInteger(index) >= [m_accessibleElements count])
|
||||||
return nil;
|
return nil;
|
||||||
return m_accessibleElements[index];
|
return m_accessibleElements[index];
|
||||||
}
|
}
|
||||||
|
@ -670,18 +670,26 @@ HRESULT QWindowsUiaMainProvider::ElementProviderFromPoint(double x, double y, IR
|
|||||||
QPoint point;
|
QPoint point;
|
||||||
nativeUiaPointToPoint(uiaPoint, window, &point);
|
nativeUiaPointToPoint(uiaPoint, window, &point);
|
||||||
|
|
||||||
QAccessibleInterface *targetacc = accessible->childAt(point.x(), point.y());
|
if (auto targetacc = accessible->childAt(point.x(), point.y())) {
|
||||||
|
auto acc = accessible->childAt(point.x(), point.y());
|
||||||
if (targetacc) {
|
// Reject the cases where childAt() returns a different instance in each call for the same
|
||||||
QAccessibleInterface *acc = targetacc;
|
// element (e.g., QAccessibleTree), as it causes an endless loop with Youdao Dictionary installed.
|
||||||
// Controls can be embedded within grouping elements. By default returns the innermost control.
|
if (targetacc == acc) {
|
||||||
while (acc) {
|
// Controls can be embedded within grouping elements. By default returns the innermost control.
|
||||||
targetacc = acc;
|
while (acc) {
|
||||||
// For accessibility tools it may be better to return the text element instead of its subcomponents.
|
targetacc = acc;
|
||||||
if (targetacc->textInterface()) break;
|
// For accessibility tools it may be better to return the text element instead of its subcomponents.
|
||||||
acc = acc->childAt(point.x(), point.y());
|
if (targetacc->textInterface()) break;
|
||||||
|
acc = targetacc->childAt(point.x(), point.y());
|
||||||
|
if (acc != targetacc->childAt(point.x(), point.y())) {
|
||||||
|
qCDebug(lcQpaUiAutomation) << "Non-unique childAt() for" << targetacc;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*pRetVal = providerForAccessible(targetacc);
|
||||||
|
} else {
|
||||||
|
qCDebug(lcQpaUiAutomation) << "Non-unique childAt() for" << accessible;
|
||||||
}
|
}
|
||||||
*pRetVal = providerForAccessible(targetacc);
|
|
||||||
}
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -40,13 +40,11 @@
|
|||||||
#include "qppdprintdevice.h"
|
#include "qppdprintdevice.h"
|
||||||
|
|
||||||
#include "qcupsprintersupport_p.h"
|
#include "qcupsprintersupport_p.h"
|
||||||
|
#include "private/qcups_p.h" // Only needed for PDPK_*
|
||||||
|
|
||||||
#if QT_CONFIG(mimetype)
|
#if QT_CONFIG(mimetype)
|
||||||
#include <QtCore/QMimeDatabase>
|
#include <QtCore/QMimeDatabase>
|
||||||
#endif
|
#endif
|
||||||
#include <qdebug.h>
|
|
||||||
|
|
||||||
#include "private/qcups_p.h" // Only needed for PDPK_*
|
|
||||||
|
|
||||||
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
#ifndef QT_LINUXBASE // LSB merges everything into cups.h
|
||||||
#include <cups/language.h>
|
#include <cups/language.h>
|
||||||
|
@ -533,7 +533,7 @@ bool QToolBarLayout::layoutActions(const QSize &size)
|
|||||||
if (expanded)
|
if (expanded)
|
||||||
rperp(o, size) = rowHeight;
|
rperp(o, size) = rowHeight;
|
||||||
else
|
else
|
||||||
rperp(o, size) = perp(o, rect.size()) - perp(o, QSize(margins.top(), margins.left()));
|
rperp(o, size) = perp(o, rect.size()) - perp(o, margins);
|
||||||
QRect r(pos, size);
|
QRect r(pos, size);
|
||||||
|
|
||||||
if (o == Qt::Horizontal)
|
if (o == Qt::Horizontal)
|
||||||
|
@ -711,9 +711,6 @@ void tst_qmake::qinstall()
|
|||||||
QFile srcfile(src.filePath("main.cpp"));
|
QFile srcfile(src.filePath("main.cpp"));
|
||||||
QVERIFY(srcfile.setPermissions(srcfile.permissions() & ~writeFlags));
|
QVERIFY(srcfile.setPermissions(srcfile.permissions() & ~writeFlags));
|
||||||
QDir dst("zort");
|
QDir dst("zort");
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
QEXPECT_FAIL("", "QTBUG-77299", Abort);
|
|
||||||
#endif
|
|
||||||
QVERIFY(qinstall(src.absolutePath(), dst.absolutePath()));
|
QVERIFY(qinstall(src.absolutePath(), dst.absolutePath()));
|
||||||
QCOMPARE(src.entryList(QDir::Files, QDir::Name), dst.entryList(QDir::Files, QDir::Name));
|
QCOMPARE(src.entryList(QDir::Files, QDir::Name), dst.entryList(QDir::Files, QDir::Name));
|
||||||
}
|
}
|
||||||
|
@ -4860,6 +4860,7 @@ void tst_QLineEdit::inputRejected()
|
|||||||
QCOMPARE(spyInputRejected.count(), 0);
|
QCOMPARE(spyInputRejected.count(), 0);
|
||||||
QTest::keyClicks(testWidget, "fgh");
|
QTest::keyClicks(testWidget, "fgh");
|
||||||
QCOMPARE(spyInputRejected.count(), 3);
|
QCOMPARE(spyInputRejected.count(), 3);
|
||||||
|
#if QT_CONFIG(clipboard)
|
||||||
testWidget->clear();
|
testWidget->clear();
|
||||||
spyInputRejected.clear();
|
spyInputRejected.clear();
|
||||||
QApplication::clipboard()->setText("ijklmno");
|
QApplication::clipboard()->setText("ijklmno");
|
||||||
@ -4867,6 +4868,7 @@ void tst_QLineEdit::inputRejected()
|
|||||||
// The first 5 characters are accepted, but
|
// The first 5 characters are accepted, but
|
||||||
// the last 2 are not.
|
// the last 2 are not.
|
||||||
QCOMPARE(spyInputRejected.count(), 1);
|
QCOMPARE(spyInputRejected.count(), 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
testWidget->setMaxLength(INT_MAX);
|
testWidget->setMaxLength(INT_MAX);
|
||||||
testWidget->clear();
|
testWidget->clear();
|
||||||
@ -4877,11 +4879,13 @@ void tst_QLineEdit::inputRejected()
|
|||||||
QCOMPARE(spyInputRejected.count(), 0);
|
QCOMPARE(spyInputRejected.count(), 0);
|
||||||
QTest::keyClicks(testWidget, "a#");
|
QTest::keyClicks(testWidget, "a#");
|
||||||
QCOMPARE(spyInputRejected.count(), 2);
|
QCOMPARE(spyInputRejected.count(), 2);
|
||||||
|
#if QT_CONFIG(clipboard)
|
||||||
testWidget->clear();
|
testWidget->clear();
|
||||||
spyInputRejected.clear();
|
spyInputRejected.clear();
|
||||||
QApplication::clipboard()->setText("a#");
|
QApplication::clipboard()->setText("a#");
|
||||||
testWidget->paste();
|
testWidget->paste();
|
||||||
QCOMPARE(spyInputRejected.count(), 1);
|
QCOMPARE(spyInputRejected.count(), 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
testWidget->clear();
|
testWidget->clear();
|
||||||
testWidget->setValidator(0);
|
testWidget->setValidator(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user