Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
This commit is contained in:
commit
246799d8a7
@ -106,7 +106,6 @@ Build options:
|
|||||||
|
|
||||||
-c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
|
-c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
|
||||||
(Not supported with MSVC)
|
(Not supported with MSVC)
|
||||||
-rtti ................ Build with Runtime Type Information [yes] (MSVC only)
|
|
||||||
|
|
||||||
-sse2 ................ Use SSE2 instructions [auto]
|
-sse2 ................ Use SSE2 instructions [auto]
|
||||||
-sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
|
-sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
|
||||||
|
@ -109,7 +109,6 @@
|
|||||||
"reduce-relocations": { "type": "boolean", "name": "reduce_relocations" },
|
"reduce-relocations": { "type": "boolean", "name": "reduce_relocations" },
|
||||||
"release": { "type": "enum", "name": "debug", "values": { "yes": "no", "no": "yes" } },
|
"release": { "type": "enum", "name": "debug", "values": { "yes": "no", "no": "yes" } },
|
||||||
"rpath": "boolean",
|
"rpath": "boolean",
|
||||||
"rtti": "boolean",
|
|
||||||
"sanitize": "sanitize",
|
"sanitize": "sanitize",
|
||||||
"sdk": "string",
|
"sdk": "string",
|
||||||
"separate-debug-info": { "type": "boolean", "name": "separate_debug_info" },
|
"separate-debug-info": { "type": "boolean", "name": "separate_debug_info" },
|
||||||
@ -573,12 +572,6 @@
|
|||||||
"autoDetect": false,
|
"autoDetect": false,
|
||||||
"output": [ { "type": "varAppend", "name": "EXTRA_RPATHS", "value": "input.rpaths" } ]
|
"output": [ { "type": "varAppend", "name": "EXTRA_RPATHS", "value": "input.rpaths" } ]
|
||||||
},
|
},
|
||||||
"rtti": {
|
|
||||||
"label": "Build with RTTI",
|
|
||||||
"comment": "mkspecs/features/win32/default_pre.prf sets no-rtti. Follow default behavior of configure.exe by overriding with rtti.",
|
|
||||||
"condition": "config.win32",
|
|
||||||
"output": [ "publicConfig" ]
|
|
||||||
},
|
|
||||||
"force_asserts": {
|
"force_asserts": {
|
||||||
"label": "Force assertions",
|
"label": "Force assertions",
|
||||||
"autoDetect": false,
|
"autoDetect": false,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
dita.metadata.default.author = Qt Project
|
dita.metadata.default.author = Qt Project
|
||||||
dita.metadata.default.permissions = all
|
dita.metadata.default.permissions = all
|
||||||
dita.metadata.default.publisher = Qt Project
|
dita.metadata.default.publisher = Qt Project
|
||||||
dita.metadata.default.copyryear = 2016
|
dita.metadata.default.copyryear = 2017
|
||||||
dita.metadata.default.copyrholder = The Qt Company Ltd
|
dita.metadata.default.copyrholder = The Qt Company Ltd
|
||||||
dita.metadata.default.audience = programmer
|
dita.metadata.default.audience = programmer
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ HTML.footer += \
|
|||||||
" <ul id=\"menu-footer-submenu\" class=\"right clearfix\"><li id=\"menu-item-1795\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1795\"><a title=\"Sign into your account.\" href=\"https://account.qt.io/login\">Sign In</a></li>\n" \
|
" <ul id=\"menu-footer-submenu\" class=\"right clearfix\"><li id=\"menu-item-1795\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1795\"><a title=\"Sign into your account.\" href=\"https://account.qt.io/login\">Sign In</a></li>\n" \
|
||||||
" <li id=\"menu-item-10375\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-10375\"><a href=\"mailto:feedback@theqtcompany.com?Subject=Feedback%20about%20doc.qt.io%20site\">Feedback</a></li>\n" \
|
" <li id=\"menu-item-10375\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-10375\"><a href=\"mailto:feedback@theqtcompany.com?Subject=Feedback%20about%20doc.qt.io%20site\">Feedback</a></li>\n" \
|
||||||
" <li id=\"menu-item-1494\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1494\"><a href=\"http://qt.io/contact-us/\">Contact us</a></li>\n" \
|
" <li id=\"menu-item-1494\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1494\"><a href=\"http://qt.io/contact-us/\">Contact us</a></li>\n" \
|
||||||
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2016 The Qt Company</a></li>\n" \
|
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2017 The Qt Company</a></li>\n" \
|
||||||
" </ul>\n" \
|
" </ul>\n" \
|
||||||
"</div>\n" \
|
"</div>\n" \
|
||||||
"</div>\n" \
|
"</div>\n" \
|
||||||
|
@ -8,7 +8,7 @@ HTML.footer = \
|
|||||||
"</div>\n" \
|
"</div>\n" \
|
||||||
"<div class=\"footer\">\n" \
|
"<div class=\"footer\">\n" \
|
||||||
" <p>\n" \
|
" <p>\n" \
|
||||||
" <acronym title=\"Copyright\">©</acronym> 2016 The Qt Company Ltd.\n" \
|
" <acronym title=\"Copyright\">©</acronym> 2017 The Qt Company Ltd.\n" \
|
||||||
" Documentation contributions included herein are the copyrights of\n" \
|
" Documentation contributions included herein are the copyrights of\n" \
|
||||||
" their respective owners.<br>" \
|
" their respective owners.<br>" \
|
||||||
" The documentation provided herein is licensed under the terms of the" \
|
" The documentation provided herein is licensed under the terms of the" \
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
HTML.footer = \
|
HTML.footer = \
|
||||||
" </div>\n" \
|
" </div>\n" \
|
||||||
" <p class=\"copy-notice\">\n" \
|
" <p class=\"copy-notice\">\n" \
|
||||||
" <acronym title=\"Copyright\">©</acronym> 2016 The Qt Company Ltd.\n" \
|
" <acronym title=\"Copyright\">©</acronym> 2017 The Qt Company Ltd.\n" \
|
||||||
" Documentation contributions included herein are the copyrights of\n" \
|
" Documentation contributions included herein are the copyrights of\n" \
|
||||||
" their respective owners. " \
|
" their respective owners. " \
|
||||||
" The documentation provided herein is licensed under the terms of the" \
|
" The documentation provided herein is licensed under the terms of the" \
|
||||||
|
@ -363,9 +363,10 @@ void CodeStylePage::initializePage()
|
|||||||
baseIncludeLabel->setEnabled(!baseClass.isEmpty());
|
baseIncludeLabel->setEnabled(!baseClass.isEmpty());
|
||||||
baseIncludeLineEdit->setEnabled(!baseClass.isEmpty());
|
baseIncludeLineEdit->setEnabled(!baseClass.isEmpty());
|
||||||
|
|
||||||
|
QRegularExpression rx("Q[A-Z].*");
|
||||||
if (baseClass.isEmpty()) {
|
if (baseClass.isEmpty()) {
|
||||||
baseIncludeLineEdit->clear();
|
baseIncludeLineEdit->clear();
|
||||||
} else if (QRegExp("Q[A-Z].*").exactMatch(baseClass)) {
|
} else if (rx.match(baseClass).hasMatch()) {
|
||||||
baseIncludeLineEdit->setText('<' + baseClass + '>');
|
baseIncludeLineEdit->setText('<' + baseClass + '>');
|
||||||
} else {
|
} else {
|
||||||
baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\"");
|
baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\"");
|
||||||
|
@ -54,6 +54,8 @@
|
|||||||
|
|
||||||
#include "licensewizard.h"
|
#include "licensewizard.h"
|
||||||
|
|
||||||
|
QString emailRegExp = QStringLiteral(".+@.+");
|
||||||
|
|
||||||
//! [0] //! [1] //! [2]
|
//! [0] //! [1] //! [2]
|
||||||
LicenseWizard::LicenseWizard(QWidget *parent)
|
LicenseWizard::LicenseWizard(QWidget *parent)
|
||||||
: QWizard(parent)
|
: QWizard(parent)
|
||||||
@ -189,7 +191,7 @@ EvaluatePage::EvaluatePage(QWidget *parent)
|
|||||||
|
|
||||||
emailLabel = new QLabel(tr("&Email address:"));
|
emailLabel = new QLabel(tr("&Email address:"));
|
||||||
emailLineEdit = new QLineEdit;
|
emailLineEdit = new QLineEdit;
|
||||||
emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
|
emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
|
||||||
emailLabel->setBuddy(emailLineEdit);
|
emailLabel->setBuddy(emailLineEdit);
|
||||||
|
|
||||||
//! [21]
|
//! [21]
|
||||||
@ -264,7 +266,7 @@ DetailsPage::DetailsPage(QWidget *parent)
|
|||||||
|
|
||||||
emailLabel = new QLabel(tr("&Email address:"));
|
emailLabel = new QLabel(tr("&Email address:"));
|
||||||
emailLineEdit = new QLineEdit;
|
emailLineEdit = new QLineEdit;
|
||||||
emailLineEdit->setValidator(new QRegExpValidator(QRegExp(".*@.*"), this));
|
emailLineEdit->setValidator(new QRegularExpressionValidator(QRegularExpression(emailRegExp), this));
|
||||||
emailLabel->setBuddy(emailLineEdit);
|
emailLabel->setBuddy(emailLineEdit);
|
||||||
|
|
||||||
postalLabel = new QLabel(tr("&Postal address:"));
|
postalLabel = new QLabel(tr("&Postal address:"));
|
||||||
|
@ -741,8 +741,8 @@
|
|||||||
whitespace and one or several digits again.
|
whitespace and one or several digits again.
|
||||||
|
|
||||||
The first digits of the regular expression are captured using
|
The first digits of the regular expression are captured using
|
||||||
parentheses. This enables us to use the QRegExp::cap() or
|
parentheses. This enables us to use the QRegularExpressionMatch::captured()
|
||||||
QRegExp::capturedTexts() functions to extract the matched
|
or QRegularExpressionMatch::capturedTexts() functions to extract the matched
|
||||||
characters. If the first and second numbers of the spin box value
|
characters. If the first and second numbers of the spin box value
|
||||||
differ (e.g., "16 x 24"), we use the first number.
|
differ (e.g., "16 x 24"), we use the first number.
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ void AddressBook::exportAsVCard()
|
|||||||
int index = name.indexOf(" ");
|
int index = name.indexOf(" ");
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
nameList = name.split(QRegExp("\\s+"), QString::SkipEmptyParts);
|
nameList = name.split(QRegularExpression("\\s+"), QString::SkipEmptyParts);
|
||||||
firstName = nameList.first();
|
firstName = nameList.first();
|
||||||
lastName = nameList.last();
|
lastName = nameList.last();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1878,6 +1878,7 @@ pfx = $$[QT_INSTALL_PREFIX]
|
|||||||
equals(pfx, $$[QT_INSTALL_PREFIX/get]) {
|
equals(pfx, $$[QT_INSTALL_PREFIX/get]) {
|
||||||
logn("Once everything is built, Qt is installed.")
|
logn("Once everything is built, Qt is installed.")
|
||||||
logn("You should NOT run '$$QMAKE_MAKE_NAME install'.")
|
logn("You should NOT run '$$QMAKE_MAKE_NAME install'.")
|
||||||
|
logn("Note that this build cannot be deployed to other machines or devices.")
|
||||||
} else {
|
} else {
|
||||||
logn("Once everything is built, you must run '$$QMAKE_MAKE_NAME install'.")
|
logn("Once everything is built, you must run '$$QMAKE_MAKE_NAME install'.")
|
||||||
logn("Qt will be installed into '$$system_path($$pfx)'.")
|
logn("Qt will be installed into '$$system_path($$pfx)'.")
|
||||||
|
@ -29,7 +29,18 @@ isEmpty($${target_prefix}.INCDIRS) {
|
|||||||
cmd_prefix = "set LC_ALL=C&"
|
cmd_prefix = "set LC_ALL=C&"
|
||||||
cmd_suffix = "<NUL >NUL"
|
cmd_suffix = "<NUL >NUL"
|
||||||
}
|
}
|
||||||
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$QMAKE_CXXFLAGS) -xc++ -E -v - 2>&1 $$cmd_suffix", lines)
|
|
||||||
|
cxx_flags = $$QMAKE_CXXFLAGS
|
||||||
|
|
||||||
|
# Manually inject the sysroot for Apple Platforms because its resolution
|
||||||
|
# normally does not happen until default_post.prf. This is especially
|
||||||
|
# important for moc to gain the correct default include directory list.
|
||||||
|
# While technically incorrect but without any likely practical effect,
|
||||||
|
# UIKit simulator platforms will see the device SDK's sysroot in
|
||||||
|
# QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass.
|
||||||
|
darwin: cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH
|
||||||
|
|
||||||
|
output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ -E -v - 2>&1 $$cmd_suffix", lines)
|
||||||
add_includes = false
|
add_includes = false
|
||||||
for (line, output) {
|
for (line, output) {
|
||||||
line ~= s/^ *// # remove leading spaces
|
line ~= s/^ *// # remove leading spaces
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
CONFIG = rtti_off incremental_off windows $$CONFIG
|
CONFIG = incremental_off windows $$CONFIG
|
||||||
load(default_pre)
|
load(default_pre)
|
||||||
|
@ -79,6 +79,7 @@ QMAKE_LINK = icpc
|
|||||||
QMAKE_LINK_SHLIB = icpc
|
QMAKE_LINK_SHLIB = icpc
|
||||||
QMAKE_LFLAGS =
|
QMAKE_LFLAGS =
|
||||||
QMAKE_LFLAGS_RELEASE =
|
QMAKE_LFLAGS_RELEASE =
|
||||||
|
QMAKE_LFLAGS_APP = -pie
|
||||||
QMAKE_LFLAGS_DEBUG =
|
QMAKE_LFLAGS_DEBUG =
|
||||||
QMAKE_LFLAGS_SHLIB = -shared -shared-intel
|
QMAKE_LFLAGS_SHLIB = -shared -shared-intel
|
||||||
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
||||||
|
@ -380,14 +380,14 @@ void Widget::fillFunction()
|
|||||||
void Widget::fromRawDataFunction()
|
void Widget::fromRawDataFunction()
|
||||||
{
|
{
|
||||||
//! [22]
|
//! [22]
|
||||||
QRegExp pattern;
|
QRegularExpression pattern("\u00A4");
|
||||||
static const QChar unicode[] = {
|
static const QChar unicode[] = {
|
||||||
0x005A, 0x007F, 0x00A4, 0x0060,
|
0x005A, 0x007F, 0x00A4, 0x0060,
|
||||||
0x1009, 0x0020, 0x0020};
|
0x1009, 0x0020, 0x0020};
|
||||||
int size = sizeof(unicode) / sizeof(QChar);
|
int size = sizeof(unicode) / sizeof(QChar);
|
||||||
|
|
||||||
QString str = QString::fromRawData(unicode, size);
|
QString str = QString::fromRawData(unicode, size);
|
||||||
if (str.contains(QRegExp(pattern))) {
|
if (str.contains(pattern) {
|
||||||
// ...
|
// ...
|
||||||
//! [22] //! [23]
|
//! [22] //! [23]
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ Widget::Widget(QWidget *parent)
|
|||||||
//! [6]
|
//! [6]
|
||||||
|
|
||||||
//! [7]
|
//! [7]
|
||||||
QStringList monospacedFonts = fonts.filter(QRegExp("Courier|Fixed"));
|
QStringList monospacedFonts = fonts.filter(QRegularExpression("Courier|Fixed"));
|
||||||
//! [7]
|
//! [7]
|
||||||
|
|
||||||
//! [8]
|
//! [8]
|
||||||
|
@ -530,14 +530,24 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// expand environment variables in the form $(ENVVAR)
|
int startIndex = 0;
|
||||||
int rep;
|
forever {
|
||||||
QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));
|
startIndex = ret.indexOf(QLatin1Char('$'), startIndex);
|
||||||
reg_var.setMinimal(true);
|
if (startIndex < 0)
|
||||||
while((rep = reg_var.indexIn(ret)) != -1) {
|
break;
|
||||||
ret.replace(rep, reg_var.matchedLength(),
|
if (ret.length() < startIndex + 3)
|
||||||
QString::fromLocal8Bit(qgetenv(ret.midRef(rep + 2,
|
break;
|
||||||
reg_var.matchedLength() - 3).toLatin1().constData()).constData()));
|
if (ret.at(startIndex + 1) != QLatin1Char('(')) {
|
||||||
|
startIndex++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int endIndex = ret.indexOf(QLatin1Char(')'), startIndex + 2);
|
||||||
|
if (endIndex < 0)
|
||||||
|
break;
|
||||||
|
QStringRef envVarName = ret.midRef(startIndex + 2, endIndex - startIndex - 2);
|
||||||
|
QString value = QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
|
||||||
|
ret.replace(startIndex, endIndex - startIndex + 1, value);
|
||||||
|
startIndex += value.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
config->endGroup();
|
config->endGroup();
|
||||||
|
@ -234,9 +234,6 @@
|
|||||||
# if defined(_MIPS_ARCH_MIPS2) || (defined(__mips) && __mips - 0 >= 2)
|
# if defined(_MIPS_ARCH_MIPS2) || (defined(__mips) && __mips - 0 >= 2)
|
||||||
# define Q_PROCESSOR_MIPS_II
|
# define Q_PROCESSOR_MIPS_II
|
||||||
# endif
|
# endif
|
||||||
# if defined(_MIPS_ARCH_MIPS32) || defined(__mips32)
|
|
||||||
# define Q_PROCESSOR_MIPS_32
|
|
||||||
# endif
|
|
||||||
# if defined(_MIPS_ARCH_MIPS3) || (defined(__mips) && __mips - 0 >= 3)
|
# if defined(_MIPS_ARCH_MIPS3) || (defined(__mips) && __mips - 0 >= 3)
|
||||||
# define Q_PROCESSOR_MIPS_III
|
# define Q_PROCESSOR_MIPS_III
|
||||||
# endif
|
# endif
|
||||||
@ -246,6 +243,9 @@
|
|||||||
# if defined(_MIPS_ARCH_MIPS5) || (defined(__mips) && __mips - 0 >= 5)
|
# if defined(_MIPS_ARCH_MIPS5) || (defined(__mips) && __mips - 0 >= 5)
|
||||||
# define Q_PROCESSOR_MIPS_V
|
# define Q_PROCESSOR_MIPS_V
|
||||||
# endif
|
# endif
|
||||||
|
# if defined(_MIPS_ARCH_MIPS32) || defined(__mips32) || (defined(__mips) && __mips - 0 >= 32)
|
||||||
|
# define Q_PROCESSOR_MIPS_32
|
||||||
|
# endif
|
||||||
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
|
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
|
||||||
# define Q_PROCESSOR_MIPS_64
|
# define Q_PROCESSOR_MIPS_64
|
||||||
# define Q_PROCESSOR_WORDSIZE 8
|
# define Q_PROCESSOR_WORDSIZE 8
|
||||||
|
@ -1494,7 +1494,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
|
|||||||
ensureAllSectionsParsed(confFile);
|
ensureAllSectionsParsed(confFile);
|
||||||
ParsedSettingsMap mergedKeys = confFile->mergedKeyMap();
|
ParsedSettingsMap mergedKeys = confFile->mergedKeyMap();
|
||||||
|
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
|
||||||
QSaveFile sf(confFile->name);
|
QSaveFile sf(confFile->name);
|
||||||
#else
|
#else
|
||||||
QFile sf(confFile->name);
|
QFile sf(confFile->name);
|
||||||
@ -1522,7 +1522,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile)
|
|||||||
ok = writeFunc(sf, tempOriginalKeys);
|
ok = writeFunc(sf, tempOriginalKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#if !defined(QT_BOOTSTRAPPED) && QT_CONFIG(temporaryfile)
|
||||||
if (ok)
|
if (ok)
|
||||||
ok = sf.commit();
|
ok = sf.commit();
|
||||||
#endif
|
#endif
|
||||||
|
@ -97,9 +97,7 @@ QEventDispatcherWin32Private::QEventDispatcherWin32Private()
|
|||||||
: threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
|
: threadId(GetCurrentThreadId()), interrupt(false), closingDown(false), internalHwnd(0),
|
||||||
getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
|
getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
|
||||||
wakeUps(0)
|
wakeUps(0)
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
, activateNotifiersPosted(false)
|
, activateNotifiersPosted(false)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,11 +178,9 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
|
|||||||
|
|
||||||
QSockNot *sn = dict ? dict->value(wp) : 0;
|
QSockNot *sn = dict ? dict->value(wp) : 0;
|
||||||
if (sn) {
|
if (sn) {
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
d->doWsaAsyncSelect(sn->fd, 0);
|
d->doWsaAsyncSelect(sn->fd, 0);
|
||||||
d->active_fd[sn->fd].selected = false;
|
d->active_fd[sn->fd].selected = false;
|
||||||
d->postActivateSocketNotifiers();
|
d->postActivateSocketNotifiers();
|
||||||
#endif
|
|
||||||
if (type < 3) {
|
if (type < 3) {
|
||||||
QEvent event(QEvent::SockAct);
|
QEvent event(QEvent::SockAct);
|
||||||
QCoreApplication::sendEvent(sn->obj, &event);
|
QCoreApplication::sendEvent(sn->obj, &event);
|
||||||
@ -195,7 +191,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
} else if (message == WM_QT_ACTIVATENOTIFIERS) {
|
} else if (message == WM_QT_ACTIVATENOTIFIERS) {
|
||||||
Q_ASSERT(d != 0);
|
Q_ASSERT(d != 0);
|
||||||
|
|
||||||
@ -210,7 +205,6 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
|
|||||||
}
|
}
|
||||||
d->activateNotifiersPosted = false;
|
d->activateNotifiersPosted = false;
|
||||||
return 0;
|
return 0;
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
} else if (message == WM_QT_SENDPOSTEDEVENTS
|
} else if (message == WM_QT_SENDPOSTEDEVENTS
|
||||||
// we also use a Windows timer to send posted events when the message queue is full
|
// we also use a Windows timer to send posted events when the message queue is full
|
||||||
|| (message == WM_TIMER
|
|| (message == WM_TIMER
|
||||||
@ -445,13 +439,11 @@ void QEventDispatcherWin32Private::doWsaAsyncSelect(int socket, long event)
|
|||||||
WSAAsyncSelect(socket, internalHwnd, event ? int(WM_QT_SOCKETNOTIFIER) : 0, event);
|
WSAAsyncSelect(socket, internalHwnd, event ? int(WM_QT_SOCKETNOTIFIER) : 0, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
void QEventDispatcherWin32Private::postActivateSocketNotifiers()
|
void QEventDispatcherWin32Private::postActivateSocketNotifiers()
|
||||||
{
|
{
|
||||||
if (!activateNotifiersPosted)
|
if (!activateNotifiersPosted)
|
||||||
activateNotifiersPosted = PostMessage(internalHwnd, WM_QT_ACTIVATENOTIFIERS, 0, 0);
|
activateNotifiersPosted = PostMessage(internalHwnd, WM_QT_ACTIVATENOTIFIERS, 0, 0);
|
||||||
}
|
}
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
|
|
||||||
void QEventDispatcherWin32::createInternalHwnd()
|
void QEventDispatcherWin32::createInternalHwnd()
|
||||||
{
|
{
|
||||||
@ -705,22 +697,16 @@ void QEventDispatcherWin32::registerSocketNotifier(QSocketNotifier *notifier)
|
|||||||
QSFDict::iterator it = d->active_fd.find(sockfd);
|
QSFDict::iterator it = d->active_fd.find(sockfd);
|
||||||
if (it != d->active_fd.end()) {
|
if (it != d->active_fd.end()) {
|
||||||
QSockFd &sd = it.value();
|
QSockFd &sd = it.value();
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
if (sd.selected) {
|
if (sd.selected) {
|
||||||
d->doWsaAsyncSelect(sockfd, 0);
|
d->doWsaAsyncSelect(sockfd, 0);
|
||||||
sd.selected = false;
|
sd.selected = false;
|
||||||
}
|
}
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
sd.event |= event;
|
sd.event |= event;
|
||||||
} else {
|
} else {
|
||||||
d->active_fd.insert(sockfd, QSockFd(event));
|
d->active_fd.insert(sockfd, QSockFd(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
d->postActivateSocketNotifiers();
|
d->postActivateSocketNotifiers();
|
||||||
#else
|
|
||||||
d->doWsaAsyncSelect(sockfd, event);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
|
void QEventDispatcherWin32::unregisterSocketNotifier(QSocketNotifier *notifier)
|
||||||
@ -749,7 +735,6 @@ void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier
|
|||||||
QSFDict::iterator it = d->active_fd.find(sockfd);
|
QSFDict::iterator it = d->active_fd.find(sockfd);
|
||||||
if (it != d->active_fd.end()) {
|
if (it != d->active_fd.end()) {
|
||||||
QSockFd &sd = it.value();
|
QSockFd &sd = it.value();
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
if (sd.selected)
|
if (sd.selected)
|
||||||
d->doWsaAsyncSelect(sockfd, 0);
|
d->doWsaAsyncSelect(sockfd, 0);
|
||||||
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
|
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
|
||||||
@ -760,13 +745,6 @@ void QEventDispatcherWin32::doUnregisterSocketNotifier(QSocketNotifier *notifier
|
|||||||
sd.selected = false;
|
sd.selected = false;
|
||||||
d->postActivateSocketNotifiers();
|
d->postActivateSocketNotifiers();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
const long event[3] = { FD_READ | FD_CLOSE | FD_ACCEPT, FD_WRITE | FD_CONNECT, FD_OOB };
|
|
||||||
sd.event ^= event[type];
|
|
||||||
d->doWsaAsyncSelect(sockfd, sd.event);
|
|
||||||
if (sd.event == 0)
|
|
||||||
d->active_fd.erase(it);
|
|
||||||
#endif // !Q_OS_WINCE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSNDict *sn_vec[3] = { &d->sn_read, &d->sn_write, &d->sn_except };
|
QSNDict *sn_vec[3] = { &d->sn_read, &d->sn_write, &d->sn_except };
|
||||||
|
@ -187,10 +187,8 @@ public:
|
|||||||
QSNDict sn_write;
|
QSNDict sn_write;
|
||||||
QSNDict sn_except;
|
QSNDict sn_except;
|
||||||
QSFDict active_fd;
|
QSFDict active_fd;
|
||||||
#ifndef Q_OS_WINCE
|
|
||||||
bool activateNotifiersPosted;
|
bool activateNotifiersPosted;
|
||||||
void postActivateSocketNotifiers();
|
void postActivateSocketNotifiers();
|
||||||
#endif
|
|
||||||
void doWsaAsyncSelect(int socket, long event);
|
void doWsaAsyncSelect(int socket, long event);
|
||||||
|
|
||||||
QList<QWinEventNotifier *> winEventNotifierList;
|
QList<QWinEventNotifier *> winEventNotifierList;
|
||||||
|
@ -2636,6 +2636,9 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM
|
|||||||
(exact same signal to the exact same slot on the same objects),
|
(exact same signal to the exact same slot on the same objects),
|
||||||
the connection will fail and connect will return an invalid QMetaObject::Connection.
|
the connection will fail and connect will return an invalid QMetaObject::Connection.
|
||||||
|
|
||||||
|
\note Qt::UniqueConnections do not work for lambdas, non-member functions
|
||||||
|
and functors; they only apply to connecting to member functions.
|
||||||
|
|
||||||
The optional \a type parameter describes the type of connection
|
The optional \a type parameter describes the type of connection
|
||||||
to establish. In particular, it determines whether a particular
|
to establish. In particular, it determines whether a particular
|
||||||
signal is delivered to a slot immediately or queued for delivery
|
signal is delivered to a slot immediately or queued for delivery
|
||||||
@ -4705,7 +4708,10 @@ void qDeleteInEventHandler(QObject *o)
|
|||||||
|
|
||||||
Creates a connection of a given \a type from \a signal in
|
Creates a connection of a given \a type from \a signal in
|
||||||
\a sender object to \a functor to be placed in a specific event
|
\a sender object to \a functor to be placed in a specific event
|
||||||
loop of \a context, and returns a handle to the connection
|
loop of \a context, and returns a handle to the connection.
|
||||||
|
|
||||||
|
\note Qt::UniqueConnections do not work for lambdas, non-member functions
|
||||||
|
and functors; they only apply to connecting to member functions.
|
||||||
|
|
||||||
The signal must be a function declared as a signal in the header.
|
The signal must be a function declared as a signal in the header.
|
||||||
The slot function can be any function or functor that can be connected
|
The slot function can be any function or functor that can be connected
|
||||||
|
@ -177,6 +177,26 @@ inline void v_clear(QVariant::Private *d, T* = 0)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct PrimitiveIsNull
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static bool isNull(const QVariant::Private *d)
|
||||||
|
{
|
||||||
|
return d->is_null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct PrimitiveIsNull<std::nullptr_t>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static bool isNull(const QVariant::Private *)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<class Filter>
|
template<class Filter>
|
||||||
class QVariantComparator {
|
class QVariantComparator {
|
||||||
template<typename T, bool IsAcceptedType = Filter::template Acceptor<T>::IsAccepted>
|
template<typename T, bool IsAcceptedType = Filter::template Acceptor<T>::IsAccepted>
|
||||||
@ -268,7 +288,7 @@ class QVariantIsNull
|
|||||||
{
|
{
|
||||||
static bool isNull(const QVariant::Private *d)
|
static bool isNull(const QVariant::Private *d)
|
||||||
{
|
{
|
||||||
return d->is_null;
|
return PrimitiveIsNull<T>::isNull(d);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -176,6 +176,9 @@ public:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
inline QAtomicPointer(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
|
inline QAtomicPointer(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
|
||||||
|
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
|
||||||
|
: QBasicAtomicPointer<T>()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
this->storeRelease(other.loadAcquire());
|
this->storeRelease(other.loadAcquire());
|
||||||
}
|
}
|
||||||
|
@ -8159,7 +8159,7 @@ bool QString::isRightToLeft() const
|
|||||||
to create a deep copy of the data, ensuring that the raw data
|
to create a deep copy of the data, ensuring that the raw data
|
||||||
isn't modified.
|
isn't modified.
|
||||||
|
|
||||||
Here's an example of how we can use a QRegExp on raw data in
|
Here's an example of how we can use a QRegularExpression on raw data in
|
||||||
memory without requiring to copy the data into a QString:
|
memory without requiring to copy the data into a QString:
|
||||||
|
|
||||||
\snippet qstring/main.cpp 22
|
\snippet qstring/main.cpp 22
|
||||||
|
@ -143,8 +143,8 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
\snippet qstringlist/main.cpp 6
|
\snippet qstringlist/main.cpp 6
|
||||||
|
|
||||||
The argument to split can be a single character, a string, or a
|
The argument to split can be a single character, a string, a
|
||||||
QRegExp.
|
QRegularExpression or a (deprecated) QRegExp.
|
||||||
|
|
||||||
In addition, the \l {QStringList::operator+()}{operator+()}
|
In addition, the \l {QStringList::operator+()}{operator+()}
|
||||||
function allows you to concatenate two string lists into one. To
|
function allows you to concatenate two string lists into one. To
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
: a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
|
: a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
|
||||||
{
|
{
|
||||||
if (args.size())
|
if (args.size())
|
||||||
append(args.begin(), args.size());
|
append(args.begin(), int(args.size()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -170,11 +170,11 @@
|
|||||||
\sa QMovie::stop()
|
\sa QMovie::stop()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "qglobal.h"
|
#include "qmovie.h"
|
||||||
|
|
||||||
#ifndef QT_NO_MOVIE
|
#ifndef QT_NO_MOVIE
|
||||||
|
|
||||||
#include "qmovie.h"
|
#include "qglobal.h"
|
||||||
#include "qimage.h"
|
#include "qimage.h"
|
||||||
#include "qimagereader.h"
|
#include "qimagereader.h"
|
||||||
#include "qpixmap.h"
|
#include "qpixmap.h"
|
||||||
|
@ -2474,7 +2474,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
|
|||||||
QWindow *window = e->window.data();
|
QWindow *window = e->window.data();
|
||||||
typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;
|
typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;
|
||||||
QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents;
|
QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents;
|
||||||
bool velocityOnly = false;
|
bool stationaryTouchPointChangedVelocity = false;
|
||||||
|
|
||||||
for (int i = 0; i < e->points.count(); ++i) {
|
for (int i = 0; i < e->points.count(); ++i) {
|
||||||
QTouchEvent::TouchPoint touchPoint = e->points.at(i);
|
QTouchEvent::TouchPoint touchPoint = e->points.at(i);
|
||||||
@ -2554,7 +2554,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
|
|||||||
if (touchPoint.state() == Qt::TouchPointStationary) {
|
if (touchPoint.state() == Qt::TouchPointStationary) {
|
||||||
if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) {
|
if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) {
|
||||||
touchInfo.touchPoint.setVelocity(touchPoint.velocity());
|
touchInfo.touchPoint.setVelocity(touchPoint.velocity());
|
||||||
velocityOnly = true;
|
stationaryTouchPointChangedVelocity = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
touchInfo.touchPoint = touchPoint;
|
touchInfo.touchPoint = touchPoint;
|
||||||
@ -2595,10 +2595,9 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
|
|||||||
break;
|
break;
|
||||||
case Qt::TouchPointStationary:
|
case Qt::TouchPointStationary:
|
||||||
// don't send the event if nothing changed
|
// don't send the event if nothing changed
|
||||||
if (velocityOnly)
|
if (!stationaryTouchPointChangedVelocity)
|
||||||
eventType = QEvent::TouchUpdate;
|
|
||||||
else
|
|
||||||
continue;
|
continue;
|
||||||
|
Q_FALLTHROUGH();
|
||||||
default:
|
default:
|
||||||
eventType = QEvent::TouchUpdate;
|
eventType = QEvent::TouchUpdate;
|
||||||
break;
|
break;
|
||||||
|
@ -278,7 +278,7 @@ void QColorDialogStaticData::readSettings()
|
|||||||
void QColorDialogStaticData::writeSettings() const
|
void QColorDialogStaticData::writeSettings() const
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_SETTINGS
|
#ifndef QT_NO_SETTINGS
|
||||||
if (!customSet) {
|
if (customSet) {
|
||||||
QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
|
QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
|
||||||
for (int i = 0; i < int(CustomColorCount); ++i)
|
for (int i = 0; i < int(CustomColorCount); ++i)
|
||||||
settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]);
|
settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), customRgb[i]);
|
||||||
|
@ -1676,7 +1676,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
|
|||||||
|
|
||||||
QOpenGL2PaintEngineState *s = q->state();
|
QOpenGL2PaintEngineState *s = q->state();
|
||||||
|
|
||||||
void *cacheKey = ctx->shareGroup();
|
void *cacheKey = ctx; // use context, not the shareGroup() -> the GL glyph cache uses FBOs which may not be shareable
|
||||||
bool recreateVertexArrays = false;
|
bool recreateVertexArrays = false;
|
||||||
|
|
||||||
QTransform glyphCacheTransform;
|
QTransform glyphCacheTransform;
|
||||||
|
@ -135,6 +135,8 @@ NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize)
|
|||||||
availableSizes << QSize(defaultSize, defaultSize);
|
availableSizes << QSize(defaultSize, defaultSize);
|
||||||
foreach (QSize size, availableSizes) {
|
foreach (QSize size, availableSizes) {
|
||||||
QPixmap pm = icon.pixmap(size);
|
QPixmap pm = icon.pixmap(size);
|
||||||
|
if (pm.isNull())
|
||||||
|
continue;
|
||||||
QImage image = pm.toImage();
|
QImage image = pm.toImage();
|
||||||
CGImageRef cgImage = qt_mac_toCGImage(image);
|
CGImageRef cgImage = qt_mac_toCGImage(image);
|
||||||
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];
|
||||||
|
@ -6105,18 +6105,10 @@ void qt_memfill16(quint16 *dest, quint16 color, int count)
|
|||||||
qt_memfill_template<quint16>(dest, color, count);
|
qt_memfill_template<quint16>(dest, color, count);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if !defined(__SSE2__) && !defined(__ARM_NEON__)
|
#if !defined(__SSE2__) && !defined(__ARM_NEON__) && !defined(__mips_dsp)
|
||||||
# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP
|
|
||||||
extern "C" void qt_memfill32_asm_mips_dsp(quint32 *, quint32, int);
|
|
||||||
# endif
|
|
||||||
|
|
||||||
void qt_memfill32(quint32 *dest, quint32 color, int count)
|
void qt_memfill32(quint32 *dest, quint32 color, int count)
|
||||||
{
|
{
|
||||||
# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP
|
|
||||||
qt_memfill32_asm_mips_dsp(dest, color, count);
|
|
||||||
# else
|
|
||||||
qt_memfill_template<quint32>(dest, color, count);
|
qt_memfill_template<quint32>(dest, color, count);
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -6308,10 +6300,6 @@ static void qInitDrawhelperFunctions()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_PROCESSOR_MIPS_32) && defined(QT_COMPILER_SUPPORTS_MIPS_DSP)
|
|
||||||
qt_memfill32 = qt_memfill32_asm_mips_dsp;
|
|
||||||
#endif // Q_PROCESSOR_MIPS_32
|
|
||||||
|
|
||||||
#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
|
#if defined(QT_COMPILER_SUPPORTS_MIPS_DSP) || defined(QT_COMPILER_SUPPORTS_MIPS_DSPR2)
|
||||||
if (qCpuHasFeature(DSP) && qCpuHasFeature(DSPR2)) {
|
if (qCpuHasFeature(DSP) && qCpuHasFeature(DSPR2)) {
|
||||||
// Composition functions are all DSP r1
|
// Composition functions are all DSP r1
|
||||||
|
@ -43,6 +43,11 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
void qt_memfill32(quint32 *dest, quint32 color, int count)
|
||||||
|
{
|
||||||
|
qt_memfill32_asm_mips_dsp(dest, color, count);
|
||||||
|
}
|
||||||
|
|
||||||
void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
|
void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl,
|
||||||
const uchar *srcPixels, int sbpl,
|
const uchar *srcPixels, int sbpl,
|
||||||
int w, int h,
|
int w, int h,
|
||||||
|
@ -5,27 +5,33 @@
|
|||||||
**
|
**
|
||||||
** This file is part of the QtGui module of the Qt Toolkit.
|
** This file is part of the QtGui module of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL21$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
** accordance with the commercial license agreement provided with the
|
** accordance with the commercial license agreement provided with the
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
** and conditions see http://www.qt.io/terms-conditions. For further
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
** information use the contact form at http://www.qt.io/contact-us.
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
**
|
**
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
** General Public License version 3 as published by the Free Software
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
** packaging of this file. Please review the following information to
|
||||||
** following information to ensure the GNU Lesser General Public License
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
**
|
||||||
** As a special exception, The Qt Company gives you certain additional
|
** GNU General Public License Usage
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
**
|
**
|
||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
@ -56,9 +62,9 @@ bool QInputControl::isAcceptableInput(const QKeyEvent *event) const
|
|||||||
|
|
||||||
const QChar c = text.at(0);
|
const QChar c = text.at(0);
|
||||||
|
|
||||||
// ZWNJ and ZWJ. This needs to go before the next test, since CTRL+SHIFT is
|
// Formatting characters such as ZWNJ, ZWJ, RLM, etc. This needs to go before the
|
||||||
// used to input it on Windows.
|
// next test, since CTRL+SHIFT is sometimes used to input it on Windows.
|
||||||
if (c == QChar(0x200C) || c == QChar(0x200D))
|
if (c.category() == QChar::Other_Format)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
|
// QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
|
||||||
|
@ -5,27 +5,33 @@
|
|||||||
**
|
**
|
||||||
** This file is part of the QtGui module of the Qt Toolkit.
|
** This file is part of the QtGui module of the Qt Toolkit.
|
||||||
**
|
**
|
||||||
** $QT_BEGIN_LICENSE:LGPL21$
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
** Commercial License Usage
|
** Commercial License Usage
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
** accordance with the commercial license agreement provided with the
|
** accordance with the commercial license agreement provided with the
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
** and conditions see http://www.qt.io/terms-conditions. For further
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
** information use the contact form at http://www.qt.io/contact-us.
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
**
|
**
|
||||||
** GNU Lesser General Public License Usage
|
** GNU Lesser General Public License Usage
|
||||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||||
** General Public License version 2.1 or version 3 as published by the Free
|
** General Public License version 3 as published by the Free Software
|
||||||
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||||
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
** packaging of this file. Please review the following information to
|
||||||
** following information to ensure the GNU Lesser General Public License
|
** ensure the GNU Lesser General Public License version 3 requirements
|
||||||
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
**
|
||||||
** As a special exception, The Qt Company gives you certain additional
|
** GNU General Public License Usage
|
||||||
** rights. These rights are described in The Qt Company LGPL Exception
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
** General Public License version 2.0 or (at your option) the GNU General
|
||||||
|
** Public license version 3 or any later version approved by the KDE Free
|
||||||
|
** Qt Foundation. The licenses are as published by the Free Software
|
||||||
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||||
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
**
|
**
|
||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
|
@ -189,12 +189,19 @@ struct PACInfo {
|
|||||||
|
|
||||||
void proxyAutoConfigCallback(void *client, CFArrayRef proxylist, CFErrorRef error)
|
void proxyAutoConfigCallback(void *client, CFArrayRef proxylist, CFErrorRef error)
|
||||||
{
|
{
|
||||||
PACInfo *info = reinterpret_cast<PACInfo *>(reinterpret_cast<CFStreamClientContext *>(client)->info);
|
Q_ASSERT(client);
|
||||||
|
|
||||||
|
PACInfo *info = static_cast<PACInfo *>(client);
|
||||||
info->done = true;
|
info->done = true;
|
||||||
if (proxylist)
|
|
||||||
|
if (error) {
|
||||||
|
CFRetain(error);
|
||||||
|
info->error = error;
|
||||||
|
}
|
||||||
|
if (proxylist) {
|
||||||
CFRetain(proxylist);
|
CFRetain(proxylist);
|
||||||
info->proxies = proxylist;
|
info->proxies = proxylist;
|
||||||
info->error = error;
|
}
|
||||||
}
|
}
|
||||||
} // anon namespace
|
} // anon namespace
|
||||||
|
|
||||||
|
@ -1186,7 +1186,7 @@ void QWindowsFontDatabase::populateFontDatabase()
|
|||||||
ReleaseDC(0, dummy);
|
ReleaseDC(0, dummy);
|
||||||
// Work around EnumFontFamiliesEx() not listing the system font.
|
// Work around EnumFontFamiliesEx() not listing the system font.
|
||||||
QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family();
|
QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family();
|
||||||
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily).isEmpty())
|
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily) == systemDefaultFamily)
|
||||||
QPlatformFontDatabase::registerFontFamily(systemDefaultFamily);
|
QPlatformFontDatabase::registerFontFamily(systemDefaultFamily);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ void QWindowsFontDatabaseFT::populateFontDatabase()
|
|||||||
ReleaseDC(0, dummy);
|
ReleaseDC(0, dummy);
|
||||||
// Work around EnumFontFamiliesEx() not listing the system font
|
// Work around EnumFontFamiliesEx() not listing the system font
|
||||||
QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family();
|
QString systemDefaultFamily = QWindowsFontDatabase::systemDefaultFont().family();
|
||||||
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily).isEmpty())
|
if (QPlatformFontDatabase::resolveFontFamilyAlias(systemDefaultFamily) == systemDefaultFamily)
|
||||||
QPlatformFontDatabase::registerFontFamily(systemDefaultFamily);
|
QPlatformFontDatabase::registerFontFamily(systemDefaultFamily);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,10 +210,10 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
|
|||||||
if (!engine || state != QNetworkSession::Connected || !publicConfig.isValid())
|
if (!engine || state != QNetworkSession::Connected || !publicConfig.isValid())
|
||||||
return QNetworkInterface();
|
return QNetworkInterface();
|
||||||
|
|
||||||
QString interface = engine->getInterfaceFromId(activeConfig.identifier());
|
QString iface = engine->getInterfaceFromId(activeConfig.identifier());
|
||||||
if (interface.isEmpty())
|
if (iface.isEmpty())
|
||||||
return QNetworkInterface();
|
return QNetworkInterface();
|
||||||
return QNetworkInterface::interfaceFromName(interface);
|
return QNetworkInterface::interfaceFromName(iface);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -194,8 +194,11 @@ static QVector<QComposeTableElement> loadCache(const QComposeCacheFileHeader &co
|
|||||||
static bool saveCache(const QComposeCacheFileHeader &info, const QVector<QComposeTableElement> &vec)
|
static bool saveCache(const QComposeCacheFileHeader &info, const QVector<QComposeTableElement> &vec)
|
||||||
{
|
{
|
||||||
const QString filePath = getCacheFilePath();
|
const QString filePath = getCacheFilePath();
|
||||||
|
#if QT_CONFIG(temporaryfile)
|
||||||
QSaveFile outputFile(filePath);
|
QSaveFile outputFile(filePath);
|
||||||
|
#else
|
||||||
|
QFile outputFile(filePath);
|
||||||
|
#endif
|
||||||
if (!outputFile.open(QIODevice::WriteOnly))
|
if (!outputFile.open(QIODevice::WriteOnly))
|
||||||
return false;
|
return false;
|
||||||
const char *data = reinterpret_cast<const char*>(&info);
|
const char *data = reinterpret_cast<const char*>(&info);
|
||||||
@ -207,7 +210,11 @@ static bool saveCache(const QComposeCacheFileHeader &info, const QVector<QCompos
|
|||||||
|
|
||||||
if (outputFile.write(data, size) != size)
|
if (outputFile.write(data, size) != size)
|
||||||
return false;
|
return false;
|
||||||
|
#if QT_CONFIG(temporaryfile)
|
||||||
return outputFile.commit();
|
return outputFile.commit();
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TableGenerator::TableGenerator() : m_state(NoErrors),
|
TableGenerator::TableGenerator() : m_state(NoErrors),
|
||||||
|
@ -279,16 +279,8 @@ NSRect qt_mac_flipRect(const QRect &rect)
|
|||||||
|
|
||||||
Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)
|
Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)
|
||||||
{
|
{
|
||||||
if (buttonNum == 0)
|
if (buttonNum >= 0 && buttonNum <= 31)
|
||||||
return Qt::LeftButton;
|
return Qt::MouseButton(1 << buttonNum);
|
||||||
if (buttonNum == 1)
|
|
||||||
return Qt::RightButton;
|
|
||||||
if (buttonNum == 2)
|
|
||||||
return Qt::MiddleButton;
|
|
||||||
if (buttonNum >= 3 && buttonNum <= 31) { // handle XButton1 and higher via logical shift
|
|
||||||
return Qt::MouseButton(uint(Qt::MiddleButton) << (buttonNum - 3));
|
|
||||||
}
|
|
||||||
// else error: buttonNum too high, or negative
|
|
||||||
return Qt::NoButton;
|
return Qt::NoButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ QDpi QEglFSDeviceIntegration::logicalDpi() const
|
|||||||
|
|
||||||
qreal QEglFSDeviceIntegration::pixelDensity() const
|
qreal QEglFSDeviceIntegration::pixelDensity() const
|
||||||
{
|
{
|
||||||
return qRound(logicalDpi().first / qreal(100));
|
return qMax(1, qRound(logicalDpi().first / qreal(100)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ScreenOrientation QEglFSDeviceIntegration::nativeOrientation() const
|
Qt::ScreenOrientation QEglFSDeviceIntegration::nativeOrientation() const
|
||||||
|
@ -510,11 +510,6 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
|
|||||||
return QVariant(keyBoardAutoRepeatRateMS());
|
return QVariant(keyBoardAutoRepeatRateMS());
|
||||||
#endif
|
#endif
|
||||||
case QPlatformIntegration::ShowIsMaximized:
|
case QPlatformIntegration::ShowIsMaximized:
|
||||||
#ifndef QT_NO_CLIPBOARD
|
|
||||||
return qt_windowsIsTabletMode(d->m_clipboard.clipboardViewer());
|
|
||||||
#else
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case QPlatformIntegration::StartDragTime:
|
case QPlatformIntegration::StartDragTime:
|
||||||
case QPlatformIntegration::StartDragDistance:
|
case QPlatformIntegration::StartDragDistance:
|
||||||
case QPlatformIntegration::KeyboardInputInterval:
|
case QPlatformIntegration::KeyboardInputInterval:
|
||||||
|
@ -258,7 +258,7 @@ qreal QWindowsScreen::pixelDensity() const
|
|||||||
// the pixel density since it is reflects the Windows UI scaling.
|
// the pixel density since it is reflects the Windows UI scaling.
|
||||||
// High DPI auto scaling should be disabled when the user chooses
|
// High DPI auto scaling should be disabled when the user chooses
|
||||||
// small fonts on a High DPI monitor, resulting in lower logical DPI.
|
// small fonts on a High DPI monitor, resulting in lower logical DPI.
|
||||||
return qRound(logicalDpi().first / 96);
|
return qMax(1, qRound(logicalDpi().first / 96));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -647,7 +647,7 @@ QDpi QWinRTScreen::logicalDpi() const
|
|||||||
qreal QWinRTScreen::pixelDensity() const
|
qreal QWinRTScreen::pixelDensity() const
|
||||||
{
|
{
|
||||||
Q_D(const QWinRTScreen);
|
Q_D(const QWinRTScreen);
|
||||||
return qRound(d->logicalDpi / 96);
|
return qMax(1, qRound(d->logicalDpi / 96));
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QWinRTScreen::scaleFactor() const
|
qreal QWinRTScreen::scaleFactor() const
|
||||||
|
@ -620,7 +620,7 @@ void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
|
|||||||
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
|
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
|
||||||
|
|
||||||
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
|
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
|
||||||
m_pixelDensity = qRound(dpi/96);
|
m_pixelDensity = qMax(1, qRound(dpi/96));
|
||||||
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
|
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
|
||||||
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
|
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
|
||||||
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
|
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
|
||||||
@ -667,85 +667,88 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap QXcbScreen::grabWindow(WId window, int x, int y, int width, int height) const
|
static xcb_get_geometry_reply_t *getGeometryUnchecked(xcb_connection_t *connection, xcb_window_t window)
|
||||||
|
{
|
||||||
|
const xcb_get_geometry_cookie_t geometry_cookie = xcb_get_geometry_unchecked(connection, window);
|
||||||
|
return xcb_get_geometry_reply(connection, geometry_cookie, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent,
|
||||||
|
int *x, int *y)
|
||||||
|
{
|
||||||
|
const xcb_translate_coordinates_cookie_t translate_cookie =
|
||||||
|
xcb_translate_coordinates_unchecked(connection, child, parent, *x, *y);
|
||||||
|
xcb_translate_coordinates_reply_t *translate_reply =
|
||||||
|
xcb_translate_coordinates_reply(connection, translate_cookie, NULL);
|
||||||
|
if (!translate_reply)
|
||||||
|
return false;
|
||||||
|
*x = translate_reply->dst_x;
|
||||||
|
*y = translate_reply->dst_y;
|
||||||
|
free(translate_reply);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPixmap QXcbScreen::grabWindow(WId window, int xIn, int yIn, int width, int height) const
|
||||||
{
|
{
|
||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
// TODO: handle multiple screens
|
int x = xIn;
|
||||||
|
int y = yIn;
|
||||||
QXcbScreen *screen = const_cast<QXcbScreen *>(this);
|
QXcbScreen *screen = const_cast<QXcbScreen *>(this);
|
||||||
xcb_window_t root = screen->root();
|
xcb_window_t root = screen->root();
|
||||||
|
|
||||||
if (window == 0)
|
xcb_get_geometry_reply_t *rootReply = getGeometryUnchecked(xcb_connection(), root);
|
||||||
window = root;
|
if (!rootReply)
|
||||||
|
|
||||||
xcb_get_geometry_cookie_t geometry_cookie = xcb_get_geometry_unchecked(xcb_connection(), window);
|
|
||||||
|
|
||||||
xcb_get_geometry_reply_t *reply =
|
|
||||||
xcb_get_geometry_reply(xcb_connection(), geometry_cookie, NULL);
|
|
||||||
|
|
||||||
if (!reply) {
|
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
|
const quint8 rootDepth = rootReply->depth;
|
||||||
|
free(rootReply);
|
||||||
|
|
||||||
|
QSize windowSize;
|
||||||
|
quint8 effectiveDepth = 0;
|
||||||
|
if (window) {
|
||||||
|
xcb_get_geometry_reply_t *windowReply = getGeometryUnchecked(xcb_connection(), window);
|
||||||
|
if (!windowReply)
|
||||||
|
return QPixmap();
|
||||||
|
windowSize = QSize(windowReply->width, windowReply->height);
|
||||||
|
effectiveDepth = windowReply->depth;
|
||||||
|
free(windowReply);
|
||||||
|
if (effectiveDepth == rootDepth) {
|
||||||
|
// if the depth of the specified window and the root window are the
|
||||||
|
// same, grab pixels from the root window (so that we get the any
|
||||||
|
// overlapping windows and window manager frames)
|
||||||
|
|
||||||
|
// map x and y to the root window
|
||||||
|
if (!translate(xcb_connection(), window, root, &x, &y))
|
||||||
|
return QPixmap();
|
||||||
|
|
||||||
|
window = root;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window = root;
|
||||||
|
effectiveDepth = rootDepth;
|
||||||
|
windowSize = m_geometry.size();
|
||||||
|
x += m_geometry.x();
|
||||||
|
y += m_geometry.y();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width < 0)
|
if (width < 0)
|
||||||
width = reply->width - x;
|
width = windowSize.width() - xIn;
|
||||||
if (height < 0)
|
if (height < 0)
|
||||||
height = reply->height - y;
|
height = windowSize.height() - yIn;
|
||||||
|
|
||||||
geometry_cookie = xcb_get_geometry_unchecked(xcb_connection(), root);
|
|
||||||
xcb_get_geometry_reply_t *root_reply =
|
|
||||||
xcb_get_geometry_reply(xcb_connection(), geometry_cookie, NULL);
|
|
||||||
|
|
||||||
if (!root_reply) {
|
|
||||||
free(reply);
|
|
||||||
return QPixmap();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reply->depth == root_reply->depth) {
|
|
||||||
// if the depth of the specified window and the root window are the
|
|
||||||
// same, grab pixels from the root window (so that we get the any
|
|
||||||
// overlapping windows and window manager frames)
|
|
||||||
|
|
||||||
// map x and y to the root window
|
|
||||||
xcb_translate_coordinates_cookie_t translate_cookie =
|
|
||||||
xcb_translate_coordinates_unchecked(xcb_connection(), window, root, x, y);
|
|
||||||
|
|
||||||
xcb_translate_coordinates_reply_t *translate_reply =
|
|
||||||
xcb_translate_coordinates_reply(xcb_connection(), translate_cookie, NULL);
|
|
||||||
|
|
||||||
if (!translate_reply) {
|
|
||||||
free(reply);
|
|
||||||
free(root_reply);
|
|
||||||
return QPixmap();
|
|
||||||
}
|
|
||||||
|
|
||||||
x = translate_reply->dst_x;
|
|
||||||
y = translate_reply->dst_y;
|
|
||||||
|
|
||||||
window = root;
|
|
||||||
|
|
||||||
free(translate_reply);
|
|
||||||
free(reply);
|
|
||||||
reply = root_reply;
|
|
||||||
} else {
|
|
||||||
free(root_reply);
|
|
||||||
root_reply = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
xcb_get_window_attributes_reply_t *attributes_reply =
|
xcb_get_window_attributes_reply_t *attributes_reply =
|
||||||
xcb_get_window_attributes_reply(xcb_connection(), xcb_get_window_attributes_unchecked(xcb_connection(), window), NULL);
|
xcb_get_window_attributes_reply(xcb_connection(), xcb_get_window_attributes_unchecked(xcb_connection(), window), NULL);
|
||||||
|
|
||||||
if (!attributes_reply) {
|
if (!attributes_reply)
|
||||||
free(reply);
|
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
}
|
|
||||||
|
|
||||||
const xcb_visualtype_t *visual = screen->visualForId(attributes_reply->visual);
|
const xcb_visualtype_t *visual = screen->visualForId(attributes_reply->visual);
|
||||||
free(attributes_reply);
|
free(attributes_reply);
|
||||||
|
|
||||||
xcb_pixmap_t pixmap = xcb_generate_id(xcb_connection());
|
xcb_pixmap_t pixmap = xcb_generate_id(xcb_connection());
|
||||||
xcb_create_pixmap(xcb_connection(), reply->depth, pixmap, window, width, height);
|
xcb_create_pixmap(xcb_connection(), effectiveDepth, pixmap, window, width, height);
|
||||||
|
|
||||||
uint32_t gc_value_mask = XCB_GC_SUBWINDOW_MODE;
|
uint32_t gc_value_mask = XCB_GC_SUBWINDOW_MODE;
|
||||||
uint32_t gc_value_list[] = { XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS };
|
uint32_t gc_value_list[] = { XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS };
|
||||||
@ -755,9 +758,7 @@ QPixmap QXcbScreen::grabWindow(WId window, int x, int y, int width, int height)
|
|||||||
|
|
||||||
xcb_copy_area(xcb_connection(), window, pixmap, gc, x, y, 0, 0, width, height);
|
xcb_copy_area(xcb_connection(), window, pixmap, gc, x, y, 0, 0, width, height);
|
||||||
|
|
||||||
QPixmap result = qt_xcb_pixmapFromXPixmap(connection(), pixmap, width, height, reply->depth, visual);
|
QPixmap result = qt_xcb_pixmapFromXPixmap(connection(), pixmap, width, height, effectiveDepth, visual);
|
||||||
|
|
||||||
free(reply);
|
|
||||||
xcb_free_gc(xcb_connection(), gc);
|
xcb_free_gc(xcb_connection(), gc);
|
||||||
xcb_free_pixmap(xcb_connection(), pixmap);
|
xcb_free_pixmap(xcb_connection(), pixmap);
|
||||||
|
|
||||||
|
@ -28,7 +28,13 @@
|
|||||||
"label": "CUPS",
|
"label": "CUPS",
|
||||||
"purpose": "Provides support for the Common Unix Printing System.",
|
"purpose": "Provides support for the Common Unix Printing System.",
|
||||||
"section": "Painting",
|
"section": "Painting",
|
||||||
"condition": "libs.cups",
|
"condition": "libs.cups && features.printer",
|
||||||
|
"output": [ "privateFeature", "feature" ]
|
||||||
|
},
|
||||||
|
"cupsjobwidget": {
|
||||||
|
"label": "CUPS job control widget",
|
||||||
|
"section": "Widgets",
|
||||||
|
"condition": "features.cups && features.calendarwidget && features.datetimeedit && features.groupbox && features.combobox",
|
||||||
"output": [ "privateFeature", "feature" ]
|
"output": [ "privateFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"printer": {
|
"printer": {
|
||||||
@ -49,7 +55,7 @@
|
|||||||
"label": "QPrintDialog",
|
"label": "QPrintDialog",
|
||||||
"purpose": "Provides a dialog widget for specifying printer configuration.",
|
"purpose": "Provides a dialog widget for specifying printer configuration.",
|
||||||
"section": "Dialogs",
|
"section": "Dialogs",
|
||||||
"condition": "features.printer && features.combobox && features.buttongroup && features.spinbox && features.treeview && features.tabwidget",
|
"condition": "features.printer && features.combobox && features.buttongroup && features.spinbox && features.treeview && features.tabwidget && features.datetimeedit",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"printpreviewdialog": {
|
"printpreviewdialog": {
|
||||||
|
@ -302,7 +302,11 @@ QPrint::InputSlot QPlatformPrintDevice::defaultInputSlot() const
|
|||||||
{
|
{
|
||||||
QPrint::InputSlot input;
|
QPrint::InputSlot input;
|
||||||
input.key = QByteArrayLiteral("Auto");
|
input.key = QByteArrayLiteral("Auto");
|
||||||
|
#if QT_CONFIG(printdialog)
|
||||||
input.name = QPrintDialog::tr("Automatic");
|
input.name = QPrintDialog::tr("Automatic");
|
||||||
|
#else
|
||||||
|
input.name = QString::fromLatin1("Automatic");
|
||||||
|
#endif
|
||||||
input.id = QPrint::Auto;
|
input.id = QPrint::Auto;
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
@ -322,7 +326,11 @@ QPrint::OutputBin QPlatformPrintDevice::defaultOutputBin() const
|
|||||||
{
|
{
|
||||||
QPrint::OutputBin output;
|
QPrint::OutputBin output;
|
||||||
output.key = QByteArrayLiteral("Auto");
|
output.key = QByteArrayLiteral("Auto");
|
||||||
|
#if QT_CONFIG(printdialog)
|
||||||
output.name = QPrintDialog::tr("Automatic");
|
output.name = QPrintDialog::tr("Automatic");
|
||||||
|
#else
|
||||||
|
output.name = QString::fromLatin1("Automatic");
|
||||||
|
#endif
|
||||||
output.id = QPrint::AutoOutputBin;
|
output.id = QPrint::AutoOutputBin;
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
|
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
|
||||||
#include <private/qcups_p.h>
|
#include <private/qcups_p.h>
|
||||||
|
|
||||||
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
|
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS) && !defined(QT_NO_DATETIMEEDIT)
|
||||||
#include <ui_qcupsjobwidget.h>
|
#include <ui_qcupsjobwidget.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
HEADERS += widgets/qprintpreviewwidget.h
|
HEADERS += widgets/qprintpreviewwidget.h
|
||||||
SOURCES += widgets/qprintpreviewwidget.cpp
|
SOURCES += widgets/qprintpreviewwidget.cpp
|
||||||
|
|
||||||
unix:!darwin:qtConfig(cups) {
|
unix:!darwin:qtConfig(cups):qtConfig(cupsjobwidget) {
|
||||||
HEADERS += widgets/qcupsjobwidget_p.h
|
HEADERS += widgets/qcupsjobwidget_p.h
|
||||||
SOURCES += widgets/qcupsjobwidget.cpp
|
SOURCES += widgets/qcupsjobwidget.cpp
|
||||||
FORMS += widgets/qcupsjobwidget.ui
|
FORMS += widgets/qcupsjobwidget.ui
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD
|
||||||
|
@ -1953,6 +1953,7 @@ static inline bool isWindowsBuildDirectory(const QString &dirName)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if QT_CONFIG(temporaryfile)
|
||||||
/*!
|
/*!
|
||||||
Extracts a directory from resources to disk. The content is extracted
|
Extracts a directory from resources to disk. The content is extracted
|
||||||
recursively to a temporary folder. The extracted content is removed
|
recursively to a temporary folder. The extracted content is removed
|
||||||
@ -2013,6 +2014,7 @@ QSharedPointer<QTemporaryDir> QTest::qExtractTestData(const QString &dirName)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(temporaryfile)
|
||||||
|
|
||||||
/*! \internal
|
/*! \internal
|
||||||
*/
|
*/
|
||||||
|
@ -283,7 +283,9 @@ namespace QTest
|
|||||||
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
|
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if QT_CONFIG(temporaryfile)
|
||||||
Q_TESTLIB_EXPORT QSharedPointer<QTemporaryDir> qExtractTestData(const QString &dirName);
|
Q_TESTLIB_EXPORT QSharedPointer<QTemporaryDir> qExtractTestData(const QString &dirName);
|
||||||
|
#endif
|
||||||
Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
|
Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
|
||||||
Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
|
Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <QtTest/qtestcase.h>
|
#include <QtTest/qtestcase.h>
|
||||||
#include <QtCore/qcoreapplication.h>
|
#include <QtCore/qcoreapplication.h>
|
||||||
#include <QtCore/qelapsedtimer.h>
|
#include <QtCore/qdeadlinetimer.h>
|
||||||
#ifdef QT_GUI_LIB
|
#ifdef QT_GUI_LIB
|
||||||
# include <QtGui/QWindow>
|
# include <QtGui/QWindow>
|
||||||
#endif
|
#endif
|
||||||
@ -58,27 +58,29 @@ namespace QTest
|
|||||||
{
|
{
|
||||||
Q_ASSERT(QCoreApplication::instance());
|
Q_ASSERT(QCoreApplication::instance());
|
||||||
|
|
||||||
QElapsedTimer timer;
|
QDeadlineTimer timer(ms);
|
||||||
timer.start();
|
int remaining = ms;
|
||||||
do {
|
do {
|
||||||
QCoreApplication::processEvents(QEventLoop::AllEvents, ms);
|
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
||||||
QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
|
||||||
QTest::qSleep(10);
|
remaining = timer.remainingTime();
|
||||||
} while (timer.elapsed() < ms);
|
if (remaining <= 0)
|
||||||
|
break;
|
||||||
|
QTest::qSleep(qMin(10, remaining));
|
||||||
|
remaining = timer.remainingTime();
|
||||||
|
} while (remaining > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_GUI_LIB
|
#ifdef QT_GUI_LIB
|
||||||
inline static bool qWaitForWindowActive(QWindow *window, int timeout = 5000)
|
inline static bool qWaitForWindowActive(QWindow *window, int timeout = 5000)
|
||||||
{
|
{
|
||||||
QElapsedTimer timer;
|
QDeadlineTimer timer(timeout);
|
||||||
timer.start();
|
int remaining = timeout;
|
||||||
while (!window->isActive()) {
|
while (!window->isActive() && remaining > 0) {
|
||||||
int remaining = timeout - int(timer.elapsed());
|
|
||||||
if (remaining <= 0)
|
|
||||||
break;
|
|
||||||
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
||||||
QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
|
||||||
QTest::qSleep(10);
|
QTest::qSleep(10);
|
||||||
|
remaining = timer.remainingTime();
|
||||||
}
|
}
|
||||||
// Try ensuring the platform window receives the real position.
|
// Try ensuring the platform window receives the real position.
|
||||||
// (i.e. that window->pos() reflects reality)
|
// (i.e. that window->pos() reflects reality)
|
||||||
@ -99,15 +101,13 @@ namespace QTest
|
|||||||
|
|
||||||
inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 5000)
|
inline static bool qWaitForWindowExposed(QWindow *window, int timeout = 5000)
|
||||||
{
|
{
|
||||||
QElapsedTimer timer;
|
QDeadlineTimer timer(timeout);
|
||||||
timer.start();
|
int remaining = timeout;
|
||||||
while (!window->isExposed()) {
|
while (!window->isExposed() && remaining > 0) {
|
||||||
int remaining = timeout - int(timer.elapsed());
|
|
||||||
if (remaining <= 0)
|
|
||||||
break;
|
|
||||||
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
|
||||||
QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
|
QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
|
||||||
QTest::qSleep(10);
|
QTest::qSleep(10);
|
||||||
|
remaining = timer.remainingTime();
|
||||||
}
|
}
|
||||||
return window->isExposed();
|
return window->isExposed();
|
||||||
}
|
}
|
||||||
|
@ -130,12 +130,16 @@ public:
|
|||||||
case QAccessible::Accelerator:
|
case QAccessible::Accelerator:
|
||||||
str = qt_accHotKey(m_parent->tabText(m_index));
|
str = qt_accHotKey(m_parent->tabText(m_index));
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
case QAccessible::Description:
|
case QAccessible::Description:
|
||||||
str = m_parent->tabToolTip(m_index);
|
str = m_parent->tabToolTip(m_index);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(whatsthis)
|
||||||
case QAccessible::Help:
|
case QAccessible::Help:
|
||||||
str = m_parent->tabWhatsThis(m_index);
|
str = m_parent->tabWhatsThis(m_index);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,11 @@ QAccessibleInterface *QAccessibleMenu::parent() const
|
|||||||
parentCandidates << menu()->parentWidget();
|
parentCandidates << menu()->parentWidget();
|
||||||
parentCandidates << menuAction->associatedWidgets();
|
parentCandidates << menuAction->associatedWidgets();
|
||||||
foreach (QWidget *w, parentCandidates) {
|
foreach (QWidget *w, parentCandidates) {
|
||||||
if (qobject_cast<QMenu*>(w) || qobject_cast<QMenuBar*>(w)) {
|
if (qobject_cast<QMenu*>(w)
|
||||||
|
#if QT_CONFIG(menubar)
|
||||||
|
|| qobject_cast<QMenuBar*>(w)
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
if (w->actions().indexOf(menuAction) != -1)
|
if (w->actions().indexOf(menuAction) != -1)
|
||||||
return getOrCreateMenu(w, menuAction);
|
return getOrCreateMenu(w, menuAction);
|
||||||
}
|
}
|
||||||
@ -348,13 +352,16 @@ void QAccessibleMenuItem::doAction(const QString &actionName)
|
|||||||
if (actionName == pressAction()) {
|
if (actionName == pressAction()) {
|
||||||
m_action->trigger();
|
m_action->trigger();
|
||||||
} else if (actionName == showMenuAction()) {
|
} else if (actionName == showMenuAction()) {
|
||||||
|
#if QT_CONFIG(menubar)
|
||||||
if (QMenuBar *bar = qobject_cast<QMenuBar*>(owner())) {
|
if (QMenuBar *bar = qobject_cast<QMenuBar*>(owner())) {
|
||||||
if (m_action->menu() && m_action->menu()->isVisible()) {
|
if (m_action->menu() && m_action->menu()->isVisible()) {
|
||||||
m_action->menu()->hide();
|
m_action->menu()->hide();
|
||||||
} else {
|
} else {
|
||||||
bar->setActiveAction(m_action);
|
bar->setActiveAction(m_action);
|
||||||
}
|
}
|
||||||
} else if (QMenu *menu = qobject_cast<QMenu*>(owner())){
|
} else
|
||||||
|
#endif
|
||||||
|
if (QMenu *menu = qobject_cast<QMenu*>(owner())){
|
||||||
if (m_action->menu() && m_action->menu()->isVisible()) {
|
if (m_action->menu() && m_action->menu()->isVisible()) {
|
||||||
m_action->menu()->hide();
|
m_action->menu()->hide();
|
||||||
} else {
|
} else {
|
||||||
|
@ -94,9 +94,9 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
|
|||||||
} else if (classname == QLatin1String("QScrollBar")) {
|
} else if (classname == QLatin1String("QScrollBar")) {
|
||||||
iface = new QAccessibleScrollBar(widget);
|
iface = new QAccessibleScrollBar(widget);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef QT_NO_SLIDER
|
||||||
} else if (classname == QLatin1String("QAbstractSlider")) {
|
} else if (classname == QLatin1String("QAbstractSlider")) {
|
||||||
iface = new QAccessibleAbstractSlider(widget);
|
iface = new QAccessibleAbstractSlider(widget);
|
||||||
#ifndef QT_NO_SLIDER
|
|
||||||
} else if (classname == QLatin1String("QSlider")) {
|
} else if (classname == QLatin1String("QSlider")) {
|
||||||
iface = new QAccessibleSlider(widget);
|
iface = new QAccessibleSlider(widget);
|
||||||
#endif
|
#endif
|
||||||
|
@ -85,7 +85,9 @@ QList<QWidget*> childWidgets(const QWidget *widget)
|
|||||||
QString objectName = w->objectName();
|
QString objectName = w->objectName();
|
||||||
if (!w->isWindow()
|
if (!w->isWindow()
|
||||||
&& !qobject_cast<QFocusFrame*>(w)
|
&& !qobject_cast<QFocusFrame*>(w)
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
&& !qobject_cast<QMenu*>(w)
|
&& !qobject_cast<QMenu*>(w)
|
||||||
|
#endif
|
||||||
&& objectName != QLatin1String("qt_rubberband")
|
&& objectName != QLatin1String("qt_rubberband")
|
||||||
&& objectName != QLatin1String("qt_qmainwindow_extended_splitter")) {
|
&& objectName != QLatin1String("qt_qmainwindow_extended_splitter")) {
|
||||||
widgets.append(w);
|
widgets.append(w);
|
||||||
|
@ -81,10 +81,14 @@ QAbstractSpinBox *QAccessibleAbstractSpinBox::abstractSpinBox() const
|
|||||||
|
|
||||||
QAccessibleInterface *QAccessibleAbstractSpinBox::lineEditIface() const
|
QAccessibleInterface *QAccessibleAbstractSpinBox::lineEditIface() const
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(lineedit)
|
||||||
// QAccessibleLineEdit is only used to forward the text functions
|
// QAccessibleLineEdit is only used to forward the text functions
|
||||||
if (!lineEdit)
|
if (!lineEdit)
|
||||||
lineEdit = new QAccessibleLineEdit(abstractSpinBox()->lineEdit());
|
lineEdit = new QAccessibleLineEdit(abstractSpinBox()->lineEdit());
|
||||||
return lineEdit;
|
return lineEdit;
|
||||||
|
#else
|
||||||
|
return nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QAccessibleAbstractSpinBox::text(QAccessible::Text t) const
|
QString QAccessibleAbstractSpinBox::text(QAccessible::Text t) const
|
||||||
|
@ -143,6 +143,7 @@ protected:
|
|||||||
};
|
};
|
||||||
#endif // QT_NO_SPINBOX
|
#endif // QT_NO_SPINBOX
|
||||||
|
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
|
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -159,6 +160,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
QAbstractSlider *abstractSlider() const;
|
QAbstractSlider *abstractSlider() const;
|
||||||
};
|
};
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
|
|
||||||
#ifndef QT_NO_SCROLLBAR
|
#ifndef QT_NO_SCROLLBAR
|
||||||
class QAccessibleScrollBar : public QAccessibleAbstractSlider
|
class QAccessibleScrollBar : public QAccessibleAbstractSlider
|
||||||
|
@ -339,10 +339,12 @@ QStringList QAccessibleToolButton::actionNames() const
|
|||||||
{
|
{
|
||||||
QStringList names;
|
QStringList names;
|
||||||
if (widget()->isEnabled()) {
|
if (widget()->isEnabled()) {
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
if (toolButton()->menu())
|
if (toolButton()->menu())
|
||||||
names << showMenuAction();
|
names << showMenuAction();
|
||||||
if (toolButton()->popupMode() != QToolButton::InstantPopup)
|
if (toolButton()->popupMode() != QToolButton::InstantPopup)
|
||||||
names << QAccessibleButton::actionNames();
|
names << QAccessibleButton::actionNames();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
@ -355,12 +357,12 @@ void QAccessibleToolButton::doAction(const QString &actionName)
|
|||||||
if (actionName == pressAction()) {
|
if (actionName == pressAction()) {
|
||||||
button()->click();
|
button()->click();
|
||||||
} else if (actionName == showMenuAction()) {
|
} else if (actionName == showMenuAction()) {
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
if (toolButton()->popupMode() != QToolButton::InstantPopup) {
|
if (toolButton()->popupMode() != QToolButton::InstantPopup) {
|
||||||
toolButton()->setDown(true);
|
toolButton()->setDown(true);
|
||||||
#ifndef QT_NO_MENU
|
|
||||||
toolButton()->showMenu();
|
toolButton()->showMenu();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
QAccessibleButton::doAction(actionName);
|
QAccessibleButton::doAction(actionName);
|
||||||
}
|
}
|
||||||
@ -542,9 +544,11 @@ QString QAccessibleGroupBox::text(QAccessible::Text t) const
|
|||||||
case QAccessible::Name:
|
case QAccessible::Name:
|
||||||
txt = qt_accStripAmp(groupBox()->title());
|
txt = qt_accStripAmp(groupBox()->title());
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
case QAccessible::Description:
|
case QAccessible::Description:
|
||||||
txt = groupBox()->toolTip();
|
txt = groupBox()->toolTip();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case QAccessible::Accelerator:
|
case QAccessible::Accelerator:
|
||||||
txt = qt_accHotKey(groupBox()->title());
|
txt = qt_accHotKey(groupBox()->title());
|
||||||
break;
|
break;
|
||||||
|
@ -173,7 +173,7 @@
|
|||||||
"label": "QSpinBox",
|
"label": "QSpinBox",
|
||||||
"purpose": "Provides spin boxes handling integers and discrete sets of values.",
|
"purpose": "Provides spin boxes handling integers and discrete sets of values.",
|
||||||
"section": "Widgets",
|
"section": "Widgets",
|
||||||
"condition": "features.spinwidget && features.lineedit && features.validator",
|
"condition": "features.lineedit && features.validator",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"tabbar": {
|
"tabbar": {
|
||||||
@ -332,12 +332,6 @@
|
|||||||
"condition": "features.graphicsview",
|
"condition": "features.graphicsview",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"spinbox": {
|
|
||||||
"label": "QSpinBox",
|
|
||||||
"purpose": "Provides spinbox control widgets.",
|
|
||||||
"section": "Widgets",
|
|
||||||
"output": [ "publicFeature", "feature" ]
|
|
||||||
},
|
|
||||||
"textedit": {
|
"textedit": {
|
||||||
"label": "QTextEdit",
|
"label": "QTextEdit",
|
||||||
"purpose": "Supports rich text editing.",
|
"purpose": "Supports rich text editing.",
|
||||||
@ -435,7 +429,7 @@
|
|||||||
"label": "QInputDialog",
|
"label": "QInputDialog",
|
||||||
"purpose": "Provides a simple convenience dialog to get a single value from the user.",
|
"purpose": "Provides a simple convenience dialog to get a single value from the user.",
|
||||||
"section": "Dialogs",
|
"section": "Dialogs",
|
||||||
"condition": "features.combobox && features.spinbox && features.stackedwidget",
|
"condition": "features.combobox && features.spinbox && features.stackedwidget && features.textedit",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"errormessage": {
|
"errormessage": {
|
||||||
@ -504,7 +498,7 @@
|
|||||||
"label": "QCompleter",
|
"label": "QCompleter",
|
||||||
"purpose": "Provides completions based on an item model.",
|
"purpose": "Provides completions based on an item model.",
|
||||||
"section": "Utilities",
|
"section": "Utilities",
|
||||||
"condition": "features.proxymodel",
|
"condition": "features.proxymodel && features.itemviews",
|
||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"fscompleter": {
|
"fscompleter": {
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qwindowdefs.h"
|
#include "qwindowdefs.h"
|
||||||
|
|
||||||
#ifndef QT_NO_FONTDIALOG
|
|
||||||
|
|
||||||
#include "qfontdialog.h"
|
#include "qfontdialog.h"
|
||||||
|
|
||||||
|
#if QT_CONFIG(fontdialog)
|
||||||
|
|
||||||
#include "qfontdialog_p.h"
|
#include "qfontdialog_p.h"
|
||||||
|
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
@ -1050,4 +1050,4 @@ QT_END_NAMESPACE
|
|||||||
#include "qfontdialog.moc"
|
#include "qfontdialog.moc"
|
||||||
#include "moc_qfontdialog.cpp"
|
#include "moc_qfontdialog.cpp"
|
||||||
|
|
||||||
#endif // QT_NO_FONTDIALOG
|
#endif // QT_CONFIG(fontdialog)
|
||||||
|
@ -336,8 +336,10 @@ void QMessageBoxPrivate::setupLayout()
|
|||||||
#else
|
#else
|
||||||
grid->addWidget(buttonBox, grid->rowCount(), 0, 1, grid->columnCount());
|
grid->addWidget(buttonBox, grid->rowCount(), 0, 1, grid->columnCount());
|
||||||
#endif
|
#endif
|
||||||
|
#if QT_CONFIG(textedit)
|
||||||
if (detailsText)
|
if (detailsText)
|
||||||
grid->addWidget(detailsText, grid->rowCount(), 0, 1, grid->columnCount());
|
grid->addWidget(detailsText, grid->rowCount(), 0, 1, grid->columnCount());
|
||||||
|
#endif
|
||||||
grid->setSizeConstraint(QLayout::SetNoConstraint);
|
grid->setSizeConstraint(QLayout::SetNoConstraint);
|
||||||
q->setLayout(grid);
|
q->setLayout(grid);
|
||||||
|
|
||||||
@ -2654,7 +2656,9 @@ void QMessageBoxPrivate::helperPrepareShow(QPlatformDialogHelper *)
|
|||||||
options->setWindowTitle(q->windowTitle());
|
options->setWindowTitle(q->windowTitle());
|
||||||
options->setText(q->text());
|
options->setText(q->text());
|
||||||
options->setInformativeText(q->informativeText());
|
options->setInformativeText(q->informativeText());
|
||||||
|
#if QT_CONFIG(textedit)
|
||||||
options->setDetailedText(q->detailedText());
|
options->setDetailedText(q->detailedText());
|
||||||
|
#endif
|
||||||
options->setIcon(helperIcon(q->icon()));
|
options->setIcon(helperIcon(q->icon()));
|
||||||
options->setStandardButtons(helperStandardButtons(q));
|
options->setStandardButtons(helperStandardButtons(q));
|
||||||
}
|
}
|
||||||
|
@ -2073,10 +2073,12 @@
|
|||||||
model's structure, perhaps involving internal reorganization, sorting of data or
|
model's structure, perhaps involving internal reorganization, sorting of data or
|
||||||
any other structural change, it is necessary to perform the following sequence:
|
any other structural change, it is necessary to perform the following sequence:
|
||||||
|
|
||||||
|
\list
|
||||||
\li Emit the \l{QAbstractItemModel::layoutAboutToBeChanged()}{layoutAboutToBeChanged()} signal
|
\li Emit the \l{QAbstractItemModel::layoutAboutToBeChanged()}{layoutAboutToBeChanged()} signal
|
||||||
\li Update internal data which represents the structure of the model.
|
\li Update internal data which represents the structure of the model.
|
||||||
\li Update persistent indexes using \l{QAbstractItemModel::changePersistentIndexList()}{changePersistentIndexList()}
|
\li Update persistent indexes using \l{QAbstractItemModel::changePersistentIndexList()}{changePersistentIndexList()}
|
||||||
\li Emit the \l{QAbstractItemModel::layoutChanged()}{layoutChanged()} signal.
|
\li Emit the \l{QAbstractItemModel::layoutChanged()}{layoutChanged()} signal.
|
||||||
|
\endlist
|
||||||
|
|
||||||
This sequence can be used for any structural update in lieu of the more
|
This sequence can be used for any structural update in lieu of the more
|
||||||
high-level and convenient protected methods. For example, if a model of
|
high-level and convenient protected methods. For example, if a model of
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
# Qt graphicsview module
|
# Qt graphicsview module
|
||||||
|
|
||||||
|
qtConfig(graphicsview) {
|
||||||
HEADERS += graphicsview/qgraphicsgridlayout.h \
|
HEADERS += graphicsview/qgraphicsgridlayout.h \
|
||||||
graphicsview/qgraphicsitem.h \
|
graphicsview/qgraphicsitem.h \
|
||||||
graphicsview/qgraphicsitem_p.h \
|
graphicsview/qgraphicsitem_p.h \
|
||||||
@ -53,3 +55,4 @@ SOURCES += graphicsview/qgraphicsgridlayout.cpp \
|
|||||||
graphicsview/qsimplex_p.cpp \
|
graphicsview/qsimplex_p.cpp \
|
||||||
graphicsview/qgraphicsanchorlayout_p.cpp \
|
graphicsview/qgraphicsanchorlayout_p.cpp \
|
||||||
graphicsview/qgraphicsanchorlayout.cpp
|
graphicsview/qgraphicsanchorlayout.cpp
|
||||||
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Qt gui library, itemviews
|
# Qt gui library, itemviews
|
||||||
|
|
||||||
|
qtConfig(itemviews) {
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
itemviews/qabstractitemview.h \
|
itemviews/qabstractitemview.h \
|
||||||
itemviews/qabstractitemview_p.h \
|
itemviews/qabstractitemview_p.h \
|
||||||
@ -27,8 +28,6 @@ HEADERS += \
|
|||||||
itemviews/qitemeditorfactory_p.h \
|
itemviews/qitemeditorfactory_p.h \
|
||||||
itemviews/qtreewidgetitemiterator.h \
|
itemviews/qtreewidgetitemiterator.h \
|
||||||
itemviews/qdatawidgetmapper.h \
|
itemviews/qdatawidgetmapper.h \
|
||||||
itemviews/qfileiconprovider.h \
|
|
||||||
itemviews/qfileiconprovider_p.h \
|
|
||||||
itemviews/qcolumnviewgrip_p.h \
|
itemviews/qcolumnviewgrip_p.h \
|
||||||
itemviews/qcolumnview.h \
|
itemviews/qcolumnview.h \
|
||||||
itemviews/qcolumnview_p.h \
|
itemviews/qcolumnview_p.h \
|
||||||
@ -50,8 +49,14 @@ SOURCES += \
|
|||||||
itemviews/qitemeditorfactory.cpp \
|
itemviews/qitemeditorfactory.cpp \
|
||||||
itemviews/qtreewidgetitemiterator.cpp \
|
itemviews/qtreewidgetitemiterator.cpp \
|
||||||
itemviews/qdatawidgetmapper.cpp \
|
itemviews/qdatawidgetmapper.cpp \
|
||||||
itemviews/qfileiconprovider.cpp \
|
|
||||||
itemviews/qcolumnview.cpp \
|
itemviews/qcolumnview.cpp \
|
||||||
itemviews/qcolumnviewgrip.cpp \
|
itemviews/qcolumnviewgrip.cpp \
|
||||||
itemviews/qstyleditemdelegate.cpp
|
itemviews/qstyleditemdelegate.cpp
|
||||||
|
}
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
itemviews/qfileiconprovider.h \
|
||||||
|
itemviews/qfileiconprovider_p.h \
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
itemviews/qfileiconprovider.cpp
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
#ifndef QT_NO_COLUMNVIEW
|
|
||||||
|
|
||||||
#include "qcolumnview.h"
|
#include "qcolumnview.h"
|
||||||
|
|
||||||
|
#if QT_CONFIG(columnview)
|
||||||
|
|
||||||
#include "qcolumnview_p.h"
|
#include "qcolumnview_p.h"
|
||||||
#include "qcolumnviewgrip_p.h"
|
#include "qcolumnviewgrip_p.h"
|
||||||
|
|
||||||
@ -1170,4 +1170,4 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
#include "moc_qcolumnview.cpp"
|
#include "moc_qcolumnview.cpp"
|
||||||
|
|
||||||
#endif // QT_NO_COLUMNVIEW
|
#endif // QT_CONFIG(columnview)
|
||||||
|
@ -53,8 +53,8 @@
|
|||||||
|
|
||||||
#include <QtCore/qstack.h>
|
#include <QtCore/qstack.h>
|
||||||
|
|
||||||
#ifndef QT_NO_TREEWIDGET
|
|
||||||
#include "qtreewidgetitemiterator.h"
|
#include "qtreewidgetitemiterator.h"
|
||||||
|
#if QT_CONFIG(treewidget)
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -103,6 +103,6 @@ private:
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QT_NO_TREEWIDGET
|
#endif // QT_CONFIG(treewidget)
|
||||||
|
|
||||||
#endif //QTREEWIDGETITEMITERATOR_P_H
|
#endif //QTREEWIDGETITEMITERATOR_P_H
|
||||||
|
@ -5226,9 +5226,11 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
|||||||
case SH_Splitter_OpaqueResize:
|
case SH_Splitter_OpaqueResize:
|
||||||
ret = true;
|
ret = true;
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(itemviews)
|
||||||
case SH_ItemView_ScrollMode:
|
case SH_ItemView_ScrollMode:
|
||||||
ret = QAbstractItemView::ScrollPerItem;
|
ret = QAbstractItemView::ScrollPerItem;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -453,6 +453,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
|
|||||||
drawPrimitive(PE_IndicatorArrowRight, option, painter, widget);
|
drawPrimitive(PE_IndicatorArrowRight, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
case PE_FrameTabBarBase:
|
case PE_FrameTabBarBase:
|
||||||
if (const QStyleOptionTabBarBase *tbb
|
if (const QStyleOptionTabBarBase *tbb
|
||||||
= qstyleoption_cast<const QStyleOptionTabBarBase *>(option)) {
|
= qstyleoption_cast<const QStyleOptionTabBarBase *>(option)) {
|
||||||
@ -489,6 +490,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
#endif // QT_CONFIG(tabbar)
|
||||||
case PE_PanelScrollAreaCorner: {
|
case PE_PanelScrollAreaCorner: {
|
||||||
painter->save();
|
painter->save();
|
||||||
QColor alphaOutline = outline;
|
QColor alphaOutline = outline;
|
||||||
@ -938,6 +940,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
|
|||||||
case PE_FrameTabWidget:
|
case PE_FrameTabWidget:
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->fillRect(option->rect.adjusted(0, 0, -1, -1), tabFrameColor);
|
painter->fillRect(option->rect.adjusted(0, 0, -1, -1), tabFrameColor);
|
||||||
|
#if QT_CONFIG(tabwidget)
|
||||||
if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option)) {
|
if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option)) {
|
||||||
QColor borderColor = outline.lighter(110);
|
QColor borderColor = outline.lighter(110);
|
||||||
QRect rect = option->rect.adjusted(0, 0, -1, -1);
|
QRect rect = option->rect.adjusted(0, 0, -1, -1);
|
||||||
@ -960,6 +963,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
|
|||||||
painter->drawRect(rect.adjusted(1, 1, -1, -1));
|
painter->drawRect(rect.adjusted(1, 1, -1, -1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(tabwidget)
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
@ -1057,6 +1061,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(rubberband)
|
||||||
case CE_RubberBand:
|
case CE_RubberBand:
|
||||||
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
|
if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
|
||||||
QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight);
|
QColor highlight = option->palette.color(QPalette::Active, QPalette::Highlight);
|
||||||
@ -1082,6 +1087,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif //QT_CONFIG(rubberband)
|
||||||
case CE_SizeGrip:
|
case CE_SizeGrip:
|
||||||
painter->save();
|
painter->save();
|
||||||
{
|
{
|
||||||
@ -1097,6 +1103,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(toolbar)
|
||||||
case CE_ToolBar:
|
case CE_ToolBar:
|
||||||
if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) {
|
if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) {
|
||||||
// Reserve the beveled appearance only for mainwindow toolbars
|
// Reserve the beveled appearance only for mainwindow toolbars
|
||||||
@ -1217,6 +1224,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
painter->setPen(oldPen);
|
painter->setPen(oldPen);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(toolbar)
|
||||||
case CE_DockWidgetTitle:
|
case CE_DockWidgetTitle:
|
||||||
painter->save();
|
painter->save();
|
||||||
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option)) {
|
if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option)) {
|
||||||
@ -1550,7 +1558,10 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
bool ignoreCheckMark = false;
|
bool ignoreCheckMark = false;
|
||||||
int checkcol = qMax(menuItem->maxIconWidth, 20);
|
int checkcol = qMax(menuItem->maxIconWidth, 20);
|
||||||
|
|
||||||
if (qobject_cast<const QComboBox*>(widget) ||
|
if (
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
|
qobject_cast<const QComboBox*>(widget) ||
|
||||||
|
#endif
|
||||||
(option->styleObject && option->styleObject->property("_q_isComboBoxPopupItem").toBool()))
|
(option->styleObject && option->styleObject->property("_q_isComboBoxPopupItem").toBool()))
|
||||||
ignoreCheckMark = true; //ignore the checkmarks provided by the QComboMenuDelegate
|
ignoreCheckMark = true; //ignore the checkmarks provided by the QComboMenuDelegate
|
||||||
|
|
||||||
@ -1607,8 +1618,10 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
|
|
||||||
int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget);
|
int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize, option, widget);
|
||||||
QSize iconSize(smallIconSize, smallIconSize);
|
QSize iconSize(smallIconSize, smallIconSize);
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
if (const QComboBox *combo = qobject_cast<const QComboBox*>(widget))
|
if (const QComboBox *combo = qobject_cast<const QComboBox*>(widget))
|
||||||
iconSize = combo->iconSize();
|
iconSize = combo->iconSize();
|
||||||
|
#endif
|
||||||
if (checked)
|
if (checked)
|
||||||
pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On);
|
pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On);
|
||||||
else
|
else
|
||||||
@ -1793,6 +1806,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
case CE_TabBarTabShape:
|
case CE_TabBarTabShape:
|
||||||
painter->save();
|
painter->save();
|
||||||
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) {
|
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) {
|
||||||
@ -1908,6 +1922,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;
|
break;
|
||||||
|
#endif //QT_CONFIG(tabbar)
|
||||||
default:
|
default:
|
||||||
QCommonStyle::drawControl(element,option,painter,widget);
|
QCommonStyle::drawControl(element,option,painter,widget);
|
||||||
break;
|
break;
|
||||||
@ -1993,6 +2008,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(spinbox)
|
||||||
case CC_SpinBox:
|
case CC_SpinBox:
|
||||||
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
||||||
QPixmap cache;
|
QPixmap cache;
|
||||||
@ -2143,6 +2159,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
painter->drawPixmap(spinBox->rect.topLeft(), cache);
|
painter->drawPixmap(spinBox->rect.topLeft(), cache);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(spinbox)
|
||||||
case CC_TitleBar:
|
case CC_TitleBar:
|
||||||
painter->save();
|
painter->save();
|
||||||
if (const QStyleOptionTitleBar *titleBar = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
|
if (const QStyleOptionTitleBar *titleBar = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
|
||||||
@ -2403,6 +2420,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
case CC_ScrollBar:
|
case CC_ScrollBar:
|
||||||
painter->save();
|
painter->save();
|
||||||
if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
if (const QStyleOptionSlider *scrollBar = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
||||||
@ -2711,6 +2729,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;;
|
break;;
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
case CC_ComboBox:
|
case CC_ComboBox:
|
||||||
painter->save();
|
painter->save();
|
||||||
if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
|
if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
|
||||||
@ -2808,6 +2827,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
break;
|
break;
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
case CC_Slider:
|
case CC_Slider:
|
||||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
||||||
QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget);
|
QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget);
|
||||||
@ -3018,10 +3038,13 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||||||
painter->setPen(oldPen);
|
painter->setPen(oldPen);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
|
#if QT_CONFIG(dial)
|
||||||
case CC_Dial:
|
case CC_Dial:
|
||||||
if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option))
|
if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option))
|
||||||
QStyleHelper::drawDial(dial, painter);
|
QStyleHelper::drawDial(dial, painter);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
QCommonStyle::drawComplexControl(control, option, painter, widget);
|
QCommonStyle::drawComplexControl(control, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
@ -3217,9 +3240,11 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!menuItem->icon.isNull()) {
|
else if (!menuItem->icon.isNull()) {
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
if (const QComboBox *combo = qobject_cast<const QComboBox*>(widget)) {
|
if (const QComboBox *combo = qobject_cast<const QComboBox*>(widget)) {
|
||||||
newSize.setHeight(qMax(combo->iconSize().height() + 2, newSize.height()));
|
newSize.setHeight(qMax(combo->iconSize().height() + 2, newSize.height()));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
newSize.setWidth(newSize.width() + 12);
|
newSize.setWidth(newSize.width() + 12);
|
||||||
newSize.setWidth(qMax(newSize.width(), 120));
|
newSize.setWidth(qMax(newSize.width(), 120));
|
||||||
@ -3252,12 +3277,22 @@ void QFusionStyle::polish(QWidget *widget)
|
|||||||
{
|
{
|
||||||
QCommonStyle::polish(widget);
|
QCommonStyle::polish(widget);
|
||||||
if (qobject_cast<QAbstractButton*>(widget)
|
if (qobject_cast<QAbstractButton*>(widget)
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
|| qobject_cast<QComboBox *>(widget)
|
|| qobject_cast<QComboBox *>(widget)
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(progressbar)
|
||||||
|| qobject_cast<QProgressBar *>(widget)
|
|| qobject_cast<QProgressBar *>(widget)
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(scrollbar)
|
||||||
|| qobject_cast<QScrollBar *>(widget)
|
|| qobject_cast<QScrollBar *>(widget)
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(splitter)
|
||||||
|| qobject_cast<QSplitterHandle *>(widget)
|
|| qobject_cast<QSplitterHandle *>(widget)
|
||||||
|
#endif
|
||||||
|| qobject_cast<QAbstractSlider *>(widget)
|
|| qobject_cast<QAbstractSlider *>(widget)
|
||||||
|
#if QT_CONFIG(spinbox)
|
||||||
|| qobject_cast<QAbstractSpinBox *>(widget)
|
|| qobject_cast<QAbstractSpinBox *>(widget)
|
||||||
|
#endif
|
||||||
|| (widget->inherits("QDockSeparator"))
|
|| (widget->inherits("QDockSeparator"))
|
||||||
|| (widget->inherits("QDockWidgetSeparator"))
|
|| (widget->inherits("QDockWidgetSeparator"))
|
||||||
) {
|
) {
|
||||||
@ -3281,12 +3316,22 @@ void QFusionStyle::unpolish(QWidget *widget)
|
|||||||
{
|
{
|
||||||
QCommonStyle::unpolish(widget);
|
QCommonStyle::unpolish(widget);
|
||||||
if (qobject_cast<QAbstractButton*>(widget)
|
if (qobject_cast<QAbstractButton*>(widget)
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
|| qobject_cast<QComboBox *>(widget)
|
|| qobject_cast<QComboBox *>(widget)
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(progressbar)
|
||||||
|| qobject_cast<QProgressBar *>(widget)
|
|| qobject_cast<QProgressBar *>(widget)
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(scrollbar)
|
||||||
|| qobject_cast<QScrollBar *>(widget)
|
|| qobject_cast<QScrollBar *>(widget)
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(splitter)
|
||||||
|| qobject_cast<QSplitterHandle *>(widget)
|
|| qobject_cast<QSplitterHandle *>(widget)
|
||||||
|
#endif
|
||||||
|| qobject_cast<QAbstractSlider *>(widget)
|
|| qobject_cast<QAbstractSlider *>(widget)
|
||||||
|
#if QT_CONFIG(spinbox)
|
||||||
|| qobject_cast<QAbstractSpinBox *>(widget)
|
|| qobject_cast<QAbstractSpinBox *>(widget)
|
||||||
|
#endif
|
||||||
|| (widget->inherits("QDockSeparator"))
|
|| (widget->inherits("QDockSeparator"))
|
||||||
|| (widget->inherits("QDockWidgetSeparator"))
|
|| (widget->inherits("QDockWidgetSeparator"))
|
||||||
) {
|
) {
|
||||||
@ -3311,6 +3356,7 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
|
|||||||
QRect rect = QCommonStyle::subControlRect(control, option, subControl, widget);
|
QRect rect = QCommonStyle::subControlRect(control, option, subControl, widget);
|
||||||
|
|
||||||
switch (control) {
|
switch (control) {
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
case CC_Slider:
|
case CC_Slider:
|
||||||
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option)) {
|
||||||
int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget);
|
int tickSize = proxy()->pixelMetric(PM_SliderTickmarkOffset, option, widget);
|
||||||
@ -3361,6 +3407,8 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
|
#if QT_CONFIG(spinbox)
|
||||||
case CC_SpinBox:
|
case CC_SpinBox:
|
||||||
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
|
||||||
int center = spinbox->rect.height() / 2;
|
int center = spinbox->rect.height() / 2;
|
||||||
@ -3398,7 +3446,7 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
|
|||||||
rect = visualRect(spinbox->direction, spinbox->rect, rect);
|
rect = visualRect(spinbox->direction, spinbox->rect, rect);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(spinbox)
|
||||||
case CC_GroupBox:
|
case CC_GroupBox:
|
||||||
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
|
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
|
||||||
rect = option->rect;
|
rect = option->rect;
|
||||||
|
@ -129,12 +129,14 @@ void QPixmapStyle::polish(QWidget *widget)
|
|||||||
Q_D(QPixmapStyle);
|
Q_D(QPixmapStyle);
|
||||||
|
|
||||||
// Don't fill the interior of the QTextEdit
|
// Don't fill the interior of the QTextEdit
|
||||||
|
#if QT_CONFIG(textedit)
|
||||||
if (qobject_cast<QTextEdit*>(widget)) {
|
if (qobject_cast<QTextEdit*>(widget)) {
|
||||||
QPalette p = widget->palette();
|
QPalette p = widget->palette();
|
||||||
p.setBrush(QPalette::Base, Qt::NoBrush);
|
p.setBrush(QPalette::Base, Qt::NoBrush);
|
||||||
widget->setPalette(p);
|
widget->setPalette(p);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(progressbar)
|
||||||
if (QProgressBar *pb = qobject_cast<QProgressBar*>(widget)) {
|
if (QProgressBar *pb = qobject_cast<QProgressBar*>(widget)) {
|
||||||
// Center the text in the progress bar
|
// Center the text in the progress bar
|
||||||
pb->setAlignment(Qt::AlignCenter);
|
pb->setAlignment(Qt::AlignCenter);
|
||||||
@ -143,10 +145,12 @@ void QPixmapStyle::polish(QWidget *widget)
|
|||||||
font.setPixelSize(d->descriptors.value(PB_HBackground).size.height()/2);
|
font.setPixelSize(d->descriptors.value(PB_HBackground).size.height()/2);
|
||||||
pb->setFont(font);
|
pb->setFont(font);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
if (qobject_cast<QSlider*>(widget))
|
if (qobject_cast<QSlider*>(widget))
|
||||||
widget->installEventFilter(this);
|
widget->installEventFilter(this);
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
if (QComboBox *cb = qobject_cast<QComboBox*>(widget)) {
|
if (QComboBox *cb = qobject_cast<QComboBox*>(widget)) {
|
||||||
widget->installEventFilter(this);
|
widget->installEventFilter(this);
|
||||||
// NOTE: This will break if the private API of QComboBox changes drastically
|
// NOTE: This will break if the private API of QComboBox changes drastically
|
||||||
@ -177,24 +181,28 @@ void QPixmapStyle::polish(QWidget *widget)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(combobox)
|
||||||
if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
|
if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
|
||||||
widget->installEventFilter(this);
|
widget->installEventFilter(this);
|
||||||
|
|
||||||
|
#if QT_CONFIG(scrollarea)
|
||||||
if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget)) {
|
if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget)) {
|
||||||
scrollArea->viewport()->setAutoFillBackground(false);
|
scrollArea->viewport()->setAutoFillBackground(false);
|
||||||
|
#if QT_CONFIG(itemviews)
|
||||||
if (QAbstractItemView *view = qobject_cast<QAbstractItemView*>(scrollArea)) {
|
if (QAbstractItemView *view = qobject_cast<QAbstractItemView*>(scrollArea)) {
|
||||||
view->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
view->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||||
view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if QT_CONFIG(gestures)
|
#if QT_CONFIG(gestures)
|
||||||
QScroller::grabGesture(scrollArea->viewport(), QScroller::LeftMouseButtonGesture);
|
QScroller::grabGesture(scrollArea->viewport(), QScroller::LeftMouseButtonGesture);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(scrollarea)
|
||||||
|
#if QT_CONFIG(scrollbar)
|
||||||
if (qobject_cast<QScrollBar*>(widget))
|
if (qobject_cast<QScrollBar*>(widget))
|
||||||
widget->setAttribute(Qt::WA_OpaquePaintEvent, false);
|
widget->setAttribute(Qt::WA_OpaquePaintEvent, false);
|
||||||
|
#endif
|
||||||
QCommonStyle::polish(widget);
|
QCommonStyle::polish(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,15 +219,23 @@ void QPixmapStyle::unpolish(QApplication *application)
|
|||||||
*/
|
*/
|
||||||
void QPixmapStyle::unpolish(QWidget *widget)
|
void QPixmapStyle::unpolish(QWidget *widget)
|
||||||
{
|
{
|
||||||
if (qobject_cast<QSlider*>(widget) ||
|
if (
|
||||||
qobject_cast<QComboBox*>(widget)) {
|
#if QT_CONFIG(slider)
|
||||||
|
qobject_cast<QSlider*>(widget)
|
||||||
|
#else
|
||||||
|
false
|
||||||
|
#endif
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
|
|| qobject_cast<QComboBox*>(widget)
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
widget->removeEventFilter(this);
|
widget->removeEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
|
if (qstrcmp(widget->metaObject()->className(),"QComboBoxPrivateContainer") == 0)
|
||||||
widget->removeEventFilter(this);
|
widget->removeEventFilter(this);
|
||||||
|
|
||||||
#if QT_CONFIG(gestures)
|
#if QT_CONFIG(gestures) && QT_CONFIG(scrollarea)
|
||||||
if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget))
|
if (QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(widget))
|
||||||
QScroller::ungrabGesture(scrollArea->viewport());
|
QScroller::ungrabGesture(scrollArea->viewport());
|
||||||
#endif
|
#endif
|
||||||
@ -245,10 +261,12 @@ void QPixmapStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *o
|
|||||||
drawLineEdit(option, painter, widget);
|
drawLineEdit(option, painter, widget);
|
||||||
break;
|
break;
|
||||||
case PE_Frame:
|
case PE_Frame:
|
||||||
|
#if QT_CONFIG(textedit)
|
||||||
case PE_FrameDefaultButton:
|
case PE_FrameDefaultButton:
|
||||||
if (qobject_cast<const QTextEdit*>(widget))
|
if (qobject_cast<const QTextEdit*>(widget))
|
||||||
drawTextEdit(option, painter, widget);
|
drawTextEdit(option, painter, widget);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case PE_IndicatorCheckBox:
|
case PE_IndicatorCheckBox:
|
||||||
drawCheckBox(option, painter, widget);
|
drawCheckBox(option, painter, widget);
|
||||||
break;
|
break;
|
||||||
@ -256,9 +274,11 @@ void QPixmapStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *o
|
|||||||
drawRadioButton(option, painter, widget);
|
drawRadioButton(option, painter, widget);
|
||||||
break;
|
break;
|
||||||
case PE_PanelItemViewItem:
|
case PE_PanelItemViewItem:
|
||||||
|
#if QT_CONFIG(listview)
|
||||||
if (qobject_cast<const QListView*>(widget))
|
if (qobject_cast<const QListView*>(widget))
|
||||||
drawPanelItemViewItem(option, painter, widget);
|
drawPanelItemViewItem(option, painter, widget);
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
QCommonStyle::drawPrimitive(element, option, painter, widget);
|
QCommonStyle::drawPrimitive(element, option, painter, widget);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -404,11 +424,13 @@ int QPixmapStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
|
|||||||
case PM_ButtonShiftVertical:
|
case PM_ButtonShiftVertical:
|
||||||
return 0;
|
return 0;
|
||||||
case PM_DefaultFrameWidth:
|
case PM_DefaultFrameWidth:
|
||||||
|
#if QT_CONFIG(textedit)
|
||||||
if (qobject_cast<const QTextEdit*>(widget)) {
|
if (qobject_cast<const QTextEdit*>(widget)) {
|
||||||
const QPixmapStyleDescriptor &desc = d->descriptors.value(LE_Enabled);
|
const QPixmapStyleDescriptor &desc = d->descriptors.value(LE_Enabled);
|
||||||
return qMax(qMax(desc.margins.left(), desc.margins.right()),
|
return qMax(qMax(desc.margins.left(), desc.margins.right()),
|
||||||
qMax(desc.margins.top(), desc.margins.bottom()));
|
qMax(desc.margins.top(), desc.margins.bottom()));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
case PM_IndicatorWidth:
|
case PM_IndicatorWidth:
|
||||||
return d->pixmaps.value(CB_Enabled).pixmap.width();
|
return d->pixmaps.value(CB_Enabled).pixmap.width();
|
||||||
@ -430,6 +452,7 @@ int QPixmapStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
|
|||||||
return qMax(qMax(pix.margins.left(), pix.margins.right()),
|
return qMax(qMax(pix.margins.left(), pix.margins.right()),
|
||||||
qMax(pix.margins.top(), pix.margins.bottom()));
|
qMax(pix.margins.top(), pix.margins.bottom()));
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
case PM_SliderThickness:
|
case PM_SliderThickness:
|
||||||
if (const QStyleOptionSlider *slider =
|
if (const QStyleOptionSlider *slider =
|
||||||
qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
||||||
@ -470,6 +493,7 @@ int QPixmapStyle::pixelMetric(PixelMetric metric, const QStyleOption *option,
|
|||||||
? desc.size.height() : desc.size.width();
|
? desc.size.height() : desc.size.width();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
case PM_ScrollBarSliderMin:
|
case PM_ScrollBarSliderMin:
|
||||||
return 0;
|
return 0;
|
||||||
default: ;
|
default: ;
|
||||||
@ -520,7 +544,7 @@ QStyle::SubControl QPixmapStyle::hitTestComplexControl(QStyle::ComplexControl co
|
|||||||
bool QPixmapStyle::eventFilter(QObject *watched, QEvent *event)
|
bool QPixmapStyle::eventFilter(QObject *watched, QEvent *event)
|
||||||
{
|
{
|
||||||
Q_D(QPixmapStyle);
|
Q_D(QPixmapStyle);
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
if (QSlider *slider = qobject_cast<QSlider*>(watched)) {
|
if (QSlider *slider = qobject_cast<QSlider*>(watched)) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::MouseButtonPress:
|
case QEvent::MouseButtonPress:
|
||||||
@ -531,7 +555,8 @@ bool QPixmapStyle::eventFilter(QObject *watched, QEvent *event)
|
|||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
if (QComboBox *comboBox = qobject_cast<QComboBox*>(watched)) {
|
if (QComboBox *comboBox = qobject_cast<QComboBox*>(watched)) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::MouseButtonPress:
|
case QEvent::MouseButtonPress:
|
||||||
@ -552,6 +577,7 @@ bool QPixmapStyle::eventFilter(QObject *watched, QEvent *event)
|
|||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(combobox)
|
||||||
|
|
||||||
if (qstrcmp(watched->metaObject()->className(),"QComboBoxPrivateContainer") == 0) {
|
if (qstrcmp(watched->metaObject()->className(),"QComboBoxPrivateContainer") == 0) {
|
||||||
if (event->type() == QEvent::Show) {
|
if (event->type() == QEvent::Show) {
|
||||||
@ -701,9 +727,10 @@ void QPixmapStyle::drawLineEdit(const QStyleOption *option,
|
|||||||
QPainter *painter, const QWidget *widget) const
|
QPainter *painter, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
// Don't draw for the line edit inside a combobox
|
// Don't draw for the line edit inside a combobox
|
||||||
|
#if QT_CONFIG(combobox)
|
||||||
if (widget && qobject_cast<const QComboBox*>(widget->parentWidget()))
|
if (widget && qobject_cast<const QComboBox*>(widget->parentWidget()))
|
||||||
return;
|
return;
|
||||||
|
#endif
|
||||||
const bool enabled = option->state & State_Enabled;
|
const bool enabled = option->state & State_Enabled;
|
||||||
const bool focused = option->state & State_HasFocus;
|
const bool focused = option->state & State_HasFocus;
|
||||||
ControlDescriptor control = enabled ? (focused ? LE_Focused : LE_Enabled) : LE_Disabled;
|
ControlDescriptor control = enabled ? (focused ? LE_Focused : LE_Enabled) : LE_Disabled;
|
||||||
@ -848,6 +875,7 @@ void QPixmapStyle::drawProgressBarFill(const QStyleOption *option,
|
|||||||
void QPixmapStyle::drawSlider(const QStyleOptionComplex *option,
|
void QPixmapStyle::drawSlider(const QStyleOptionComplex *option,
|
||||||
QPainter *painter, const QWidget *widget) const
|
QPainter *painter, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
Q_D(const QPixmapStyle);
|
Q_D(const QPixmapStyle);
|
||||||
|
|
||||||
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option);
|
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option);
|
||||||
@ -897,6 +925,7 @@ void QPixmapStyle::drawSlider(const QStyleOptionComplex *option,
|
|||||||
painter->drawPixmap(handle, d->pixmaps.value(pix).pixmap);
|
painter->drawPixmap(handle, d->pixmaps.value(pix).pixmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
}
|
}
|
||||||
|
|
||||||
void QPixmapStyle::drawComboBox(const QStyleOptionComplex *option,
|
void QPixmapStyle::drawComboBox(const QStyleOptionComplex *option,
|
||||||
@ -923,6 +952,7 @@ void QPixmapStyle::drawComboBox(const QStyleOptionComplex *option,
|
|||||||
void QPixmapStyle::drawScrollBar(const QStyleOptionComplex *option,
|
void QPixmapStyle::drawScrollBar(const QStyleOptionComplex *option,
|
||||||
QPainter *painter, const QWidget *widget) const
|
QPainter *painter, const QWidget *widget) const
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
if (const QStyleOptionSlider *slider =
|
if (const QStyleOptionSlider *slider =
|
||||||
qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
||||||
// Do not draw the scrollbar
|
// Do not draw the scrollbar
|
||||||
@ -934,6 +964,7 @@ void QPixmapStyle::drawScrollBar(const QStyleOptionComplex *option,
|
|||||||
? SB_Horizontal : SB_Vertical;
|
? SB_Horizontal : SB_Vertical;
|
||||||
drawCachedPixmap(control, rect, painter);
|
drawCachedPixmap(control, rect, painter);
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QPixmapStyle::pushButtonSizeFromContents(const QStyleOption *option,
|
QSize QPixmapStyle::pushButtonSizeFromContents(const QStyleOption *option,
|
||||||
@ -992,6 +1023,7 @@ QSize QPixmapStyle::sliderSizeFromContents(const QStyleOption *option,
|
|||||||
const QSize &contentsSize,
|
const QSize &contentsSize,
|
||||||
const QWidget *widget) const
|
const QWidget *widget) const
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
Q_D(const QPixmapStyle);
|
Q_D(const QPixmapStyle);
|
||||||
|
|
||||||
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option);
|
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option);
|
||||||
@ -1007,6 +1039,9 @@ QSize QPixmapStyle::sliderSizeFromContents(const QStyleOption *option,
|
|||||||
return QSize(result.width(), desc.size.height());
|
return QSize(result.width(), desc.size.height());
|
||||||
else
|
else
|
||||||
return QSize(desc.size.width(), result.height());
|
return QSize(desc.size.width(), result.height());
|
||||||
|
#else // QT_CONFIG(slider)
|
||||||
|
return QSize();
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QPixmapStyle::comboBoxSizeFromContents(const QStyleOption *option,
|
QSize QPixmapStyle::comboBoxSizeFromContents(const QStyleOption *option,
|
||||||
@ -1074,6 +1109,7 @@ QRect QPixmapStyle::comboBoxSubControlRect(const QStyleOptionComplex *option,
|
|||||||
QRect QPixmapStyle::scrollBarSubControlRect(const QStyleOptionComplex *option,
|
QRect QPixmapStyle::scrollBarSubControlRect(const QStyleOptionComplex *option,
|
||||||
QStyle::SubControl sc, const QWidget *) const
|
QStyle::SubControl sc, const QWidget *) const
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(slider)
|
||||||
if (const QStyleOptionSlider *slider =
|
if (const QStyleOptionSlider *slider =
|
||||||
qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
||||||
int length = (slider->orientation == Qt::Horizontal)
|
int length = (slider->orientation == Qt::Horizontal)
|
||||||
@ -1120,6 +1156,7 @@ QRect QPixmapStyle::scrollBarSubControlRect(const QStyleOptionComplex *option,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(slider)
|
||||||
return QRect();
|
return QRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rec
|
|||||||
|
|
||||||
QColor backgroundColor(const QPalette &pal, const QWidget* widget)
|
QColor backgroundColor(const QPalette &pal, const QWidget* widget)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_SCROLLBAR
|
#if QT_CONFIG(scrollarea)
|
||||||
if (qobject_cast<const QScrollBar *>(widget) && widget->parent() &&
|
if (qobject_cast<const QScrollBar *>(widget) && widget->parent() &&
|
||||||
qobject_cast<const QAbstractScrollArea *>(widget->parent()->parent()))
|
qobject_cast<const QAbstractScrollArea *>(widget->parent()->parent()))
|
||||||
return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base);
|
return widget->parentWidget()->parentWidget()->palette().color(QPalette::Base);
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
#ifndef QT_NO_STYLE_STYLESHEET
|
|
||||||
|
|
||||||
#include "qstylesheetstyle_p.h"
|
#include "qstylesheetstyle_p.h"
|
||||||
|
|
||||||
|
#if QT_CONFIG(style_stylesheet)
|
||||||
|
|
||||||
#include "private/qcssutil_p.h"
|
#include "private/qcssutil_p.h"
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
@ -4415,14 +4415,18 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PE_IndicatorColumnViewArrow:
|
case PE_IndicatorColumnViewArrow:
|
||||||
|
#if QT_CONFIG(itemviews)
|
||||||
if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
|
if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
|
||||||
bool reverse = (viewOpt->direction == Qt::RightToLeft);
|
bool reverse = (viewOpt->direction == Qt::RightToLeft);
|
||||||
pseudoElement = reverse ? PseudoElement_LeftArrow : PseudoElement_RightArrow;
|
pseudoElement = reverse ? PseudoElement_LeftArrow : PseudoElement_RightArrow;
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
pseudoElement = PseudoElement_RightArrow;
|
pseudoElement = PseudoElement_RightArrow;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if QT_CONFIG(itemviews)
|
||||||
case PE_IndicatorBranch:
|
case PE_IndicatorBranch:
|
||||||
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
|
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
|
||||||
QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch);
|
QRenderRule subRule = renderRule(w, opt, PseudoElement_TreeViewBranch);
|
||||||
@ -4437,6 +4441,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
#endif // QT_CONFIG(itemviews)
|
||||||
|
|
||||||
case PE_PanelTipLabel:
|
case PE_PanelTipLabel:
|
||||||
if (!rule.hasDrawable())
|
if (!rule.hasDrawable())
|
||||||
@ -4898,6 +4903,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
|
|||||||
QSize sz = rule.adjustSize(csz);
|
QSize sz = rule.adjustSize(csz);
|
||||||
|
|
||||||
switch (ct) {
|
switch (ct) {
|
||||||
|
#if QT_CONFIG(spinbox)
|
||||||
case CT_SpinBox: // ### hopelessly broken QAbstractSpinBox (part 1)
|
case CT_SpinBox: // ### hopelessly broken QAbstractSpinBox (part 1)
|
||||||
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
|
||||||
// Add some space for the up/down buttons
|
// Add some space for the up/down buttons
|
||||||
@ -4915,6 +4921,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
|
|||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // QT_CONFIG(spinbox)
|
||||||
case CT_ToolButton:
|
case CT_ToolButton:
|
||||||
if (rule.hasBox() || !rule.hasNativeBorder() || !rule.baseStyleCanDraw())
|
if (rule.hasBox() || !rule.hasNativeBorder() || !rule.baseStyleCanDraw())
|
||||||
sz += QSize(3, 3); // ### broken QToolButton
|
sz += QSize(3, 3); // ### broken QToolButton
|
||||||
@ -6024,4 +6031,4 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
#include "moc_qstylesheetstyle_p.cpp"
|
#include "moc_qstylesheetstyle_p.cpp"
|
||||||
|
|
||||||
#endif // QT_NO_STYLE_STYLESHEET
|
#endif // QT_CONFIG(style_stylesheet)
|
||||||
|
@ -815,6 +815,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
|
|||||||
p->save();
|
p->save();
|
||||||
doRestore = true;
|
doRestore = true;
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(itemviews)
|
||||||
if (pe == PE_IndicatorViewItemCheck) {
|
if (pe == PE_IndicatorViewItemCheck) {
|
||||||
const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt);
|
const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt);
|
||||||
p->setPen(itemViewOpt
|
p->setPen(itemViewOpt
|
||||||
@ -826,6 +827,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
|
|||||||
p->setBrush(opt->palette.brush(QPalette::Button));
|
p->setBrush(opt->palette.brush(QPalette::Button));
|
||||||
p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11);
|
p->drawRect(opt->rect.x() + 1, opt->rect.y() + 1, 11, 11);
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(itemviews)
|
||||||
if (!(opt->state & State_Off)) {
|
if (!(opt->state & State_Off)) {
|
||||||
QLineF lines[7];
|
QLineF lines[7];
|
||||||
int i, xx, yy;
|
int i, xx, yy;
|
||||||
|
@ -704,6 +704,7 @@ void QSystemTrayIconPrivate::remove_sys_qpa()
|
|||||||
|
|
||||||
void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
|
void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
if (menu->platformMenu())
|
if (menu->platformMenu())
|
||||||
return; // The platform menu already exists.
|
return; // The platform menu already exists.
|
||||||
|
|
||||||
@ -720,6 +721,7 @@ void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
|
|||||||
QPlatformMenu *platformMenu = qpa_sys->createMenu();
|
QPlatformMenu *platformMenu = qpa_sys->createMenu();
|
||||||
if (platformMenu)
|
if (platformMenu)
|
||||||
menu->setPlatformMenu(platformMenu);
|
menu->setPlatformMenu(platformMenu);
|
||||||
|
#endif // QT_CONFIG(menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -89,10 +89,12 @@ void QSystemTrayIconPrivate::updateIcon_sys()
|
|||||||
|
|
||||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
if (qpa_sys && menu) {
|
if (qpa_sys && menu) {
|
||||||
addPlatformMenu(menu);
|
addPlatformMenu(menu);
|
||||||
qpa_sys->updateMenu(menu->platformMenu());
|
qpa_sys->updateMenu(menu->platformMenu());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
void QSystemTrayIconPrivate::updateToolTip_sys()
|
||||||
|
@ -564,7 +564,8 @@ void QSystemTrayIconPrivate::updateIcon_sys()
|
|||||||
|
|
||||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
void QSystemTrayIconPrivate::updateToolTip_sys()
|
||||||
|
@ -104,7 +104,9 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn)
|
|||||||
, q(qIn)
|
, q(qIn)
|
||||||
{
|
{
|
||||||
setObjectName(QStringLiteral("QSystemTrayIconSys"));
|
setObjectName(QStringLiteral("QSystemTrayIconSys"));
|
||||||
|
#if QT_CONFIG(tooltip)
|
||||||
setToolTip(q->toolTip());
|
setToolTip(q->toolTip());
|
||||||
|
#endif
|
||||||
setAttribute(Qt::WA_AlwaysShowToolTips, true);
|
setAttribute(Qt::WA_AlwaysShowToolTips, true);
|
||||||
setAttribute(Qt::WA_QuitOnClose, false);
|
setAttribute(Qt::WA_QuitOnClose, false);
|
||||||
const QSize size(22, 22); // Gnome, standard size
|
const QSize size(22, 22); // Gnome, standard size
|
||||||
@ -316,10 +318,12 @@ void QSystemTrayIconPrivate::updateIcon_sys()
|
|||||||
|
|
||||||
void QSystemTrayIconPrivate::updateMenu_sys()
|
void QSystemTrayIconPrivate::updateMenu_sys()
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(menu)
|
||||||
if (qpa_sys && menu) {
|
if (qpa_sys && menu) {
|
||||||
addPlatformMenu(menu);
|
addPlatformMenu(menu);
|
||||||
qpa_sys->updateMenu(menu->platformMenu());
|
qpa_sys->updateMenu(menu->platformMenu());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QSystemTrayIconPrivate::updateToolTip_sys()
|
void QSystemTrayIconPrivate::updateToolTip_sys()
|
||||||
|
@ -473,6 +473,7 @@ void QAbstractScrollAreaPrivate::layoutChildren()
|
|||||||
// move the scrollbars away from top/left headers
|
// move the scrollbars away from top/left headers
|
||||||
int vHeaderRight = 0;
|
int vHeaderRight = 0;
|
||||||
int hHeaderBottom = 0;
|
int hHeaderBottom = 0;
|
||||||
|
#if QT_CONFIG(itemviews)
|
||||||
if ((vscrollOverlap > 0 && needv) || (hscrollOverlap > 0 && needh)) {
|
if ((vscrollOverlap > 0 && needv) || (hscrollOverlap > 0 && needh)) {
|
||||||
const QList<QHeaderView *> headers = q->findChildren<QHeaderView*>();
|
const QList<QHeaderView *> headers = q->findChildren<QHeaderView*>();
|
||||||
if (headers.count() <= 2) {
|
if (headers.count() <= 2) {
|
||||||
@ -485,7 +486,7 @@ void QAbstractScrollAreaPrivate::layoutChildren()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(itemviews)
|
||||||
if (needh) {
|
if (needh) {
|
||||||
QRect horizontalScrollBarRect(QPoint(controlsRect.left() + vHeaderRight, cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom()));
|
QRect horizontalScrollBarRect(QPoint(controlsRect.left() + vHeaderRight, cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom()));
|
||||||
#if 0 // Used to be included in Qt4 for Q_WS_MAC
|
#if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||||
|
@ -1246,11 +1246,9 @@ void QAbstractSpinBox::timerEvent(QTimerEvent *event)
|
|||||||
\reimp
|
\reimp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if QT_CONFIG(contextmenu)
|
||||||
void QAbstractSpinBox::contextMenuEvent(QContextMenuEvent *event)
|
void QAbstractSpinBox::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef QT_NO_CONTEXTMENU
|
|
||||||
Q_UNUSED(event);
|
|
||||||
#else
|
|
||||||
Q_D(QAbstractSpinBox);
|
Q_D(QAbstractSpinBox);
|
||||||
|
|
||||||
QPointer<QMenu> menu = d->edit->createStandardContextMenu();
|
QPointer<QMenu> menu = d->edit->createStandardContextMenu();
|
||||||
@ -1286,8 +1284,8 @@ void QAbstractSpinBox::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
event->accept();
|
event->accept();
|
||||||
#endif // QT_NO_CONTEXTMENU
|
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(contextmenu)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\reimp
|
\reimp
|
||||||
|
@ -142,7 +142,9 @@ protected:
|
|||||||
#endif
|
#endif
|
||||||
void focusInEvent(QFocusEvent *event) override;
|
void focusInEvent(QFocusEvent *event) override;
|
||||||
void focusOutEvent(QFocusEvent *event) override;
|
void focusOutEvent(QFocusEvent *event) override;
|
||||||
|
#if QT_CONFIG(contextmenu)
|
||||||
void contextMenuEvent(QContextMenuEvent *event) override;
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||||
|
#endif
|
||||||
void changeEvent(QEvent *event) override;
|
void changeEvent(QEvent *event) override;
|
||||||
void closeEvent(QCloseEvent *event) override;
|
void closeEvent(QCloseEvent *event) override;
|
||||||
void hideEvent(QHideEvent *event) override;
|
void hideEvent(QHideEvent *event) override;
|
||||||
|
@ -2092,7 +2092,7 @@ void QDockAreaLayoutInfo::reparentWidgets(QWidget *parent)
|
|||||||
const QDockAreaLayoutItem &item = item_list.at(i);
|
const QDockAreaLayoutItem &item = item_list.at(i);
|
||||||
if (item.flags & QDockAreaLayoutItem::GapItem)
|
if (item.flags & QDockAreaLayoutItem::GapItem)
|
||||||
continue;
|
continue;
|
||||||
if (item.skip())
|
if (!item.widgetItem && item.skip())
|
||||||
continue;
|
continue;
|
||||||
if (item.subinfo)
|
if (item.subinfo)
|
||||||
item.subinfo->reparentWidgets(parent);
|
item.subinfo->reparentWidgets(parent);
|
||||||
@ -2608,7 +2608,9 @@ QLayoutItem *QDockAreaLayout::plug(const QList<int> &path)
|
|||||||
Q_ASSERT(!path.isEmpty());
|
Q_ASSERT(!path.isEmpty());
|
||||||
const int index = path.first();
|
const int index = path.first();
|
||||||
Q_ASSERT(index >= 0 && index < QInternal::DockCount);
|
Q_ASSERT(index >= 0 && index < QInternal::DockCount);
|
||||||
return docks[index].plug(path.mid(1));
|
QLayoutItem *item = docks[index].plug(path.mid(1));
|
||||||
|
docks[index].reparentWidgets(mainWindow);
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLayoutItem *QDockAreaLayout::unplug(const QList<int> &path)
|
QLayoutItem *QDockAreaLayout::unplug(const QList<int> &path)
|
||||||
@ -3175,6 +3177,7 @@ void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
|
|||||||
|
|
||||||
while (path.size() > 1) {
|
while (path.size() > 1) {
|
||||||
QDockAreaLayoutInfo *info = this->info(path);
|
QDockAreaLayoutInfo *info = this->info(path);
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
if (!info->tabbed && info->o == o) {
|
if (!info->tabbed && info->o == o) {
|
||||||
info->item_list[path.constLast()].size = size;
|
info->item_list[path.constLast()].size = size;
|
||||||
int totalSize = 0;
|
int totalSize = 0;
|
||||||
@ -3187,6 +3190,7 @@ void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
|
|||||||
}
|
}
|
||||||
size = totalSize;
|
size = totalSize;
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(tabbar)
|
||||||
path.removeLast();
|
path.removeLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
|
|
||||||
#include "qboxlayout.h"
|
#include "qboxlayout.h"
|
||||||
#include "qlineedit.h"
|
#include "qlineedit.h"
|
||||||
|
#include <private/qkeymapper_p.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -80,15 +81,8 @@ void QKeySequenceEditPrivate::init()
|
|||||||
|
|
||||||
int QKeySequenceEditPrivate::translateModifiers(Qt::KeyboardModifiers state, const QString &text)
|
int QKeySequenceEditPrivate::translateModifiers(Qt::KeyboardModifiers state, const QString &text)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(text);
|
||||||
int result = 0;
|
int result = 0;
|
||||||
// The shift modifier only counts when it is not used to type a symbol
|
|
||||||
// that is only reachable using the shift key anyway
|
|
||||||
if ((state & Qt::ShiftModifier) && (text.isEmpty() ||
|
|
||||||
!text.at(0).isPrint() ||
|
|
||||||
text.at(0).isLetterOrNumber() ||
|
|
||||||
text.at(0).isSpace()))
|
|
||||||
result |= Qt::SHIFT;
|
|
||||||
|
|
||||||
if (state & Qt::ControlModifier)
|
if (state & Qt::ControlModifier)
|
||||||
result |= Qt::CTRL;
|
result |= Qt::CTRL;
|
||||||
if (state & Qt::MetaModifier)
|
if (state & Qt::MetaModifier)
|
||||||
@ -272,7 +266,27 @@ void QKeySequenceEdit::keyPressEvent(QKeyEvent *e)
|
|||||||
if (d->keyNum >= QKeySequencePrivate::MaxKeyCount)
|
if (d->keyNum >= QKeySequencePrivate::MaxKeyCount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nextKey |= d->translateModifiers(e->modifiers(), e->text());
|
if (e->modifiers() & Qt::ShiftModifier) {
|
||||||
|
QList<int> possibleKeys = QKeyMapper::possibleKeys(e);
|
||||||
|
int pkTotal = possibleKeys.count();
|
||||||
|
if (!pkTotal)
|
||||||
|
return;
|
||||||
|
bool found = false;
|
||||||
|
for (int i = 0; i < possibleKeys.size(); ++i) {
|
||||||
|
if (possibleKeys.at(i) - nextKey == int(e->modifiers())
|
||||||
|
|| (possibleKeys.at(i) == nextKey && e->modifiers() == Qt::ShiftModifier)) {
|
||||||
|
nextKey = possibleKeys.at(i);
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use as fallback
|
||||||
|
if (!found)
|
||||||
|
nextKey = possibleKeys.first();
|
||||||
|
} else {
|
||||||
|
nextKey |= d->translateModifiers(e->modifiers(), e->text());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
d->key[d->keyNum] = nextKey;
|
d->key[d->keyNum] = nextKey;
|
||||||
d->keyNum++;
|
d->keyNum++;
|
||||||
|
@ -2195,10 +2195,12 @@ void QLineEdit::changeEvent(QEvent *ev)
|
|||||||
update();
|
update();
|
||||||
break;
|
break;
|
||||||
case QEvent::LayoutDirectionChange:
|
case QEvent::LayoutDirectionChange:
|
||||||
|
#if QT_CONFIG(toolbutton)
|
||||||
for (const auto &e : d->trailingSideWidgets) { // Refresh icon to show arrow in right direction.
|
for (const auto &e : d->trailingSideWidgets) { // Refresh icon to show arrow in right direction.
|
||||||
if (e.flags & QLineEditPrivate::SideWidgetClearButton)
|
if (e.flags & QLineEditPrivate::SideWidgetClearButton)
|
||||||
static_cast<QLineEditIconButton *>(e.widget)->setIcon(d->clearButtonIcon());
|
static_cast<QLineEditIconButton *>(e.widget)->setIcon(d->clearButtonIcon());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
d->positionSideWidgets();
|
d->positionSideWidgets();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -313,6 +313,8 @@ void QLineEditPrivate::drag()
|
|||||||
|
|
||||||
#endif // QT_NO_DRAGANDDROP
|
#endif // QT_NO_DRAGANDDROP
|
||||||
|
|
||||||
|
|
||||||
|
#if QT_CONFIG(toolbutton)
|
||||||
QLineEditIconButton::QLineEditIconButton(QWidget *parent)
|
QLineEditIconButton::QLineEditIconButton(QWidget *parent)
|
||||||
: QToolButton(parent)
|
: QToolButton(parent)
|
||||||
, m_opacity(0)
|
, m_opacity(0)
|
||||||
@ -390,6 +392,7 @@ void QLineEditIconButton::updateCursor()
|
|||||||
setCursor(qFuzzyCompare(m_opacity, qreal(1.0)) || !parentWidget() ? QCursor(Qt::ArrowCursor) : parentWidget()->cursor());
|
setCursor(qFuzzyCompare(m_opacity, qreal(1.0)) || !parentWidget() ? QCursor(Qt::ArrowCursor) : parentWidget()->cursor());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(toolbutton)
|
||||||
|
|
||||||
void QLineEditPrivate::_q_textChanged(const QString &text)
|
void QLineEditPrivate::_q_textChanged(const QString &text)
|
||||||
{
|
{
|
||||||
@ -397,7 +400,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text)
|
|||||||
const int newTextSize = text.size();
|
const int newTextSize = text.size();
|
||||||
if (!newTextSize || !lastTextSize) {
|
if (!newTextSize || !lastTextSize) {
|
||||||
lastTextSize = newTextSize;
|
lastTextSize = newTextSize;
|
||||||
#ifndef QT_NO_ANIMATION
|
#if QT_CONFIG(animation) && QT_CONFIG(toolbutton)
|
||||||
const bool fadeIn = newTextSize > 0;
|
const bool fadeIn = newTextSize > 0;
|
||||||
for (const SideWidgetEntry &e : leadingSideWidgets) {
|
for (const SideWidgetEntry &e : leadingSideWidgets) {
|
||||||
if (e.flags & SideWidgetFadeInWithText)
|
if (e.flags & SideWidgetFadeInWithText)
|
||||||
@ -507,6 +510,7 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
|
|||||||
flags |= SideWidgetCreatedByWidgetAction;
|
flags |= SideWidgetCreatedByWidgetAction;
|
||||||
}
|
}
|
||||||
if (!w) {
|
if (!w) {
|
||||||
|
#if QT_CONFIG(toolbutton)
|
||||||
QLineEditIconButton *toolButton = new QLineEditIconButton(q);
|
QLineEditIconButton *toolButton = new QLineEditIconButton(q);
|
||||||
toolButton->setIcon(newAction->icon());
|
toolButton->setIcon(newAction->icon());
|
||||||
toolButton->setOpacity(lastTextSize > 0 || !(flags & SideWidgetFadeInWithText) ? 1 : 0);
|
toolButton->setOpacity(lastTextSize > 0 || !(flags & SideWidgetFadeInWithText) ? 1 : 0);
|
||||||
@ -514,6 +518,9 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
|
|||||||
QObject::connect(toolButton, SIGNAL(clicked()), q, SLOT(_q_clearButtonClicked()));
|
QObject::connect(toolButton, SIGNAL(clicked()), q, SLOT(_q_clearButtonClicked()));
|
||||||
toolButton->setDefaultAction(newAction);
|
toolButton->setDefaultAction(newAction);
|
||||||
w = toolButton;
|
w = toolButton;
|
||||||
|
#else
|
||||||
|
return nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
// If there is a 'before' action, it takes preference
|
// If there is a 'before' action, it takes preference
|
||||||
PositionIndexPair positionIndex = before ? findSideWidget(before) : PositionIndexPair(position, -1);
|
PositionIndexPair positionIndex = before ? findSideWidget(before) : PositionIndexPair(position, -1);
|
||||||
|
@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QLineEditPrivate;
|
class QLineEditPrivate;
|
||||||
|
|
||||||
// QLineEditIconButton: This is a simple helper class that represents clickable icons that fade in with text
|
// QLineEditIconButton: This is a simple helper class that represents clickable icons that fade in with text
|
||||||
|
#if QT_CONFIG(toolbutton)
|
||||||
class Q_AUTOTEST_EXPORT QLineEditIconButton : public QToolButton
|
class Q_AUTOTEST_EXPORT QLineEditIconButton : public QToolButton
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -103,6 +103,7 @@ private:
|
|||||||
|
|
||||||
qreal m_opacity;
|
qreal m_opacity;
|
||||||
};
|
};
|
||||||
|
#endif // QT_CONFIG(toolbutton)
|
||||||
|
|
||||||
class Q_AUTOTEST_EXPORT QLineEditPrivate : public QWidgetPrivate
|
class Q_AUTOTEST_EXPORT QLineEditPrivate : public QWidgetPrivate
|
||||||
{
|
{
|
||||||
|
@ -56,27 +56,21 @@
|
|||||||
\inmodule QtWidgets
|
\inmodule QtWidgets
|
||||||
|
|
||||||
While Qt offers a lot of classes for writing your application, Apple's
|
While Qt offers a lot of classes for writing your application, Apple's
|
||||||
Cocoa framework offers lots of functionality that is not currently in Qt or
|
Cocoa frameworks offer functionality that is not currently available (or
|
||||||
may never end up in Qt. Using QMacCocoaViewContainer, it is possible to put an
|
may never end up) in Qt. Using QMacCocoaViewContainer, it is possible to take an
|
||||||
arbitrary NSView-derived class from Cocoa and put it in a Qt hierarchy.
|
arbitrary NSView-derived class from Cocoa and put it in a Qt widgets hierarchy.
|
||||||
Depending on how comfortable you are with using objective-C, you can use
|
Depending on the level of integration you need, you can use QMacCocoaViewContainer
|
||||||
QMacCocoaViewContainer directly, or subclass it to wrap further functionality
|
directly or subclass it to wrap more functionality of the underlying NSView.
|
||||||
of the underlying NSView.
|
|
||||||
|
|
||||||
QMacCocoaViewContainer works regardless if Qt is built against Carbon or
|
It should be also noted that, at the Cocoa level, there is a difference
|
||||||
Cocoa. However, QCocoaContainerView requires \macos 10.5 or better to be
|
between top-level windows and views (widgets that are inside a window).
|
||||||
used with Carbon.
|
For this reason, make sure that the NSView that you are wrapping doesn't
|
||||||
|
end up as a top-level window. The best way to ensure this is to make sure
|
||||||
|
QMacCocoaViewContainer's parent widget is not null.
|
||||||
|
|
||||||
It should be also noted that at the low level on \macos, there is a
|
If you are using QMacCocoaViewContainer as a subclass and are accessing Cocoa API,
|
||||||
difference between windows (top-levels) and view (widgets that are inside a
|
it is probably simpler to have your file end with \tt{.mm} instead of \tt{.cpp}.
|
||||||
window). For this reason, make sure that the NSView that you are wrapping
|
Most Apple tools will correctly identify the source as Objective-C++.
|
||||||
doesn't end up as a top-level. The best way to ensure this is to make sure
|
|
||||||
you always have a parent and not set the parent to 0.
|
|
||||||
|
|
||||||
If you are using QMacCocoaViewContainer as a sub-class and are mixing and
|
|
||||||
matching objective-C with C++ (a.k.a. objective-C++). It is probably
|
|
||||||
simpler to have your file end with \tt{.mm} than \tt{.cpp}. Most Apple tools will
|
|
||||||
correctly identify the source as objective-C++.
|
|
||||||
|
|
||||||
QMacCocoaViewContainer requires knowledge of how Cocoa works, especially in
|
QMacCocoaViewContainer requires knowledge of how Cocoa works, especially in
|
||||||
regard to its reference counting (retain/release) nature. It is noted in
|
regard to its reference counting (retain/release) nature. It is noted in
|
||||||
@ -85,7 +79,8 @@
|
|||||||
pool. If this is done outside of a running event loop, it is up to the
|
pool. If this is done outside of a running event loop, it is up to the
|
||||||
developer to provide the autorelease pool.
|
developer to provide the autorelease pool.
|
||||||
|
|
||||||
The following is a snippet of subclassing QMacCocoaViewContainer to wrap a NSSearchField.
|
The following is a snippet showing how to subclass QMacCocoaViewContainer
|
||||||
|
to wrap an NSSearchField.
|
||||||
\snippet macmainwindow.mm 0
|
\snippet macmainwindow.mm 0
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -65,15 +65,11 @@
|
|||||||
but it cannot be shown on its own. It needs to be put into a window
|
but it cannot be shown on its own. It needs to be put into a window
|
||||||
when it is created or later through a native call.
|
when it is created or later through a native call.
|
||||||
|
|
||||||
QMacNativeWidget works for either Carbon or Cocoa depending on how Qt was configured. If Qt is
|
Here is an example showing how to put a QPushButton into a NSWindow:
|
||||||
using Carbon, QMacNativeWidget will embed into Carbon hierarchies. If Qt is
|
|
||||||
using Cocoa, QMacNativeWidget embeds into Cocoa hierarchies.
|
|
||||||
|
|
||||||
Here is an example of putting a QPushButton into a NSWindow:
|
|
||||||
|
|
||||||
\snippet qmacnativewidget/main.mm 0
|
\snippet qmacnativewidget/main.mm 0
|
||||||
|
|
||||||
Note that QMacNativeWidget requires knowledge of Carbon or Cocoa. All it
|
Note that QMacNativeWidget requires knowledge of Cocoa. All it
|
||||||
does is get the Qt hierarchy into a window not owned by Qt. It is then up
|
does is get the Qt hierarchy into a window not owned by Qt. It is then up
|
||||||
to the programmer to ensure it is placed correctly in the window and
|
to the programmer to ensure it is placed correctly in the window and
|
||||||
responds correctly to events.
|
responds correctly to events.
|
||||||
|
@ -125,8 +125,11 @@ static void dumpLayout(QTextStream &qout, const QDockAreaLayoutInfo &layout, QSt
|
|||||||
<< layout.rect.height()
|
<< layout.rect.height()
|
||||||
<< " min size: " << minSize.width() << ',' << minSize.height()
|
<< " min size: " << minSize.width() << ',' << minSize.height()
|
||||||
<< " orient:" << layout.o
|
<< " orient:" << layout.o
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
<< " tabbed:" << layout.tabbed
|
<< " tabbed:" << layout.tabbed
|
||||||
<< " tbshape:" << layout.tabBarShape << '\n';
|
<< " tbshape:" << layout.tabBarShape
|
||||||
|
#endif
|
||||||
|
<< '\n';
|
||||||
|
|
||||||
indent += QLatin1String(" ");
|
indent += QLatin1String(" ");
|
||||||
|
|
||||||
@ -226,7 +229,9 @@ public:
|
|||||||
if (li->isEmpty())
|
if (li->isEmpty())
|
||||||
return;
|
return;
|
||||||
int fw = frameWidth();
|
int fw = frameWidth();
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
li->reparentWidgets(parentWidget());
|
li->reparentWidgets(parentWidget());
|
||||||
|
#endif
|
||||||
li->rect = r.adjusted(fw, fw, -fw, -fw);
|
li->rect = r.adjusted(fw, fw, -fw, -fw);
|
||||||
li->fitItems();
|
li->fitItems();
|
||||||
li->apply(false);
|
li->apply(false);
|
||||||
@ -317,6 +322,7 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
|
|||||||
{
|
{
|
||||||
QDockAreaLayoutInfo *info = layoutInfo();
|
QDockAreaLayoutInfo *info = layoutInfo();
|
||||||
QDockWidget *dw = 0;
|
QDockWidget *dw = 0;
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
if (info->tabBar && info->tabBar->currentIndex() >= 0) {
|
if (info->tabBar && info->tabBar->currentIndex() >= 0) {
|
||||||
int i = info->tabIndexToListIndex(info->tabBar->currentIndex());
|
int i = info->tabIndexToListIndex(info->tabBar->currentIndex());
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
@ -325,6 +331,7 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
|
|||||||
dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
|
dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!dw) {
|
if (!dw) {
|
||||||
for (int i = 0; !dw && i < info->item_list.count(); ++i) {
|
for (int i = 0; !dw && i < info->item_list.count(); ++i) {
|
||||||
const QDockAreaLayoutItem &item = info->item_list.at(i);
|
const QDockAreaLayoutItem &item = info->item_list.at(i);
|
||||||
@ -373,8 +380,10 @@ void QDockWidgetGroupWindow::destroyOrHideIfEmpty()
|
|||||||
if (!wasHidden)
|
if (!wasHidden)
|
||||||
dw->show();
|
dw->show();
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
foreach (QTabBar *tb, findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly))
|
foreach (QTabBar *tb, findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly))
|
||||||
tb->setParent(parentWidget());
|
tb->setParent(parentWidget());
|
||||||
|
#endif
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,7 +1030,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef QT_NO_TABBAR
|
#if QT_CONFIG(tabwidget)
|
||||||
case QDockAreaLayout::FloatingDockWidgetTabMarker:
|
case QDockAreaLayout::FloatingDockWidgetTabMarker:
|
||||||
{
|
{
|
||||||
auto dockWidgets = allMyDockWidgets(mainWindow);
|
auto dockWidgets = allMyDockWidgets(mainWindow);
|
||||||
@ -1045,7 +1054,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream,
|
|||||||
floatingTab->show();
|
floatingTab->show();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // QT_NO_TABBAR
|
#endif // QT_CONFIG(tabwidget)
|
||||||
#endif // QT_NO_DOCKWIDGET
|
#endif // QT_NO_DOCKWIDGET
|
||||||
|
|
||||||
#ifndef QT_NO_TOOLBAR
|
#ifndef QT_NO_TOOLBAR
|
||||||
@ -1802,10 +1811,10 @@ bool QMainWindowLayout::endSeparatorMove(const QPoint&)
|
|||||||
|
|
||||||
void QMainWindowLayout::raise(QDockWidget *widget)
|
void QMainWindowLayout::raise(QDockWidget *widget)
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_TABBAR
|
||||||
QDockAreaLayoutInfo *info = dockInfo(widget);
|
QDockAreaLayoutInfo *info = dockInfo(widget);
|
||||||
if (info == 0)
|
if (info == 0)
|
||||||
return;
|
return;
|
||||||
#ifndef QT_NO_TABBAR
|
|
||||||
if (!info->tabbed)
|
if (!info->tabbed)
|
||||||
return;
|
return;
|
||||||
info->setCurrentTab(widget);
|
info->setCurrentTab(widget);
|
||||||
@ -2012,7 +2021,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
|
|||||||
dwgw->layoutInfo()->remove(path);
|
dwgw->layoutInfo()->remove(path);
|
||||||
}
|
}
|
||||||
currentGapRect = QRect();
|
currentGapRect = QRect();
|
||||||
|
#if QT_CONFIG(tabwidget)
|
||||||
if (QDockWidget *dropTo = qobject_cast<QDockWidget*>(currentHoveredFloat)) {
|
if (QDockWidget *dropTo = qobject_cast<QDockWidget*>(currentHoveredFloat)) {
|
||||||
//dropping to a normal widget, we mutate it in a QDockWidgetGroupWindow with two tabs
|
//dropping to a normal widget, we mutate it in a QDockWidgetGroupWindow with two tabs
|
||||||
QDockWidgetGroupWindow *floatingTabs = createTabbedDockWindow();
|
QDockWidgetGroupWindow *floatingTabs = createTabbedDockWindow();
|
||||||
@ -2030,7 +2039,8 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
|
|||||||
dropTo->d_func()->plug(QRect());
|
dropTo->d_func()->plug(QRect());
|
||||||
currentHoveredFloat = floatingTabs;
|
currentHoveredFloat = floatingTabs;
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(tabwidget)
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat);
|
QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat);
|
||||||
Q_ASSERT(dwgw);
|
Q_ASSERT(dwgw);
|
||||||
Q_ASSERT(dwgw->layoutInfo()->tabbed); // because floating group should always be tabbed
|
Q_ASSERT(dwgw->layoutInfo()->tabbed); // because floating group should always be tabbed
|
||||||
@ -2042,6 +2052,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem)
|
|||||||
globalRect.moveTopLeft(dwgw->mapToGlobal(globalRect.topLeft()));
|
globalRect.moveTopLeft(dwgw->mapToGlobal(globalRect.topLeft()));
|
||||||
pluggingWidget = widget;
|
pluggingWidget = widget;
|
||||||
widgetAnimator.animate(widget, globalRect, dockOptions & QMainWindow::AnimatedDocks);
|
widgetAnimator.animate(widget, globalRect, dockOptions & QMainWindow::AnimatedDocks);
|
||||||
|
#endif // QT_CONFIG(tabbar)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2120,7 +2131,9 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
|
|||||||
|
|
||||||
if (QDockWidgetGroupWindow *dropTo = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat)) {
|
if (QDockWidgetGroupWindow *dropTo = qobject_cast<QDockWidgetGroupWindow *>(currentHoveredFloat)) {
|
||||||
parentInfo = dropTo->layoutInfo();
|
parentInfo = dropTo->layoutInfo();
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
Q_ASSERT(parentInfo->tabbed);
|
Q_ASSERT(parentInfo->tabbed);
|
||||||
|
#endif
|
||||||
path = parentInfo->indexOf(widget);
|
path = parentInfo->indexOf(widget);
|
||||||
Q_ASSERT(path.size() == 1);
|
Q_ASSERT(path.size() == 1);
|
||||||
} else {
|
} else {
|
||||||
@ -2129,7 +2142,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
|
|||||||
parentInfo = layoutState.dockAreaLayout.info(path);
|
parentInfo = layoutState.dockAreaLayout.info(path);
|
||||||
Q_ASSERT(parentInfo);
|
Q_ASSERT(parentInfo);
|
||||||
}
|
}
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
if (parentInfo->tabbed) {
|
if (parentInfo->tabbed) {
|
||||||
// merge the two tab widgets
|
// merge the two tab widgets
|
||||||
int idx = path.constLast();
|
int idx = path.constLast();
|
||||||
@ -2143,15 +2156,19 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
|
|||||||
parentInfo->reparentWidgets(currentHoveredFloat ? currentHoveredFloat.data() : parentWidget());
|
parentInfo->reparentWidgets(currentHoveredFloat ? currentHoveredFloat.data() : parentWidget());
|
||||||
parentInfo->updateTabBar();
|
parentInfo->updateTabBar();
|
||||||
parentInfo->setCurrentTabId(currentId);
|
parentInfo->setCurrentTabId(currentId);
|
||||||
} else {
|
} else
|
||||||
|
#endif // QT_CONFIG(tabbar)
|
||||||
|
{
|
||||||
QDockAreaLayoutItem &item = layoutState.dockAreaLayout.item(path);
|
QDockAreaLayoutItem &item = layoutState.dockAreaLayout.item(path);
|
||||||
Q_ASSERT(item.widgetItem->widget() == dwgw);
|
Q_ASSERT(item.widgetItem->widget() == dwgw);
|
||||||
delete item.widgetItem;
|
delete item.widgetItem;
|
||||||
item.widgetItem = 0;
|
item.widgetItem = 0;
|
||||||
item.subinfo = new QDockAreaLayoutInfo(qMove(*info));
|
item.subinfo = new QDockAreaLayoutInfo(qMove(*info));
|
||||||
*info = QDockAreaLayoutInfo();
|
*info = QDockAreaLayoutInfo();
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
item.subinfo->reparentWidgets(parentWidget());
|
item.subinfo->reparentWidgets(parentWidget());
|
||||||
item.subinfo->setTabBarShape(parentInfo->tabBarShape);
|
item.subinfo->setTabBarShape(parentInfo->tabBarShape);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
dwgw->destroyOrHideIfEmpty();
|
dwgw->destroyOrHideIfEmpty();
|
||||||
}
|
}
|
||||||
@ -2172,7 +2189,9 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
|
|||||||
savedState.clear();
|
savedState.clear();
|
||||||
currentGapPos.clear();
|
currentGapPos.clear();
|
||||||
pluggingWidget = 0;
|
pluggingWidget = 0;
|
||||||
currentHoveredFloat = Q_NULLPTR;
|
#if QT_CONFIG(dockwidget)
|
||||||
|
currentHoveredFloat = nullptr;
|
||||||
|
#endif
|
||||||
//applying the state will make sure that the currentGap is updated correctly
|
//applying the state will make sure that the currentGap is updated correctly
|
||||||
//and all the geometries (especially the one from the central widget) is correct
|
//and all the geometries (especially the one from the central widget) is correct
|
||||||
layoutState.apply(false);
|
layoutState.apply(false);
|
||||||
@ -2360,7 +2379,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
|
|||||||
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
|
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
|
||||||
Q_ASSERT(path.constFirst() == 1);
|
Q_ASSERT(path.constFirst() == 1);
|
||||||
bool actualGroup = false;
|
bool actualGroup = false;
|
||||||
#ifndef QT_NO_TABBAR
|
#if QT_CONFIG(tabwidget)
|
||||||
if (group && (dockOptions & QMainWindow::GroupedDragging) && path.size() > 3) {
|
if (group && (dockOptions & QMainWindow::GroupedDragging) && path.size() > 3) {
|
||||||
QDockAreaLayoutItem &parentItem = layoutState.dockAreaLayout.item(path.mid(1, path.size() - 2));
|
QDockAreaLayoutItem &parentItem = layoutState.dockAreaLayout.item(path.mid(1, path.size() - 2));
|
||||||
if (parentItem.subinfo && parentItem.subinfo->tabbed) {
|
if (parentItem.subinfo && parentItem.subinfo->tabbed) {
|
||||||
@ -2381,7 +2400,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
|
|||||||
savedState = layoutState;
|
savedState = layoutState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // QT_NO_TABBAR
|
#endif // QT_CONFIG(tabwidget)
|
||||||
if (!actualGroup) {
|
if (!actualGroup) {
|
||||||
dw->d_func()->unplug(r);
|
dw->d_func()->unplug(r);
|
||||||
}
|
}
|
||||||
@ -2408,8 +2427,16 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
|
|||||||
void QMainWindowLayout::updateGapIndicator()
|
void QMainWindowLayout::updateGapIndicator()
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_RUBBERBAND
|
#ifndef QT_NO_RUBBERBAND
|
||||||
if ((!widgetAnimator.animating() && !currentGapPos.isEmpty()) || currentHoveredFloat) {
|
if ((!widgetAnimator.animating() && !currentGapPos.isEmpty())
|
||||||
QWidget *expectedParent = currentHoveredFloat ? currentHoveredFloat.data() : parentWidget();
|
#if QT_CONFIG(dockwidget)
|
||||||
|
|| currentHoveredFloat
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
|
QWidget *expectedParent =
|
||||||
|
#if QT_CONFIG(dockwidget)
|
||||||
|
currentHoveredFloat ? currentHoveredFloat.data() :
|
||||||
|
#endif
|
||||||
|
parentWidget();
|
||||||
if (!gapIndicator) {
|
if (!gapIndicator) {
|
||||||
gapIndicator = new QRubberBand(QRubberBand::Rectangle, expectedParent);
|
gapIndicator = new QRubberBand(QRubberBand::Rectangle, expectedParent);
|
||||||
// For accessibility to identify this special widget.
|
// For accessibility to identify this special widget.
|
||||||
@ -2417,7 +2444,11 @@ void QMainWindowLayout::updateGapIndicator()
|
|||||||
} else if (gapIndicator->parent() != expectedParent) {
|
} else if (gapIndicator->parent() != expectedParent) {
|
||||||
gapIndicator->setParent(expectedParent);
|
gapIndicator->setParent(expectedParent);
|
||||||
}
|
}
|
||||||
gapIndicator->setGeometry(currentHoveredFloat ? currentHoveredFloat->rect() : currentGapRect);
|
gapIndicator->setGeometry(
|
||||||
|
#if QT_CONFIG(dockwidget)
|
||||||
|
currentHoveredFloat ? currentHoveredFloat->rect() :
|
||||||
|
#endif
|
||||||
|
currentGapRect);
|
||||||
gapIndicator->show();
|
gapIndicator->show();
|
||||||
gapIndicator->raise();
|
gapIndicator->raise();
|
||||||
} else if (gapIndicator) {
|
} else if (gapIndicator) {
|
||||||
@ -2540,17 +2571,18 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
|
|||||||
updateGapIndicator();
|
updateGapIndicator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
|
||||||
QDockWidgetGroupWindow *QMainWindowLayout::createTabbedDockWindow()
|
QDockWidgetGroupWindow *QMainWindowLayout::createTabbedDockWindow()
|
||||||
{
|
{
|
||||||
QDockWidgetGroupWindow* f = new QDockWidgetGroupWindow(parentWidget(), Qt::Tool);
|
QDockWidgetGroupWindow* f = new QDockWidgetGroupWindow(parentWidget(), Qt::Tool);
|
||||||
new QDockWidgetGroupLayout(f);
|
new QDockWidgetGroupLayout(f);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animate)
|
void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animate)
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_DOCKWIDGET
|
#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
|
||||||
#ifndef QT_NO_TABBAR
|
|
||||||
QSet<QTabBar*> used = newState.dockAreaLayout.usedTabBars();
|
QSet<QTabBar*> used = newState.dockAreaLayout.usedTabBars();
|
||||||
foreach (QDockWidgetGroupWindow *dwgw,
|
foreach (QDockWidgetGroupWindow *dwgw,
|
||||||
parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
|
parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) {
|
||||||
@ -2578,8 +2610,7 @@ void QMainWindowLayout::applyState(QMainWindowLayoutState &newState, bool animat
|
|||||||
for (int i = 0; i < QInternal::DockCount; ++i)
|
for (int i = 0; i < QInternal::DockCount; ++i)
|
||||||
newState.dockAreaLayout.docks[i].reparentWidgets(parentWidget());
|
newState.dockAreaLayout.docks[i].reparentWidgets(parentWidget());
|
||||||
|
|
||||||
#endif // QT_NO_TABBAR
|
#endif // QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
|
||||||
#endif // QT_NO_DOCKWIDGET
|
|
||||||
newState.apply(dockOptions & QMainWindow::AnimatedDocks && animate);
|
newState.apply(dockOptions & QMainWindow::AnimatedDocks && animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,9 +231,9 @@ public:
|
|||||||
void raise(QDockWidget *widget);
|
void raise(QDockWidget *widget);
|
||||||
void setVerticalTabsEnabled(bool enabled);
|
void setVerticalTabsEnabled(bool enabled);
|
||||||
bool restoreDockWidget(QDockWidget *dockwidget);
|
bool restoreDockWidget(QDockWidget *dockwidget);
|
||||||
QDockAreaLayoutInfo *dockInfo(QWidget *w);
|
|
||||||
|
|
||||||
#ifndef QT_NO_TABBAR
|
#ifndef QT_NO_TABBAR
|
||||||
|
QDockAreaLayoutInfo *dockInfo(QWidget *w);
|
||||||
bool _documentMode;
|
bool _documentMode;
|
||||||
bool documentMode() const;
|
bool documentMode() const;
|
||||||
void setDocumentMode(bool enabled);
|
void setDocumentMode(bool enabled);
|
||||||
|
@ -1533,20 +1533,23 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
|
|||||||
Q_ASSERT(indexToHighlighted >= 0);
|
Q_ASSERT(indexToHighlighted >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(rubberband)
|
||||||
void QMdiAreaPrivate::showRubberBandFor(QMdiSubWindow *subWindow)
|
void QMdiAreaPrivate::showRubberBandFor(QMdiSubWindow *subWindow)
|
||||||
{
|
{
|
||||||
if (!subWindow || !rubberBand)
|
if (!subWindow || !rubberBand)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if QT_CONFIG(tabbar)
|
||||||
if (viewMode == QMdiArea::TabbedView)
|
if (viewMode == QMdiArea::TabbedView)
|
||||||
rubberBand->setGeometry(tabBar->tabRect(childWindows.indexOf(subWindow)));
|
rubberBand->setGeometry(tabBar->tabRect(childWindows.indexOf(subWindow)));
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
rubberBand->setGeometry(subWindow->geometry());
|
rubberBand->setGeometry(subWindow->geometry());
|
||||||
|
|
||||||
rubberBand->raise();
|
rubberBand->raise();
|
||||||
rubberBand->show();
|
rubberBand->show();
|
||||||
}
|
}
|
||||||
|
#endif // QT_CONFIG(rubberBand)
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
\since 4.4
|
\since 4.4
|
||||||
|
@ -441,10 +441,8 @@ void tst_QPropertyAnimation::noStartValue()
|
|||||||
a.setDuration(250);
|
a.setDuration(250);
|
||||||
a.start();
|
a.start();
|
||||||
|
|
||||||
QTest::qWait(300);
|
QTRY_COMPARE(o.values.value(o.values.size() - 1, -1), 420);
|
||||||
|
QCOMPARE(o.values.first(), 42);
|
||||||
QTRY_COMPARE(o.values.first(), 42);
|
|
||||||
QCOMPARE(o.values.last(), 420);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QPropertyAnimation::noStartValueWithLoop()
|
void tst_QPropertyAnimation::noStartValueWithLoop()
|
||||||
|
@ -400,6 +400,17 @@ void tst_QVariant::isNull()
|
|||||||
QVERIFY( !varLL.isNull() );
|
QVERIFY( !varLL.isNull() );
|
||||||
QVariant var7(QString::null);
|
QVariant var7(QString::null);
|
||||||
QVERIFY(var7.isNull());
|
QVERIFY(var7.isNull());
|
||||||
|
var7 = QVariant::fromValue<QString>(QString::null);
|
||||||
|
QVERIFY(var7.isNull());
|
||||||
|
|
||||||
|
QVariant var8(QMetaType::Nullptr, nullptr);
|
||||||
|
QVERIFY(var8.isNull());
|
||||||
|
var8 = QVariant::fromValue<std::nullptr_t>(nullptr);
|
||||||
|
QVERIFY(var8.isNull());
|
||||||
|
QVariant var9 = QVariant(QJsonValue(QJsonValue::Null));
|
||||||
|
QVERIFY(var9.isNull());
|
||||||
|
var9 = QVariant::fromValue<QJsonValue>(QJsonValue(QJsonValue::Null));
|
||||||
|
QVERIFY(var9.isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QVariant::swap()
|
void tst_QVariant::swap()
|
||||||
|
@ -189,7 +189,7 @@ void tst_QTimeLine::frameRate()
|
|||||||
|
|
||||||
void tst_QTimeLine::value()
|
void tst_QTimeLine::value()
|
||||||
{
|
{
|
||||||
QTimeLine timeLine(5000);
|
QTimeLine timeLine(4500); // Should be at least 5% under 5000ms
|
||||||
QCOMPARE(timeLine.currentValue(), 0.0);
|
QCOMPARE(timeLine.currentValue(), 0.0);
|
||||||
|
|
||||||
// Default speed
|
// Default speed
|
||||||
|
@ -370,8 +370,7 @@ void tst_QDBusMetaObject::types()
|
|||||||
|
|
||||||
QDBusError error;
|
QDBusError error;
|
||||||
|
|
||||||
QMetaObject *result = QDBusMetaObject::createMetaObject("local.Interface", xml,
|
const QScopedPointer<QDBusMetaObject> result(QDBusMetaObject::createMetaObject("local.Interface", xml, map, error));
|
||||||
map, error);
|
|
||||||
QVERIFY2(result, qPrintable(error.message()));
|
QVERIFY2(result, qPrintable(error.message()));
|
||||||
|
|
||||||
QCOMPARE(result->enumeratorCount(), 0);
|
QCOMPARE(result->enumeratorCount(), 0);
|
||||||
|
@ -59,6 +59,28 @@ void tst_QInputControl::isAcceptableInput_data()
|
|||||||
QTest::newRow("printable-hebrew") << QString(QChar(0x2135)) << Qt::KeyboardModifiers() << true;
|
QTest::newRow("printable-hebrew") << QString(QChar(0x2135)) << Qt::KeyboardModifiers() << true;
|
||||||
QTest::newRow("private-use-area") << QString(QChar(0xE832)) << Qt::KeyboardModifiers() << true;
|
QTest::newRow("private-use-area") << QString(QChar(0xE832)) << Qt::KeyboardModifiers() << true;
|
||||||
QTest::newRow("multiple-printable") << QStringLiteral("foobar") << Qt::KeyboardModifiers() << true;
|
QTest::newRow("multiple-printable") << QStringLiteral("foobar") << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("rlm") << QString(QChar(0x200F)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("rlm-with-ctrl") << QString(QChar(0x200F)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("rlm-with-ctrl-shift") << QString(QChar(0x200F)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
QTest::newRow("lrm") << QString(QChar(0x200E)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("lrm-with-ctrl") << QString(QChar(0x200E)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("lrm-with-ctrl-shift") << QString(QChar(0x200E)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
QTest::newRow("rlo") << QString(QChar(0x202E)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("rlo-with-ctrl") << QString(QChar(0x202E)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("rlo-with-ctrl-shift") << QString(QChar(0x202E)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
QTest::newRow("lro") << QString(QChar(0x202D)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("lro-with-ctrl") << QString(QChar(0x202D)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("lro-with-ctrl-shift") << QString(QChar(0x202D)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
QTest::newRow("lre") << QString(QChar(0x202B)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("lre-with-ctrl") << QString(QChar(0x202B)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("lre-with-ctrl-shift") << QString(QChar(0x202B)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
QTest::newRow("rle") << QString(QChar(0x202A)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("rle-with-ctrl") << QString(QChar(0x202A)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("rle-with-ctrl-shift") << QString(QChar(0x202A)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
QTest::newRow("pdf") << QString(QChar(0x202C)) << Qt::KeyboardModifiers() << true;
|
||||||
|
QTest::newRow("pdf-with-ctrl") << QString(QChar(0x202C)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true;
|
||||||
|
QTest::newRow("pdf-with-ctrl-shift") << QString(QChar(0x202C)) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QInputControl::isAcceptableInput()
|
void tst_QInputControl::isAcceptableInput()
|
||||||
|
@ -1567,7 +1567,7 @@ void tst_QAbstractItemView::testChangeEditorState()
|
|||||||
|
|
||||||
QTableView view;
|
QTableView view;
|
||||||
view.setEditTriggers(QAbstractItemView::CurrentChanged);
|
view.setEditTriggers(QAbstractItemView::CurrentChanged);
|
||||||
view.setItemDelegate(new StateChangeDelegate);
|
view.setItemDelegate(new StateChangeDelegate(&view));
|
||||||
view.setModel(&model);
|
view.setModel(&model);
|
||||||
centerOnScreen(&view);
|
centerOnScreen(&view);
|
||||||
moveCursorAway(&view);
|
moveCursorAway(&view);
|
||||||
@ -1941,7 +1941,8 @@ void tst_QAbstractItemView::QTBUG50102_SH_ItemView_ScrollMode()
|
|||||||
QCOMPARE(view.horizontalScrollMode(), styleScrollMode);
|
QCOMPARE(view.horizontalScrollMode(), styleScrollMode);
|
||||||
|
|
||||||
// Change style, get new value
|
// Change style, get new value
|
||||||
view.setStyle(new ScrollModeProxyStyle(styleScrollMode));
|
ScrollModeProxyStyle proxyStyle1(styleScrollMode);
|
||||||
|
view.setStyle(&proxyStyle1);
|
||||||
auto proxyScrollMode = static_cast<QAbstractItemView::ScrollMode>(view.style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, &view, 0));
|
auto proxyScrollMode = static_cast<QAbstractItemView::ScrollMode>(view.style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, &view, 0));
|
||||||
QVERIFY(styleScrollMode != proxyScrollMode);
|
QVERIFY(styleScrollMode != proxyScrollMode);
|
||||||
QCOMPARE(view.verticalScrollMode(), proxyScrollMode);
|
QCOMPARE(view.verticalScrollMode(), proxyScrollMode);
|
||||||
@ -1953,7 +1954,8 @@ void tst_QAbstractItemView::QTBUG50102_SH_ItemView_ScrollMode()
|
|||||||
QCOMPARE(view.horizontalScrollMode(), proxyScrollMode);
|
QCOMPARE(view.horizontalScrollMode(), proxyScrollMode);
|
||||||
|
|
||||||
// Change style, won't change value for vertical, will change for horizontal
|
// Change style, won't change value for vertical, will change for horizontal
|
||||||
view.setStyle(new ScrollModeProxyStyle(proxyScrollMode));
|
ScrollModeProxyStyle proxyStyle2(proxyScrollMode);
|
||||||
|
view.setStyle(&proxyStyle2);
|
||||||
QCOMPARE(view.verticalScrollMode(), proxyScrollMode);
|
QCOMPARE(view.verticalScrollMode(), proxyScrollMode);
|
||||||
QCOMPARE(view.horizontalScrollMode(), styleScrollMode);
|
QCOMPARE(view.horizontalScrollMode(), styleScrollMode);
|
||||||
}
|
}
|
||||||
|
@ -2523,7 +2523,8 @@ void tst_QHeaderView::calculateAndCheck(int cppline, const int precalced_compare
|
|||||||
const bool sanity_checks = true;
|
const bool sanity_checks = true;
|
||||||
if (sanity_checks) {
|
if (sanity_checks) {
|
||||||
QString msg = QString("sanity problem at ") + sline;
|
QString msg = QString("sanity problem at ") + sline;
|
||||||
char *verifytext = QTest::toString(msg);
|
const QScopedArrayPointer<char> holder(QTest::toString(msg));
|
||||||
|
const auto verifytext = holder.data();
|
||||||
|
|
||||||
QVERIFY2(m_tableview->model()->rowCount() == view->count() , verifytext);
|
QVERIFY2(m_tableview->model()->rowCount() == view->count() , verifytext);
|
||||||
QVERIFY2(view->visualIndex(lastindex + 1) <= 0, verifytext); // there is no such index in model
|
QVERIFY2(view->visualIndex(lastindex + 1) <= 0, verifytext); // there is no such index in model
|
||||||
@ -2555,7 +2556,8 @@ void tst_QHeaderView::calculateAndCheck(int cppline, const int precalced_compare
|
|||||||
msg += istr(chk_visual) + istr(chk_logical) + istr(chk_sizes) + istr(chk_hidden_size)
|
msg += istr(chk_visual) + istr(chk_logical) + istr(chk_sizes) + istr(chk_hidden_size)
|
||||||
+ istr(chk_lookup_visual) + istr(chk_lookup_logical) + istr(header_lenght, false) + "};";
|
+ istr(chk_lookup_visual) + istr(chk_lookup_logical) + istr(header_lenght, false) + "};";
|
||||||
|
|
||||||
char *verifytext = QTest::toString(msg);
|
const QScopedArrayPointer<char> holder(QTest::toString(msg));
|
||||||
|
const auto verifytext = holder.data();
|
||||||
|
|
||||||
QVERIFY2(chk_visual == x[0], verifytext);
|
QVERIFY2(chk_visual == x[0], verifytext);
|
||||||
QVERIFY2(chk_logical == x[1], verifytext);
|
QVERIFY2(chk_logical == x[1], verifytext);
|
||||||
|
@ -1350,7 +1350,7 @@ void tst_QItemDelegate::QTBUG4435_keepSelectionOnCheck()
|
|||||||
}
|
}
|
||||||
QTableView view;
|
QTableView view;
|
||||||
view.setModel(&model);
|
view.setModel(&model);
|
||||||
view.setItemDelegate(new TestItemDelegate);
|
view.setItemDelegate(new TestItemDelegate(&view));
|
||||||
view.show();
|
view.show();
|
||||||
view.selectAll();
|
view.selectAll();
|
||||||
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
QVERIFY(QTest::qWaitForWindowExposed(&view));
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user