summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qcompilerdetection.h5
-rw-r--r--src/corelib/global/qglobal.cpp41
-rw-r--r--src/corelib/global/qglobal.h7
-rw-r--r--src/corelib/global/qprocessordetection.h9
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp6
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/kernel/qobject_p.h1
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/corelib/tools/qarraydataops.h6
-rw-r--r--src/corelib/tools/qbytearray.cpp22
-rw-r--r--src/corelib/tools/qstring.cpp55
-rw-r--r--src/gui/configure.json24
-rw-r--r--src/gui/image/image.pri6
-rw-r--r--src/gui/image/qmovie.cpp4
-rw-r--r--src/gui/image/qmovie.h7
-rw-r--r--src/gui/painting/qdrawhelper.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp37
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h3
-rw-r--r--src/network/ssl/qsslcertificate.cpp5
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp27
-rw-r--r--src/platformsupport/eglconvenience/qt_egl_p.h6
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp9
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp28
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h2
-rw-r--r--src/platformsupport/input/input.pro4
-rw-r--r--src/platformsupport/input/integrityhid/integrityhid.pri7
-rw-r--r--src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp263
-rw-r--r--src/platformsupport/input/integrityhid/qintegrityhidmanager.h69
-rw-r--r--src/platformsupport/platformsupport.pro2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp8
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp7
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h1
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
-rw-r--r--src/printsupport/dialogs/dialogs.pri62
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.cpp4
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h7
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog_p.h10
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.cpp4
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.h7
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_mac.mm3
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_p.h6
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix.cpp11
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix_p.h5
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/printsupport/dialogs/qprintdialog.h7
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm4
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp15
-rw-r--r--src/printsupport/dialogs/qprintdialog_win.cpp4
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp6
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.h7
-rw-r--r--src/printsupport/doc/snippets/widgetprinting.cpp5
-rw-r--r--src/printsupport/kernel/kernel.pri7
-rw-r--r--src/printsupport/kernel/qcups.cpp4
-rw-r--r--src/printsupport/kernel/qcups_p.h4
-rw-r--r--src/printsupport/kernel/qpaintengine_preview.cpp3
-rw-r--r--src/printsupport/kernel/qpaintengine_preview_p.h4
-rw-r--r--src/printsupport/kernel/qplatformprintdevice.cpp2
-rw-r--r--src/printsupport/kernel/qprint_p.h4
-rw-r--r--src/printsupport/kernel/qprinter.cpp8
-rw-r--r--src/printsupport/kernel/qprinter_p.h6
-rw-r--r--src/printsupport/widgets/qcupsjobwidget.cpp4
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.cpp4
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.h3
-rw-r--r--src/printsupport/widgets/widgets.pri8
-rw-r--r--src/sql/configure.pri3
-rw-r--r--src/widgets/accessible/simplewidgets.cpp6
-rw-r--r--src/widgets/itemviews/qheaderview.cpp8
-rw-r--r--src/widgets/itemviews/qlistview.cpp11
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp11
-rw-r--r--src/widgets/itemviews/qtableview.cpp17
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp11
-rw-r--r--src/widgets/itemviews/qtreeview.cpp11
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp11
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp4
-rw-r--r--src/widgets/widgets/qcheckbox.cpp14
-rw-r--r--src/widgets/widgets/qcombobox.cpp4
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp33
-rw-r--r--src/widgets/widgets/qdial.cpp12
-rw-r--r--src/widgets/widgets/qgroupbox.cpp11
-rw-r--r--src/widgets/widgets/qlabel.cpp30
-rw-r--r--src/widgets/widgets/qlabel.h6
-rw-r--r--src/widgets/widgets/qlabel_p.h6
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp17
-rw-r--r--src/widgets/widgets/qlcdnumber.h5
-rw-r--r--src/widgets/widgets/qlineedit.cpp12
-rw-r--r--src/widgets/widgets/qmenu.cpp10
-rw-r--r--src/widgets/widgets/qprogressbar.cpp11
-rw-r--r--src/widgets/widgets/qpushbutton.cpp21
-rw-r--r--src/widgets/widgets/qradiobutton.cpp11
-rw-r--r--src/widgets/widgets/qscrollbar.cpp9
-rw-r--r--src/widgets/widgets/qslider.cpp11
-rw-r--r--src/widgets/widgets/qspinbox.cpp11
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp4
-rw-r--r--src/widgets/widgets/qsplashscreen.h6
-rw-r--r--src/widgets/widgets/qtabwidget.cpp11
-rw-r--r--src/widgets/widgets/widgets.pri19
100 files changed, 771 insertions, 523 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 173ada89de..c221115e8f 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -1246,6 +1246,11 @@
#else
# define QT_HAS_INCLUDE_NEXT(x) 0
#endif
+#ifdef __has_feature
+# define QT_HAS_FEATURE(x) __has_feature(x)
+#else
+# define QT_HAS_FEATURE(x) 0
+#endif
/*
* Warning/diagnostic handling
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index ea9d207177..c2c9ea4e67 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -86,6 +86,12 @@
# include <sys/systeminfo.h>
#endif
+#if defined(Q_OS_DARWIN)
+# include <mach/machine.h>
+# include <sys/sysctl.h>
+# include <sys/types.h>
+#endif
+
#ifdef Q_OS_UNIX
#include <sys/utsname.h>
#include <private/qcore_unix_p.h>
@@ -2484,6 +2490,20 @@ QString QSysInfo::currentCpuArchitecture()
case PROCESSOR_ARCHITECTURE_IA64:
return QStringLiteral("ia64");
}
+#elif defined(Q_OS_DARWIN)
+ cpu_type_t type;
+ size_t size = sizeof(type);
+ sysctlbyname("hw.cputype", &type, &size, NULL, 0);
+ switch (type) {
+ case CPU_TYPE_X86:
+ return QStringLiteral("i386");
+ case CPU_TYPE_X86_64:
+ return QStringLiteral("x86_64");
+ case CPU_TYPE_ARM:
+ return QStringLiteral("arm");
+ case CPU_TYPE_ARM64:
+ return QStringLiteral("arm64");
+ }
#elif defined(Q_OS_UNIX)
long ret = -1;
struct utsname u;
@@ -3306,20 +3326,26 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
Equivalent to
\code
- qgetenv(varName).toInt()
+ qgetenv(varName).toInt(ok, 0)
\endcode
except that it's much faster, and can't throw exceptions.
+ \note there's a limit on the length of the value, which is sufficient for
+ all valid values of int, not counting leading zeroes or spaces. Values that
+ are too long will either be truncated or this function will set \a ok to \c
+ false.
+
\sa qgetenv(), qEnvironmentVariableIsSet()
*/
int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
{
- QMutexLocker locker(&environmentMutex);
-#if defined(_MSC_VER) && _MSC_VER >= 1400
- // we provide a buffer that can hold any int value:
static const int NumBinaryDigitsPerOctalDigit = 3;
static const int MaxDigitsForOctalInt =
(std::numeric_limits<uint>::digits + NumBinaryDigitsPerOctalDigit - 1) / NumBinaryDigitsPerOctalDigit;
+
+ QMutexLocker locker(&environmentMutex);
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ // we provide a buffer that can hold any int value:
char buffer[MaxDigitsForOctalInt + 2]; // +1 for NUL +1 for optional '-'
size_t dummy;
if (getenv_s(&dummy, buffer, sizeof buffer, varName) != 0) {
@@ -3329,15 +3355,16 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
}
#else
const char * const buffer = ::getenv(varName);
- if (!buffer || !*buffer) {
+ if (!buffer || strlen(buffer) > MaxDigitsForOctalInt + 2) {
if (ok)
*ok = false;
return 0;
}
#endif
bool ok_ = true;
- const qlonglong value = qstrtoll(buffer, Q_NULLPTR, 0, &ok_);
- if (int(value) != value) { // this is the check in QByteArray::toInt(), keep it in sync
+ const char *endptr;
+ const qlonglong value = qstrtoll(buffer, &endptr, 0, &ok_);
+ if (int(value) != value || *endptr != '\0') { // this is the check in QByteArray::toInt(), keep it in sync
if (ok)
*ok = false;
return 0;
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index cfc6ef8b16..0628b524fb 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -647,7 +647,12 @@ inline void qt_noop(void) {}
*/
#if !defined(QT_NO_EXCEPTIONS)
-# if defined(QT_BOOTSTRAPPED) || (defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN))
+# if !defined(Q_MOC_RUN)
+# if (defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !QT_HAS_FEATURE(cxx_exceptions)) || \
+ (defined(Q_CC_GNU) && !defined(__EXCEPTIONS))
+# define QT_NO_EXCEPTIONS
+# endif
+# elif defined(QT_BOOTSTRAPPED)
# define QT_NO_EXCEPTIONS
# endif
#endif
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index ed11e013f2..0b260d01e3 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -94,8 +94,8 @@
ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
auto-detection implemented below.
*/
-#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__)
-# if defined(__aarch64__)
+#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__) || defined(__ARM64__)
+# if defined(__aarch64__) || defined(__ARM64__)
# define Q_PROCESSOR_ARM_64
# define Q_PROCESSOR_WORDSIZE 8
# else
@@ -109,7 +109,8 @@
# define Q_PROCESSOR_ARM _M_ARM
# elif defined(__ARM64_ARCH_8__) \
|| defined(__aarch64__) \
- || defined(__CORE_CORTEXAV8__) // GHS-specific for INTEGRITY
+ || defined(__ARMv8__) \
+ || defined(__ARMv8_A__)
# define Q_PROCESSOR_ARM 8
# elif defined(__ARM_ARCH_7__) \
|| defined(__ARM_ARCH_7A__) \
@@ -117,7 +118,7 @@
|| defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7S__) \
|| defined(_ARM_ARCH_7) \
- || defined(__CORE_CORTEXA__) // GHS-specific for INTEGRITY
+ || defined(__CORE_CORTEXA__)
# define Q_PROCESSOR_ARM 7
# elif defined(__ARM_ARCH_6__) \
|| defined(__ARM_ARCH_6J__) \
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index b9c9883609..9072b34f54 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -195,8 +195,12 @@ static bool shouldIncludeFs(const QStorageIterator &it)
#if defined(Q_OS_BSD4)
+#ifndef MNT_NOWAIT
+# define MNT_NOWAIT 0
+#endif
+
inline QStorageIterator::QStorageIterator()
- : entryCount(::getmntinfo(&stat_buf, 0)),
+ : entryCount(::getmntinfo(&stat_buf, MNT_NOWAIT)),
currentIndex(-1)
{
}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index c0737ffb36..f893cf06e3 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2044,7 +2044,7 @@ Qt::DropActions QAbstractItemModel::supportedDropActions() const
Qt::DropActions QAbstractItemModel::supportedDragActions() const
{
Q_D(const QAbstractItemModel);
- if (d->supportedDragActions != Qt::IgnoreAction)
+ if (int(d->supportedDragActions) != -1)
return d->supportedDragActions;
return supportedDropActions();
}
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 0a5d003b05..ad88bcf274 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -198,6 +198,7 @@ public:
static QObjectPrivate *get(QObject *o) {
return o->d_func();
}
+ static const QObjectPrivate *get(const QObject *o) { return o->d_func(); }
int signalIndex(const char *signalName, const QMetaObject **meta = 0) const;
inline bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index e636c6fe52..17c94e4e9d 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2363,7 +2363,7 @@ QByteArray QVariant::toByteArray() const
\fn QPoint QVariant::toPoint() const
Returns the variant as a QPoint if the variant has userType()
- \l QMetaType::QPointF or \l QMetaType::QPointF; otherwise returns a null
+ \l QMetaType::QPoint or \l QMetaType::QPointF; otherwise returns a null
QPoint.
\sa canConvert(), convert()
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index ae83e6986e..b7c3bc1287 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -49,6 +49,11 @@ QT_BEGIN_NAMESPACE
namespace QtPrivate {
+QT_WARNING_PUSH
+#if defined(Q_CC_GNU) && Q_CC_GNU >= 700
+QT_WARNING_DISABLE_GCC("-Wstringop-overflow")
+#endif
+
template <class T>
struct QPodArrayOps
: QTypedArrayData<T>
@@ -131,6 +136,7 @@ struct QPodArrayOps
this->size -= (e - b);
}
};
+QT_WARNING_POP
template <class T>
struct QGenericArrayOps
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index b5b48324e7..19c27d9ff8 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -4791,4 +4791,26 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA
\internal
*/
+/*!
+ \macro QByteArrayLiteral(ba)
+ \relates QByteArray
+
+ The macro generates the data for a QByteArray out of the string literal
+ \a ba at compile time. Creating a QByteArray from it is free in this case, and
+ the generated byte array data is stored in the read-only segment of the
+ compiled object file.
+
+ For instance:
+
+ \code
+ QByteArray ba = QByteArrayLiteral("byte array contents");
+ \endcode
+
+ Using QByteArrayLiteral instead of a double quoted plain C++ string literal
+ can significantly speed up creation of QByteArray instances from data known
+ at compile time.
+
+ \sa QStringLiteral
+*/
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 907de3cb4b..3826d7531a 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -11576,52 +11576,47 @@ QString QString::toHtmlEscaped() const
\macro QStringLiteral(str)
\relates QString
- The macro generates the data for a QString out of \a str at compile time if the compiler supports it.
- Creating a QString from it is free in this case, and the generated string data is stored in
- the read-only segment of the compiled object file.
+ The macro generates the data for a QString out of the string literal \a str
+ at compile time. Creating a QString from it is free in this case, and the
+ generated string data is stored in the read-only segment of the compiled
+ object file.
- For compilers not supporting the creation of compile time strings, QStringLiteral will fall back to
- QString::fromUtf8().
+ If you have code that looks like this:
- If you have code looking like:
\code
+ // hasAttribute takes a QString argument
if (node.hasAttribute("http-contents-length")) //...
\endcode
- One temporary QString will be created to be passed as the hasAttribute function parameter.
- This can be quite expensive, as it involves a memory allocation and the copy and the conversion
- of the data into QString's internal encoding.
- This can be avoided by doing
+ then a temporary QString will be created to be passed as the \c{hasAttribute}
+ function parameter. This can be quite expensive, as it involves a memory
+ allocation and the copy/conversion of the data into QString's internal
+ encoding.
+
+ This cost can be avoided by using QStringLiteral instead:
+
\code
if (node.hasAttribute(QStringLiteral("http-contents-length"))) //...
\endcode
- Then the QString's internal data will be generated at compile time and no conversion or allocation
- will occur at runtime
- Using QStringLiteral instead of a double quoted ascii literal can significantly speed up creation
- of QString's from data known at compile time.
+ In this case, QString's internal data will be generated at compile time; no
+ conversion or allocation will occur at runtime.
+
+ Using QStringLiteral instead of a double quoted plain C++ string literal can
+ significantly speed up creation of QString instances from data known at
+ compile time.
- If the compiler is C++11 enabled the string \a str can actually contain unicode data.
+ \note QLatin1String can still be more efficient than QStringLiteral
+ when the string is passed to a function that has an overload taking
+ QLatin1String and this overload avoids conversion to QString. For
+ instance, QString::operator==() can compare to a QLatin1String
+ directly:
- \note There are still a few cases in which QLatin1String is more efficient than QStringLiteral:
- If it is passed to a function that has an overload that takes the QLatin1String directly, without
- conversion to QString. For instance, this is the case of QString::operator==
\code
if (attribute.name() == QLatin1String("http-contents-length")) //...
\endcode
- \note There are some restrictions when using the MSVC 2010 or 2012 compilers. The example snippets
- provided here fail to compile with them.
- \list
- \li Concatenated string literals cannot be used with QStringLiteral.
- \code
- QString s = QStringLiteral("a" "b");
- \endcode
- \li QStringLiteral cannot be used to initialize lists or arrays of QString.
- \code
- QString a[] = { QStringLiteral("a"), QStringLiteral("b") };
- \endcode
- \endlist
+ \sa QByteArrayLiteral
*/
/*!
diff --git a/src/gui/configure.json b/src/gui/configure.json
index d074bf6794..7c4ea48f2e 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -87,7 +87,8 @@
"test": "qpa/kms",
"sources": [
{ "type": "pkgConfig", "args": "libdrm" },
- "-ldrm"
+ { "libs": "-ldrm", "condition": "!config.integrity" },
+ { "libs": "-ldrm-nvdc -lposix -livfs -lnvll -lnvdc -lnvrm -lnvrm_graphics -lnvos -lnvtegrahv", "condition": "config.integrity" }
]
},
"egl": {
@@ -150,6 +151,13 @@
{ "type": "pkgConfig", "args": "libinput" }
]
},
+ "integrityhid": {
+ "label": "integrityhid",
+ "test": "qpa/integrityhid",
+ "sources": [
+ { "libs": "-lhiddev -lusbhid -lusb" }
+ ]
+ },
"libjpeg": {
"label": "libjpeg",
"test": "unix/libjpeg",
@@ -379,6 +387,11 @@
"type": "compile",
"test": "unix/evdev"
},
+ "integrityfb": {
+ "label": "INTEGRITY framebuffer",
+ "type": "compile",
+ "test": "qpa/integrityfb"
+ },
"libinput_axis_api": {
"label": "axis API in libinput",
"type": "compile",
@@ -447,7 +460,6 @@
"combined-angle-lib": {
"label": "Combined ANGLE Library",
"autoDetect": false,
- "enable": "features.angle",
"condition": "features.angle",
"output": [ "publicFeature" ]
},
@@ -526,7 +538,7 @@
"integrityfb": {
"label": "INTEGRITY framebuffer",
"section": "Platform plugins",
- "condition": "config.integrity",
+ "condition": "config.integrity && tests.integrityfb",
"output": [ "privateFeature" ]
},
"kms": {
@@ -539,6 +551,11 @@
"condition": "features.libudev && libs.libinput",
"output": [ "privateFeature" ]
},
+ "integrityhid": {
+ "label": "INTEGRITY HID",
+ "condition": "config.integrity && libs.integrityhid",
+ "output": [ "privateFeature" ]
+ },
"libinput-axis-api": {
"label": "axis API in libinput",
"condition": "features.libinput && tests.libinput_axis_api",
@@ -1144,6 +1161,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"entries": [
"evdev",
"libinput",
+ "integrityhid",
"mtdev",
"tslib",
"xkbcommon-evdev"
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index bac00f7e95..76aba944b2 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -10,7 +10,6 @@ HEADERS += \
image/qimageiohandler.h \
image/qimagereader.h \
image/qimagewriter.h \
- image/qmovie.h \
image/qpaintengine_pic_p.h \
image/qpicture.h \
image/qpicture_p.h \
@@ -41,7 +40,6 @@ SOURCES += \
image/qpixmap.cpp \
image/qpixmapcache.cpp \
image/qplatformpixmap.cpp \
- image/qmovie.cpp \
image/qpixmap_raster.cpp \
image/qpixmap_blitter.cpp \
image/qimagepixmapcleanuphooks.cpp \
@@ -50,6 +48,10 @@ SOURCES += \
image/qiconengine.cpp \
image/qiconengineplugin.cpp \
+qtConfig(movie) {
+ HEADERS += image/qmovie.h
+ SOURCES += image/qmovie.cpp
+}
win32:!winrt: SOURCES += image/qpixmap_win.cpp
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index 3889b747db..2ff9fb4e36 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -174,8 +174,6 @@
#include "qmovie.h"
-#ifndef QT_NO_MOVIE
-
#include "qglobal.h"
#include "qimage.h"
#include "qimagereader.h"
@@ -1062,5 +1060,3 @@ void QMovie::setCacheMode(CacheMode cacheMode)
QT_END_NAMESPACE
#include "moc_qmovie.cpp"
-
-#endif // QT_NO_MOVIE
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index ab8ef82aa0..ca559d491b 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -42,15 +42,14 @@
#include <QtGui/qtguiglobal.h>
-#ifndef QT_NO_MOVIE
-
#include <QtCore/qobject.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtGui/qimagereader.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(movie);
+QT_BEGIN_NAMESPACE
class QByteArray;
class QColor;
@@ -146,6 +145,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_MOVIE
-
#endif // QMOVIE_H
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index dc630aa931..4152d0184f 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -6010,7 +6010,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] =
// Format_ARGB32,
{
blend_color_generic,
- qt_gradient_argb32,
+ blend_src_generic,
qt_bitmapblit_argb32,
qt_alphamapblit_argb32,
qt_alphargbblit_argb32,
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 0625ea65da..38c2b6e8c0 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -1250,20 +1250,22 @@ void QNativeSocketEngine::handleConnectOpFinished(bool success, QAbstractSocket:
void QNativeSocketEngine::handleNewDatagrams(const QList<WinRtDatagram> &datagrams)
{
Q_D(QNativeSocketEngine);
- // Defer putting the datagrams into the list until the next event loop iteration
- // (where the readyRead signal is emitted as well)
- QMetaObject::invokeMethod(this, "putIntoPendingDatagramsList", Qt::QueuedConnection,
- Q_ARG(QList<WinRtDatagram>, datagrams));
+ QMutexLocker locker(&d->readMutex);
+ d->pendingDatagrams.append(datagrams);
if (d->notifyOnRead)
emit readReady();
}
void QNativeSocketEngine::handleNewData(const QVector<QByteArray> &data)
{
- // Defer putting the data into the list until the next event loop iteration
- // (where the readyRead signal is emitted as well)
- QMetaObject::invokeMethod(this, "putIntoPendingData", Qt::QueuedConnection,
- Q_ARG(QVector<QByteArray>, data));
+ Q_D(QNativeSocketEngine);
+ QMutexLocker locker(&d->readMutex);
+ d->pendingData.append(data);
+ for (const QByteArray &newData : data)
+ d->bytesAvailable += newData.length();
+ locker.unlock();
+ if (d->notifyOnRead)
+ readNotification();
}
void QNativeSocketEngine::handleTcpError(QAbstractSocket::SocketError error)
@@ -1284,25 +1286,6 @@ void QNativeSocketEngine::handleTcpError(QAbstractSocket::SocketError error)
emit readReady();
}
-void QNativeSocketEngine::putIntoPendingDatagramsList(const QList<WinRtDatagram> &datagrams)
-{
- Q_D(QNativeSocketEngine);
- QMutexLocker locker(&d->readMutex);
- d->pendingDatagrams.append(datagrams);
-}
-
-void QNativeSocketEngine::putIntoPendingData(const QVector<QByteArray> &data)
-{
- Q_D(QNativeSocketEngine);
- QMutexLocker locker(&d->readMutex);
- d->pendingData.append(data);
- for (const QByteArray &newData : data)
- d->bytesAvailable += newData.length();
- locker.unlock();
- if (d->notifyOnRead)
- readNotification();
-}
-
bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
{
Q_UNUSED(socketProtocol);
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
index 6528c6d627..13922cb397 100644
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ b/src/network/socket/qnativesocketengine_winrt_p.h
@@ -183,9 +183,6 @@ private slots:
void handleTcpError(QAbstractSocket::SocketError error);
private:
- Q_INVOKABLE void putIntoPendingDatagramsList(const QList<WinRtDatagram> &datagrams);
- Q_INVOKABLE void putIntoPendingData(const QVector<QByteArray> &data);
-
Q_DECLARE_PRIVATE(QNativeSocketEngine)
Q_DISABLE_COPY(QNativeSocketEngine)
};
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index ce78399e01..6433b84e80 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -143,7 +143,7 @@ QSslCertificate::QSslCertificate(QIODevice *device, QSsl::EncodingFormat format)
: d(new QSslCertificatePrivate)
{
QSslSocketPrivate::ensureInitialized();
- if (device)
+ if (device && QSslSocket::supportsSsl())
d->init(device->readAll(), format);
}
@@ -157,7 +157,8 @@ QSslCertificate::QSslCertificate(const QByteArray &data, QSsl::EncodingFormat fo
: d(new QSslCertificatePrivate)
{
QSslSocketPrivate::ensureInitialized();
- d->init(data, format);
+ if (QSslSocket::supportsSsl())
+ d->init(data, format);
}
/*!
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 0456b7cdc7..0a9588deea 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -1226,9 +1226,32 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
QCFType<SecCertificateRef> certRef = SecCertificateCreateWithData(NULL, certData);
CFArrayAppendValue(certArray, certRef);
}
+
SecTrustSetAnchorCertificates(trust, certArray);
- // Secure Transport should use anchors only from our QSslConfiguration:
- SecTrustSetAnchorCertificatesOnly(trust, true);
+
+ // By default SecTrustEvaluate uses both CA certificates provided in
+ // QSslConfiguration and the ones from the system database. This behavior can
+ // be unexpected if a user's code tries to limit the trusted CAs to those
+ // explicitly set in QSslConfiguration.
+ // Since on macOS we initialize the default QSslConfiguration copying the
+ // system CA certificates (using SecTrustSettingsCopyCertificates) we can
+ // call SecTrustSetAnchorCertificatesOnly(trust, true) to force SecTrustEvaluate
+ // to use anchors only from our QSslConfiguration.
+ // Unfortunately, SecTrustSettingsCopyCertificates is not available on iOS
+ // and the default QSslConfiguration always has an empty list of system CA
+ // certificates. This leaves no way to provide client code with access to the
+ // actual system CA certificate list (which most use-cases need) other than
+ // by letting SecTrustEvaluate fall through to the system list; so, in this case
+ // (even though the client code may have provided its own certs), we retain
+ // the default behavior.
+
+#ifdef Q_OS_MACOS
+ const bool anchorsFromConfigurationOnly = true;
+#else
+ const bool anchorsFromConfigurationOnly = false;
+#endif
+
+ SecTrustSetAnchorCertificatesOnly(trust, anchorsFromConfigurationOnly);
SecTrustResultType trustResult = kSecTrustResultInvalid;
SecTrustEvaluate(trust, &trustResult);
diff --git a/src/platformsupport/eglconvenience/qt_egl_p.h b/src/platformsupport/eglconvenience/qt_egl_p.h
index b1495c9f9d..e2c6b0ceb6 100644
--- a/src/platformsupport/eglconvenience/qt_egl_p.h
+++ b/src/platformsupport/eglconvenience/qt_egl_p.h
@@ -53,8 +53,10 @@
#ifdef QT_EGL_NO_X11
# define MESA_EGL_NO_X11_HEADERS // MESA
-# define WIN_INTERFACE_CUSTOM // NV
-#endif // QT_EGL_NO_X11
+# if !defined(Q_OS_INTEGRITY)
+# define WIN_INTERFACE_CUSTOM // NV
+# endif // Q_OS_INTEGRITY
+#endif // QT_EGL_NO_X11
#ifdef QT_EGL_WAYLAND
# define WAYLAND // NV
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 39b6814a57..64a0ef6fe8 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -967,15 +967,10 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
if (format == Format_Mono) {
load_target = FT_LOAD_TARGET_MONO;
} else if (format == Format_A32) {
- if (subpixelType == Subpixel_RGB || subpixelType == Subpixel_BGR) {
- if (default_hint_style == HintFull)
- load_target = FT_LOAD_TARGET_LCD;
+ if (subpixelType == Subpixel_RGB || subpixelType == Subpixel_BGR)
hsubpixel = true;
- } else if (subpixelType == Subpixel_VRGB || subpixelType == Subpixel_VBGR) {
- if (default_hint_style == HintFull)
- load_target = FT_LOAD_TARGET_LCD_V;
+ else if (subpixelType == Subpixel_VRGB || subpixelType == Subpixel_VBGR)
vfactor = 3;
- }
} else if (format == Format_ARGB) {
#ifdef FT_LOAD_COLOR
load_flags |= FT_LOAD_COLOR;
diff --git a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
index 2a95ca26a9..db58e49bb2 100644
--- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
@@ -448,19 +448,41 @@ QFontEngine *QWinRTFontDatabase::fontEngine(const QFontDef &fontDef, void *handl
return QFontEngineFT::create(fontDef, faceId, fontData);
}
+QString QWinRTFontDatabase::familyForStyleHint(QFont::StyleHint styleHint)
+{
+ switch (styleHint) {
+ case QFont::Times:
+ return QStringLiteral("Times New Roman");
+ case QFont::Courier:
+ return QStringLiteral("Courier New");
+ case QFont::Monospace:
+ return QStringLiteral("Courier New");
+ case QFont::Cursive:
+ return QStringLiteral("Comic Sans MS");
+ case QFont::Fantasy:
+ return QStringLiteral("Impact");
+ case QFont::Decorative:
+ return QStringLiteral("Old English");
+ case QFont::Helvetica:
+ return QStringLiteral("Segoe UI");
+ case QFont::System:
+ default:
+ break;
+ }
+ return QStringLiteral("Segoe UI");
+}
+
QStringList QWinRTFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style,
QFont::StyleHint styleHint,
QChar::Script script) const
{
Q_UNUSED(style)
- Q_UNUSED(styleHint)
Q_UNUSED(script)
qCDebug(lcQpaFonts) << __FUNCTION__ << family;
QStringList result;
- if (family == QLatin1String("Helvetica"))
- result.append(QStringLiteral("Arial"));
+ result.append(QWinRTFontDatabase::familyForStyleHint(styleHint));
result.append(QFreeTypeFontDatabase::fallbacksForFamily(family, style, styleHint, script));
return result;
}
diff --git a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
index 9a2bf00fab..c21f411fff 100644
--- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
@@ -80,6 +80,8 @@ public:
QStringList fallbacksForFamily(const QString &family, QFont::Style style,
QFont::StyleHint styleHint, QChar::Script script) const override;
void releaseHandle(void *handle) override;
+
+ static QString familyForStyleHint(QFont::StyleHint styleHint);
private:
QHash<IDWriteFontFile *, FontDescription> m_fonts;
QHash<QString, IDWriteFontFamily *> m_fontFamilies;
diff --git a/src/platformsupport/input/input.pro b/src/platformsupport/input/input.pro
index f8ff4344cf..3d39210b9e 100644
--- a/src/platformsupport/input/input.pro
+++ b/src/platformsupport/input/input.pro
@@ -28,4 +28,8 @@ qtConfig(evdev)|qtConfig(libinput) {
include($$PWD/shared/shared.pri)
}
+qtConfig(integrityhid) {
+ include($$PWD/integrityhid/integrityhid.pri)
+}
+
load(qt_module)
diff --git a/src/platformsupport/input/integrityhid/integrityhid.pri b/src/platformsupport/input/integrityhid/integrityhid.pri
new file mode 100644
index 0000000000..0a6240c422
--- /dev/null
+++ b/src/platformsupport/input/integrityhid/integrityhid.pri
@@ -0,0 +1,7 @@
+HEADERS += \
+ $$PWD/qintegrityhidmanager.h
+
+SOURCES += \
+ $$PWD/qintegrityhidmanager.cpp
+
+QMAKE_USE_PRIVATE += integrityhid
diff --git a/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
new file mode 100644
index 0000000000..8089a6e38b
--- /dev/null
+++ b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
@@ -0,0 +1,263 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Green Hills Software
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** 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$
+**
+****************************************************************************/
+
+#include "qintegrityhidmanager.h"
+#include <QList>
+#include <QPoint>
+#include <QGuiApplication>
+#include <qpa/qwindowsysteminterface.h>
+#include <device/hiddriver.h>
+#include <private/qguiapplication_p.h>
+#include <private/qinputdevicemanager_p_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class IntNotifier
+{
+ static const Value ActivityPriority = 2;
+protected:
+ Activity act;
+public:
+ IntNotifier()
+ {
+ CheckSuccess(CreateActivity(CurrentTask(), ActivityPriority, false, (Value)this, &act));
+ };
+ ~IntNotifier()
+ {
+ CheckSuccess(CloseActivity(act));
+ };
+ virtual void process_event() = 0;
+ virtual void async_wait() = 0;
+};
+
+class HIDDeviceHandler : IntNotifier
+{
+public:
+ HIDDeviceHandler(HIDDriver *hidd, HIDHandle hidh)
+ : driver(hidd), handle(hidh), currentPos(0, 0) { }
+ ~HIDDeviceHandler()
+ {
+ CheckSuccess(gh_hid_close(handle));
+ };
+ void process_event(void) Q_DECL_OVERRIDE;
+ void async_wait(void) Q_DECL_OVERRIDE;
+ HIDDriver *get_driver(void) { return driver; };
+ HIDHandle get_handle(void) { return handle; };
+private:
+ HIDDriver *driver;
+ HIDHandle handle;
+ QPoint currentPos;
+ Qt::MouseButtons buttons;
+};
+
+class HIDDriverHandler : IntNotifier
+{
+public:
+ HIDDriverHandler(HIDDriver *hidd) : IntNotifier(), driver(hidd) { }
+ ~HIDDriverHandler()
+ {
+ qDeleteAll(devices);
+ };
+ void process_event(void) Q_DECL_OVERRIDE;
+ void async_wait(void) Q_DECL_OVERRIDE;
+ void find_devices(void);
+private:
+ QHash<Value, HIDDeviceHandler *> devices;
+ HIDDriver *driver;
+};
+
+void HIDDriverHandler::process_event()
+{
+ find_devices();
+}
+
+void HIDDriverHandler::async_wait()
+{
+ gh_hid_wait_for_new_device(driver, act);
+}
+
+void HIDDriverHandler::find_devices()
+{
+ Error err;
+ uintptr_t devicecontext;
+ uint32_t device_id;
+ HIDHandle handle;
+ HIDDeviceHandler *hidnot;
+ int deviceCount = 0;
+
+ devicecontext = 0;
+ forever {
+ err = gh_hid_enum_devices(driver, &device_id, &devicecontext);
+ if (err == OperationNotImplemented)
+ break;
+ else if (err == Failure)
+ break;
+ if (!devices.contains(device_id)) {
+ err = gh_hid_init_device(driver, device_id, &handle);
+ if (err == Success) {
+ hidnot = new HIDDeviceHandler(driver, handle);
+ devices.insert(device_id, hidnot);
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypePointer,++deviceCount);
+ hidnot->async_wait();
+ }
+ }
+ }
+ if (err == OperationNotImplemented) {
+ /* fallback on legacy enumeration where we assume 0-based
+ * contiguous indexes */
+ device_id = 0;
+ err = Success;
+ do {
+ if (!devices.contains(device_id)) {
+ err = gh_hid_init_device(driver, device_id, &handle);
+ if (err != Success)
+ break;
+ hidnot = new HIDDeviceHandler(driver, handle);
+ devices.insert(device_id, hidnot);
+ hidnot->async_wait();
+ }
+ device_id++;
+ } while (err == Success);
+ }
+
+ async_wait();
+}
+
+
+void HIDDeviceHandler::process_event()
+{
+ HIDEvent event;
+ uint32_t num_events = 1;
+
+ while (gh_hid_get_event(handle, &event, &num_events) == Success) {
+ if (event.type == HID_TYPE_AXIS) {
+ switch (event.index) {
+ case HID_AXIS_ABSX:
+ currentPos.setX(event.value);
+ break;
+ case HID_AXIS_ABSY:
+ currentPos.setY(event.value);
+ break;
+ case HID_AXIS_RELX:
+ currentPos.setX(currentPos.x() + event.value);
+ break;
+ case HID_AXIS_RELY:
+ currentPos.setY(currentPos.y() + event.value);
+ break;
+ default:
+ /* ignore the rest for now */
+ break;
+ }
+ } else if (event.type == HID_TYPE_KEY) {
+ switch (event.index) {
+ case HID_BUTTON_LEFT:
+ if (event.value)
+ buttons |= Qt::LeftButton;
+ else
+ buttons &= ~Qt::LeftButton;
+ break;
+ case HID_BUTTON_MIDDLE:
+ if (event.value)
+ buttons |= Qt::MiddleButton;
+ else
+ buttons &= ~Qt::MiddleButton;
+ break;
+ case HID_BUTTON_RIGHT:
+ if (event.value)
+ buttons |= Qt::RightButton;
+ else
+ buttons &= ~Qt::RightButton;
+ break;
+ default:
+ /* ignore the rest for now */
+ break;
+ }
+ } else if (event.type == HID_TYPE_SYNC) {
+ QWindowSystemInterface::handleMouseEvent(0, currentPos, currentPos, buttons,
+ QGuiApplication::keyboardModifiers());
+ } else if (event.type == HID_TYPE_DISCONNECT) {
+ /* FIXME */
+ }
+ }
+ async_wait();
+}
+
+void HIDDeviceHandler::async_wait()
+{
+ CheckSuccess(gh_hid_async_wait_for_event(handle, act));
+}
+
+void QIntegrityHIDManager::open_devices()
+{
+ HIDDriver *hidd;
+ uintptr_t context = 0;
+ HIDDriverHandler *hidnot;
+
+ while (gh_hid_enum_drivers(&hidd, &context) == Success) {
+ hidnot = new HIDDriverHandler(hidd);
+ m_drivers.append(hidnot);
+ hidnot->find_devices();
+ }
+}
+
+void QIntegrityHIDManager::run()
+{
+ IntNotifier *notifier;
+ open_devices();
+ /* main loop */
+ forever {
+ WaitForActivity((Value *)&notifier);
+ notifier->process_event();
+ }
+}
+
+QIntegrityHIDManager::QIntegrityHIDManager(const QString &key, const QString &spec, QObject *parent)
+ : QThread(parent)
+{
+ start();
+}
+
+QIntegrityHIDManager::~QIntegrityHIDManager()
+{
+ terminate();
+ qDeleteAll(m_drivers);
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/input/integrityhid/qintegrityhidmanager.h b/src/platformsupport/input/integrityhid/qintegrityhidmanager.h
new file mode 100644
index 0000000000..c8780b2dc2
--- /dev/null
+++ b/src/platformsupport/input/integrityhid/qintegrityhidmanager.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Green Hills Software
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** 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$
+**
+****************************************************************************/
+
+#ifndef QINTEGRITYHIDMANAGER_P_H
+#define QINTEGRITYHIDMANAGER_P_H
+
+#include <QObject>
+#include <QList>
+#include <QThread>
+
+QT_BEGIN_NAMESPACE
+
+class HIDDriverHandler;
+
+class QIntegrityHIDManager : public QThread
+{
+ Q_OBJECT
+public:
+ QIntegrityHIDManager(const QString &key, const QString &specification, QObject *parent = 0);
+ ~QIntegrityHIDManager();
+
+ void run(void);
+private:
+ void open_devices(void);
+
+ QString m_spec;
+ QList<HIDDriverHandler *> m_drivers;
+
+};
+
+QT_END_NAMESPACE
+
+#endif // QINTEGRITYHIDMANAGER_P_H
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index f3f2c1c99a..248c1ae667 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -11,7 +11,7 @@ SUBDIRS = \
qtConfig(freetype)|darwin|win32: \
SUBDIRS += fontdatabases
-qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput) {
+qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput)|qtConfig(integrityhid) {
SUBDIRS += input
input.depends += devicediscovery
}
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 8b751a72bf..9a0be489a8 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -92,6 +92,10 @@
#include <QtInputSupport/private/qtslib_p.h>
#endif
+#if QT_CONFIG(integrityhid)
+#include <QtInputSupport/qintegrityhidmanager.h>
+#endif
+
#include <QtPlatformHeaders/qeglfsfunctions.h>
static void initResources()
@@ -466,6 +470,10 @@ void QEglFSIntegration::createInputHandlers()
#endif
new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
#endif
+
+#if QT_CONFIG(integrityhid)
+ new QIntegrityHIDManager("HID", "", this);
+#endif
}
EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
index 43bdb77a18..3af21d768e 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -56,6 +56,13 @@ QEglFSKmsEglDeviceIntegration::QEglFSKmsEglDeviceIntegration()
qCDebug(qLcEglfsKmsDebug, "New DRM/KMS on EGLDevice integration created");
}
+QSurfaceFormat QEglFSKmsEglDeviceIntegration::surfaceFormatFor(const QSurfaceFormat &inputFormat) const
+{
+ QSurfaceFormat format = QEglFSKmsIntegration::surfaceFormatFor(inputFormat);
+ format.setAlphaBufferSize(8);
+ return format;
+}
+
EGLint QEglFSKmsEglDeviceIntegration::surfaceType() const
{
return EGL_STREAM_BIT_KHR;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
index 62404cfcd1..5819d82ebf 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
@@ -55,6 +55,7 @@ class QEglFSKmsEglDeviceIntegration : public QEglFSKmsIntegration
public:
QEglFSKmsEglDeviceIntegration();
+ QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const override;
EGLint surfaceType() const override;
EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay) override;
bool supportsSurfacelessContexts() const override;
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 2f459b70ec..c2d7632e89 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -977,8 +977,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
state = state ^ Qt::ShiftModifier;
else if (code == Qt::Key_Alt)
state = state ^ Qt::AltModifier;
- else if (code == 0 && modifiersIndex != 0)
- code = keyLayout[vk_key].qtKey[0];
+
// If the bit 24 of lParm is set you received a enter,
// otherwise a Return. (This is the extended key bit)
if ((code == Qt::Key_Return) && (msg.lParam & 0x1000000))
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 7451090cbf..1a360239c3 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -156,6 +156,14 @@ QXcbScreen *QXcbWindow::parentScreen()
return parent() ? static_cast<QXcbWindow*>(parent())->parentScreen() : xcbScreen();
}
+//QPlatformWindow::screenForGeometry version that uses deviceIndependentGeometry
+QXcbScreen *QXcbWindow::initialScreen() const
+{
+ QWindowPrivate *windowPrivate = qt_window_private(window());
+ QScreen *screen = windowPrivate->screenForGeometry(window()->geometry());
+ return static_cast<QXcbScreen*>(screen->handle());
+}
+
// Returns \c true if we should set WM_TRANSIENT_FOR on \a w
static inline bool isTransient(const QWindow *w)
{
@@ -356,8 +364,8 @@ void QXcbWindow::create()
Qt::WindowType type = window()->type();
QXcbScreen *currentScreen = xcbScreen();
- QRect rect = windowGeometry();
- QXcbScreen *platformScreen = parent() ? parentScreen() : static_cast<QXcbScreen*>(screenForGeometry(rect));
+ QXcbScreen *platformScreen = parent() ? parentScreen() : initialScreen();
+ QRect rect = QHighDpi::toNativePixels(window()->geometry(), platformScreen);
if (type == Qt::Desktop) {
m_window = platformScreen->root();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 3e539337b1..5e09865d33 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -191,6 +191,7 @@ protected:
QXcbScreen *parentScreen();
+ QXcbScreen *initialScreen() const;
void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0);
NetWmStates netWmStates();
void setNetWmStates(NetWmStates);
diff --git a/src/printsupport/dialogs/dialogs.pri b/src/printsupport/dialogs/dialogs.pri
index 7b520a05de..0a7b947c79 100644
--- a/src/printsupport/dialogs/dialogs.pri
+++ b/src/printsupport/dialogs/dialogs.pri
@@ -1,40 +1,46 @@
# Qt dialogs module
-HEADERS += \
+INCLUDEPATH += $$PWD
+
+qtConfig(printdialog) {
+ HEADERS += \
dialogs/qabstractprintdialog.h \
dialogs/qabstractprintdialog_p.h \
dialogs/qpagesetupdialog_p.h \
dialogs/qpagesetupdialog.h \
- dialogs/qprintdialog.h \
- dialogs/qprintpreviewdialog.h
+ dialogs/qprintdialog.h
-osx {
- OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \
- dialogs/qprintdialog_mac.mm
- LIBS_PRIVATE += -framework AppKit
-}
+ macos {
+ OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \
+ dialogs/qprintdialog_mac.mm
+ LIBS_PRIVATE += -framework AppKit
+ }
-win32 {
- SOURCES += dialogs/qpagesetupdialog_win.cpp \
- dialogs/qprintdialog_win.cpp
-}
+ win32 {
+ SOURCES += dialogs/qpagesetupdialog_win.cpp \
+ dialogs/qprintdialog_win.cpp
+ }
-unix:!mac {
- INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/printsupport/cups
- HEADERS += dialogs/qpagesetupdialog_unix_p.h
- SOURCES += dialogs/qprintdialog_unix.cpp \
- dialogs/qpagesetupdialog_unix.cpp
- FORMS += dialogs/qprintsettingsoutput.ui \
- dialogs/qprintwidget.ui \
- dialogs/qprintpropertieswidget.ui
-}
+ unix:!darwin {
+ INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/printsupport/cups
+ HEADERS += dialogs/qpagesetupdialog_unix_p.h
+ SOURCES += dialogs/qprintdialog_unix.cpp \
+ dialogs/qpagesetupdialog_unix.cpp
+ FORMS += dialogs/qprintsettingsoutput.ui \
+ dialogs/qprintwidget.ui \
+ dialogs/qprintpropertieswidget.ui
+ }
-INCLUDEPATH += $$PWD
-
-SOURCES += \
+ SOURCES += \
dialogs/qabstractprintdialog.cpp \
- dialogs/qpagesetupdialog.cpp \
- dialogs/qprintpreviewdialog.cpp
+ dialogs/qpagesetupdialog.cpp
+
+ FORMS += dialogs/qpagesetupwidget.ui
+ RESOURCES += dialogs/qprintdialog.qrc
+}
+
+qtConfig(printpreviewdialog) {
+ HEADERS += dialogs/qprintpreviewdialog.h
+ SOURCES += dialogs/qprintpreviewdialog.cpp
+}
-FORMS += dialogs/qpagesetupwidget.ui
-RESOURCES += dialogs/qprintdialog.qrc
diff --git a/src/printsupport/dialogs/qabstractprintdialog.cpp b/src/printsupport/dialogs/qabstractprintdialog.cpp
index 3c5f882f2e..f982da46d9 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.cpp
+++ b/src/printsupport/dialogs/qabstractprintdialog.cpp
@@ -43,8 +43,6 @@
#include "qprinter.h"
#include "private/qprinter_p.h"
-#ifndef QT_NO_PRINTDIALOG
-
QT_BEGIN_NAMESPACE
// hack
@@ -497,5 +495,3 @@ void QPrintDialog::open(QObject *receiver, const char *member)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index e6d34cdb5b..eb4dc3eb99 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#if QT_CONFIG(printdialog)
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
+QT_BEGIN_NAMESPACE
class QAbstractPrintDialogPrivate;
class QPrinter;
@@ -120,6 +119,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions)
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QABSTRACTPRINTDIALOG_H
diff --git a/src/printsupport/dialogs/qabstractprintdialog_p.h b/src/printsupport/dialogs/qabstractprintdialog_p.h
index 12de4ee882..2537fcbf80 100644
--- a/src/printsupport/dialogs/qabstractprintdialog_p.h
+++ b/src/printsupport/dialogs/qabstractprintdialog_p.h
@@ -53,14 +53,12 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "private/qdialog_p.h"
#include "QtPrintSupport/qabstractprintdialog.h"
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
-#ifndef QT_NO_PRINTER
+QT_BEGIN_NAMESPACE
class QPrinter;
class QPrinterPrivate;
@@ -92,10 +90,6 @@ public:
int maxPage;
};
-#endif //QT_NO_PRINTER
-
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QABSTRACTPRINTDIALOG_P_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog.cpp b/src/printsupport/dialogs/qpagesetupdialog.cpp
index 911c0ecdf7..4acac2c5f1 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog.cpp
@@ -42,8 +42,6 @@
#include <QtPrintSupport/qprinter.h>
-#ifndef QT_NO_PRINTDIALOG
-
QT_BEGIN_NAMESPACE
/*!
@@ -183,5 +181,3 @@ void QPageSetupDialog::done(int result)
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/printsupport/dialogs/qpagesetupdialog.h b/src/printsupport/dialogs/qpagesetupdialog.h
index bc7462ebaa..3bd752a413 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.h
+++ b/src/printsupport/dialogs/qpagesetupdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
+QT_BEGIN_NAMESPACE
class QPrinter;
class QPageSetupDialogPrivate;
@@ -77,6 +76,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QPAGESETUPDIALOG_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
index 581c0271f1..1e398452f7 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
+++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
@@ -42,7 +42,6 @@
#include "qpagesetupdialog.h"
-#ifndef QT_NO_PRINTDIALOG
#include "qpagesetupdialog_p.h"
#include <qpa/qplatformnativeinterface.h>
@@ -222,5 +221,3 @@ int QPageSetupDialog::exec()
}
QT_END_NAMESPACE
-
-#endif /* QT_NO_PRINTDIALOG */
diff --git a/src/printsupport/dialogs/qpagesetupdialog_p.h b/src/printsupport/dialogs/qpagesetupdialog_p.h
index 98b466ccdc..6a389b039a 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_p.h
+++ b/src/printsupport/dialogs/qpagesetupdialog_p.h
@@ -54,14 +54,14 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "private/qdialog_p.h"
#include "qbytearray.h"
#include "qpagesetupdialog.h"
#include "qpointer.h"
+QT_REQUIRE_CONFIG(printdialog);
+
QT_BEGIN_NAMESPACE
class QPrinter;
@@ -83,6 +83,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QPAGESETUPDIALOG_P_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
index 98d657bed4..b4ad718646 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
@@ -39,12 +39,13 @@
#include "qpagesetupdialog.h"
-#ifndef QT_NO_PRINTDIALOG
#include "qpagesetupdialog_unix_p.h"
#include <private/qpagesetupdialog_p.h>
#include <private/qprintdevice_p.h>
+#if QT_CONFIG(cups)
#include <private/qcups_p.h>
+#endif
#include "qpainter.h"
#include "qprintdialog.h"
@@ -294,7 +295,7 @@ void QPageSetupWidget::initUnits()
// Init the Pages Per Sheet (n-up) combo boxes if using CUPS
void QPageSetupWidget::initPagesPerSheet()
{
-#if !defined(QT_NO_CUPS)
+#if QT_CONFIG(cups)
m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Top to Bottom"),
QVariant::fromValue(QCUPSSupport::LeftToRightTopToBottom));
m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Bottom to Top"),
@@ -498,7 +499,7 @@ void QPageSetupWidget::updateWidget()
void QPageSetupWidget::setupPrinter() const
{
m_printer->setPageLayout(m_pageLayout);
-#if !defined(QT_NO_CUPS)
+#if QT_CONFIG(cups)
QCUPSSupport::PagesPerSheet pagesPerSheet = m_ui.pagesPerSheetCombo->currentData()
.value<QCUPSSupport::PagesPerSheet>();
QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentData()
@@ -545,7 +546,7 @@ void QPageSetupWidget::pageOrientationChanged()
void QPageSetupWidget::pagesPerSheetChanged()
{
-#if !defined(QT_NO_CUPS)
+#if QT_CONFIG(cups)
switch (m_ui.pagesPerSheetCombo->currentData().toInt()) {
case QCUPSSupport::OnePagePerSheet:
m_pagePreview->setPagePreviewLayout(1, 1);
@@ -642,5 +643,3 @@ int QPageSetupDialog::exec()
QT_END_NAMESPACE
#include "moc_qpagesetupdialog.cpp"
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
index 3c9733dd83..658f103bea 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
@@ -53,14 +53,14 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "qprinter.h"
#include <QtGui/qpagelayout.h>
#include <ui_qpagesetupwidget.h>
+QT_REQUIRE_CONFIG(printdialog);
+
QT_BEGIN_NAMESPACE
class QPrinter;
@@ -106,5 +106,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
#endif
diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
index 88e57d27e5..23fff82f25 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
@@ -39,7 +39,6 @@
#include "qpagesetupdialog.h"
-#ifndef QT_NO_PRINTDIALOG
#include <qapplication.h>
#include "../kernel/qprintengine_win_p.h"
@@ -168,4 +167,3 @@ void QPageSetupDialog::setVisible(bool visible)
}
QT_END_NAMESPACE
-#endif
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index 35d650a7fc..53a6224f49 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include <QtPrintSupport/qabstractprintdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
+QT_BEGIN_NAMESPACE
class QPrintDialogPrivate;
class QPushButton;
@@ -104,6 +103,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QPRINTDIALOG_H
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index 4595ed71ff..854779977c 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -48,8 +48,6 @@
#include <QtPrintSupport/qprintengine.h>
#include <qpa/qplatformprintdevice.h>
-#ifndef QT_NO_PRINTDIALOG
-
QT_BEGIN_NAMESPACE
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
@@ -358,5 +356,3 @@ void QPrintDialog::setVisible(bool visible)
QT_END_NAMESPACE
#include "moc_qprintdialog.cpp"
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 5527cd94f9..32a06a4f7e 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -40,8 +40,6 @@
#include "qplatformdefs.h"
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "private/qabstractprintdialog_p.h"
#include <QtWidgets/qmessagebox.h>
#include "qprintdialog.h"
@@ -64,7 +62,7 @@
#include "ui_qprintsettingsoutput.h"
#include "ui_qprintwidget.h"
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
#include <private/qcups_p.h>
#if QT_CONFIG(cupsjobwidget)
#include "qcupsjobwidget_p.h"
@@ -313,7 +311,7 @@ void QPrintDialogPrivate::init()
options.grayscale->setIconSize(QSize(32, 32));
options.grayscale->setIcon(QIcon(QLatin1String(":/qt-project.org/dialogs/qprintdialog/images/status-gray-scale.png")));
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
// Add Page Set widget if CUPS is available
options.pageSetCombo->addItem(tr("All Pages"), QVariant::fromValue(QCUPSSupport::AllPages));
options.pageSetCombo->addItem(tr("Odd Pages"), QVariant::fromValue(QCUPSSupport::OddPages));
@@ -435,7 +433,7 @@ void QPrintDialogPrivate::setupPrinter()
}
}
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
// page set
if (p->printRange() == QPrinter::AllPages || p->printRange() == QPrinter::PageRange) {
//If the application is selecting pages and the first page number is even then need to adjust the odd-even accordingly
@@ -518,7 +516,7 @@ void QPrintDialogPrivate::updateWidgets()
options.printCurrentPage->setVisible(q->isOptionEnabled(QPrintDialog::PrintCurrentPage));
options.collate->setVisible(q->isOptionEnabled(QPrintDialog::PrintCollateCopies));
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
// Don't display Page Set if only Selection or Current Page are enabled
if (!q->isOptionEnabled(QPrintDialog::PrintPageRange)
&& (q->isOptionEnabled(QPrintDialog::PrintSelection) || q->isOptionEnabled(QPrintDialog::PrintCurrentPage))) {
@@ -867,7 +865,7 @@ bool QUnixPrintWidgetPrivate::checkFields()
}
}
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
if (propertiesDialogShown) {
QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->m_ui.pagesPerSheetCombo
->currentData().value<QCUPSSupport::PagesPerSheet>();
@@ -983,6 +981,3 @@ QT_END_NAMESPACE
#include "moc_qprintdialog.cpp"
#include "qprintdialog_unix.moc"
-
-#endif // QT_NO_PRINTDIALOG
-
diff --git a/src/printsupport/dialogs/qprintdialog_win.cpp b/src/printsupport/dialogs/qprintdialog_win.cpp
index 2e954a508d..11f2fa3259 100644
--- a/src/printsupport/dialogs/qprintdialog_win.cpp
+++ b/src/printsupport/dialogs/qprintdialog_win.cpp
@@ -39,8 +39,6 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "qprintdialog.h"
#include <qwidget.h>
@@ -308,5 +306,3 @@ void QPrintDialog::setVisible(bool visible)
QT_END_NAMESPACE
#include "moc_qprintdialog.cpp"
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp
index 33ba842a1f..fd23aea460 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.cpp
+++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp
@@ -56,8 +56,6 @@
#include <QtWidgets/qtoolbar.h>
#include <QtCore/QCoreApplication>
-#ifndef QT_NO_PRINTPREVIEWDIALOG
-
#include "private/qdialog_p.h"
#include <QtWidgets/qformlayout.h>
@@ -787,7 +785,3 @@ QT_END_NAMESPACE
#include "moc_qprintpreviewdialog.cpp"
#include "qprintpreviewdialog.moc"
-
-#endif // QT_NO_PRINTPREVIEWDIALOG
-
-
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.h b/src/printsupport/dialogs/qprintpreviewdialog.h
index 640369fdf3..3b8f8a1171 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.h
+++ b/src/printsupport/dialogs/qprintpreviewdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTPREVIEWDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printpreviewdialog);
+QT_BEGIN_NAMESPACE
class QGraphicsView;
class QPrintPreviewDialogPrivate;
@@ -91,6 +90,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWDIALOG
-
#endif // QPRINTPREVIEWDIALOG_H
diff --git a/src/printsupport/doc/snippets/widgetprinting.cpp b/src/printsupport/doc/snippets/widgetprinting.cpp
index 561e22d5b3..6e0256cb92 100644
--- a/src/printsupport/doc/snippets/widgetprinting.cpp
+++ b/src/printsupport/doc/snippets/widgetprinting.cpp
@@ -50,7 +50,8 @@
#include <QtGui>
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#endif
@@ -98,7 +99,7 @@ private slots:
}
void printFile() {
- #if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+ #if QT_CONFIG(printdialog)
//! [1]
QPrinter printer;
diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri
index 90eab4a634..ea7b4b9780 100644
--- a/src/printsupport/kernel/kernel.pri
+++ b/src/printsupport/kernel/kernel.pri
@@ -1,6 +1,5 @@
HEADERS += \
$$PWD/qpaintengine_alpha_p.h \
- $$PWD/qpaintengine_preview_p.h \
$$PWD/qprint_p.h \
$$PWD/qprintdevice_p.h \
$$PWD/qprintengine.h \
@@ -16,7 +15,6 @@ HEADERS += \
SOURCES += \
$$PWD/qpaintengine_alpha.cpp \
- $$PWD/qpaintengine_preview.cpp \
$$PWD/qprintdevice.cpp \
$$PWD/qprintengine_pdf.cpp \
$$PWD/qprinter.cpp \
@@ -25,6 +23,11 @@ SOURCES += \
$$PWD/qplatformprintplugin.cpp \
$$PWD/qplatformprintersupport.cpp
+qtConfig(printpreviewwidget) {
+ HEADERS += $$PWD/qpaintengine_preview_p.h
+ SOURCES += $$PWD/qpaintengine_preview.cpp
+}
+
win32 {
HEADERS += \
$$PWD/qprintengine_win_p.h
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index 4bd5c1441a..1c9d522c1c 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -41,8 +41,6 @@
#include "qprintengine.h"
-#ifndef QT_NO_CUPS
-
QT_BEGIN_NAMESPACE
QStringList QCUPSSupport::cupsOptionsList(QPrinter *printer)
@@ -205,5 +203,3 @@ void QCUPSSupport::setPageRange(QPrinter *printer, int pageFrom, int pageTo)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_CUPS
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
index 139b18c509..780115e350 100644
--- a/src/printsupport/kernel/qcups_p.h
+++ b/src/printsupport/kernel/qcups_p.h
@@ -57,7 +57,7 @@
#include "QtPrintSupport/qprinter.h"
#include "QtCore/qdatetime.h"
-#ifndef QT_NO_CUPS
+QT_REQUIRE_CONFIG(cups);
QT_BEGIN_NAMESPACE
@@ -150,6 +150,4 @@ Q_DECLARE_METATYPE(QCUPSSupport::PageSet)
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheetLayout)
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheet)
-#endif // QT_NO_CUPS
-
#endif
diff --git a/src/printsupport/kernel/qpaintengine_preview.cpp b/src/printsupport/kernel/qpaintengine_preview.cpp
index b5d40fd430..4c00333097 100644
--- a/src/printsupport/kernel/qpaintengine_preview.cpp
+++ b/src/printsupport/kernel/qpaintengine_preview.cpp
@@ -46,7 +46,6 @@
#include <QtGui/qpainter.h>
#include <QtGui/qpicture.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
QT_BEGIN_NAMESPACE
class QPreviewPaintEnginePrivate : public QPaintEnginePrivate
@@ -218,5 +217,3 @@ QPrinter::PrinterState QPreviewPaintEngine::printerState() const
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/printsupport/kernel/qpaintengine_preview_p.h b/src/printsupport/kernel/qpaintengine_preview_p.h
index 31b3142cb6..9203e40235 100644
--- a/src/printsupport/kernel/qpaintengine_preview_p.h
+++ b/src/printsupport/kernel/qpaintengine_preview_p.h
@@ -56,7 +56,7 @@
#include <QtGui/qpaintengine.h>
#include <QtPrintSupport/qprintengine.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE
@@ -100,6 +100,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWWIDGET
-
#endif
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp
index cbb67aefdc..e2d4a08de3 100644
--- a/src/printsupport/kernel/qplatformprintdevice.cpp
+++ b/src/printsupport/kernel/qplatformprintdevice.cpp
@@ -40,7 +40,9 @@
#include "qplatformprintdevice.h"
#include "qprintdevice_p.h"
+#if QT_CONFIG(printdialog)
#include "qprintdialog.h"
+#endif
#include <QtGui/qpagelayout.h>
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
index 47dfce3787..280c2d7608 100644
--- a/src/printsupport/kernel/qprint_p.h
+++ b/src/printsupport/kernel/qprint_p.h
@@ -57,7 +57,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qlist.h>
-#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
+#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
#endif
@@ -245,7 +245,7 @@ public:
return QByteArray();
}
-#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
+#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
// PPD utilities shared by CUPS and Mac plugins requiring CUPS headers
// May turn into a proper internal QPpd class if enough shared between Mac and CUPS,
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 638187c614..d59db444e4 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -55,7 +55,9 @@
#include "qprintengine_pdf_p.h"
#include <qpicture.h>
+#if QT_CONFIG(printpreviewwidget)
#include <private/qpaintengine_preview_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -186,7 +188,7 @@ void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinte
delete oldPrintEngine;
}
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> QPrinterPrivate::previewPages() const
{
if (previewEngine)
@@ -211,7 +213,7 @@ void QPrinterPrivate::setPreviewMode(bool enable)
use_default_engine = had_default_engines;
}
}
-#endif // QT_NO_PRINTPREVIEWWIDGET
+#endif // QT_CONFIG(printpreviewwidget)
void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value)
{
@@ -624,7 +626,7 @@ QPrinter::~QPrinter()
Q_D(QPrinter);
if (d->use_default_engine)
delete d->printEngine;
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
delete d->previewEngine;
#endif
}
diff --git a/src/printsupport/kernel/qprinter_p.h b/src/printsupport/kernel/qprinter_p.h
index 8f962ea051..6ced466236 100644
--- a/src/printsupport/kernel/qprinter_p.h
+++ b/src/printsupport/kernel/qprinter_p.h
@@ -80,7 +80,7 @@ public:
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
previewEngine(0),
#endif
q_ptr(printer),
@@ -99,7 +99,7 @@ public:
QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
void changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> previewPages() const;
void setPreviewMode(bool);
#endif
@@ -114,7 +114,7 @@ public:
QPrintEngine *realPrintEngine;
QPaintEngine *realPaintEngine;
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QPreviewPaintEngine *previewEngine;
#endif
diff --git a/src/printsupport/widgets/qcupsjobwidget.cpp b/src/printsupport/widgets/qcupsjobwidget.cpp
index 204a125d13..00f2d64df2 100644
--- a/src/printsupport/widgets/qcupsjobwidget.cpp
+++ b/src/printsupport/widgets/qcupsjobwidget.cpp
@@ -54,8 +54,6 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
-
/*!
\internal
\class QCupsJobWidget
@@ -212,6 +210,4 @@ QCUPSSupport::BannerPage QCupsJobWidget::endBannerPage() const
return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();
}
-#endif // QT_NO_PRINTER / QT_NO_CUPS
-
QT_END_NAMESPACE
diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp
index fd1cf68587..b28e693612 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.cpp
+++ b/src/printsupport/widgets/qprintpreviewwidget.cpp
@@ -48,8 +48,6 @@
#include <QtWidgets/qscrollbar.h>
#include <QtWidgets/qstyleoption.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
-
QT_BEGIN_NAMESPACE
namespace {
@@ -831,5 +829,3 @@ QT_END_NAMESPACE
#include "moc_qprintpreviewwidget.cpp"
#include "qprintpreviewwidget.moc"
-
-#endif // QT_NO_PRINTPREVIEWWIDGET
diff --git a/src/printsupport/widgets/qprintpreviewwidget.h b/src/printsupport/widgets/qprintpreviewwidget.h
index dec7092eb1..8735d06072 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.h
+++ b/src/printsupport/widgets/qprintpreviewwidget.h
@@ -44,7 +44,7 @@
#include <QtWidgets/qwidget.h>
#include <QtPrintSupport/qprinter.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE
@@ -114,5 +114,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWWIDGET
#endif // QPRINTPREVIEWWIDGET_H
diff --git a/src/printsupport/widgets/widgets.pri b/src/printsupport/widgets/widgets.pri
index 505983778e..1b5f0aca34 100644
--- a/src/printsupport/widgets/widgets.pri
+++ b/src/printsupport/widgets/widgets.pri
@@ -1,7 +1,9 @@
-HEADERS += widgets/qprintpreviewwidget.h
-SOURCES += widgets/qprintpreviewwidget.cpp
+qtConfig(printpreviewwidget) {
+ HEADERS += widgets/qprintpreviewwidget.h
+ SOURCES += widgets/qprintpreviewwidget.cpp
+}
-unix:!darwin:qtConfig(cups):qtConfig(cupsjobwidget) {
+unix:!darwin:qtConfig(cupsjobwidget) {
HEADERS += widgets/qcupsjobwidget_p.h
SOURCES += widgets/qcupsjobwidget.cpp
FORMS += widgets/qcupsjobwidget.ui
diff --git a/src/sql/configure.pri b/src/sql/configure.pri
index 05794582e9..9fb957291f 100644
--- a/src/sql/configure.pri
+++ b/src/sql/configure.pri
@@ -36,6 +36,9 @@ defineTest(qtConfLibrary_psqlEnv) {
!isEmpty(PSQL_LIBS) {
$${1}.libs = $$PSQL_LIBS
export($${1}.libs)
+ } else {
+ !qtConfLibrary_inline($$1): \
+ return(false)
}
return(true)
}
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index aa075cad1b..b8ce9a9060 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -59,7 +59,9 @@
#include <qlabel.h>
#endif
#include <qgroupbox.h>
+#if QT_CONFIG(lcdnumber)
#include <qlcdnumber.h>
+#endif
#include <qlineedit.h>
#include <private/qlineedit_p.h>
#include <qstyle.h>
@@ -422,7 +424,7 @@ QAccessible::Role QAccessibleDisplay::role() const
if (l->picture())
return QAccessible::Graphic;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
if (l->movie())
return QAccessible::Animation;
#endif
@@ -464,7 +466,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
str = qt_accStripAmp(str);
#endif
#endif // QT_CONFIG(label)
-#ifndef QT_NO_LCDNUMBER
+#if QT_CONFIG(lcdnumber)
} else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
if (l->digitCount())
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index ac03ed822b..20b160c03d 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3888,9 +3888,11 @@ bool QHeaderViewPrivate::read(QDataStream &in)
const int currentCount = (orient == Qt::Horizontal ? model->columnCount(root) : model->rowCount(root));
if (newSectionItems.count() < currentCount) {
// we have sections not in the saved state, give them default settings
- for (int i = newSectionItems.count(); i < currentCount; ++i) {
- visualIndicesIn.append(i);
- logicalIndicesIn.append(i);
+ if (!visualIndicesIn.isEmpty() && !logicalIndicesIn.isEmpty()) {
+ for (int i = newSectionItems.count(); i < currentCount; ++i) {
+ visualIndicesIn.append(i);
+ logicalIndicesIn.append(i);
+ }
}
const int insertCount = currentCount - newSectionItems.count();
const int insertLength = defaultSectionSizeIn * insertCount;
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index dd4a070d24..33943399d1 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -73,6 +73,8 @@ extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
\ingroup advanced
\inmodule QtWidgets
+ \image windows-listview.png
+
A QListView presents items stored in a model, either as a simple
non-hierarchical list, or as a collection of icons. This class is used
to provide lists and icon views that were previously provided by the
@@ -111,15 +113,6 @@ extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
within a notional grid of size specified by gridSize(). The items can
be rendered as large or small icons depending on their iconSize().
- \table 100%
- \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list view
- \li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table view
- \li \inlineimage fusion-listview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list view.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} list view.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} list view.
- \endtable
-
\section1 Improving Performance
It is possible to give the view hints about the data it is handling in order
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 9b34e89ef0..0a1f85facb 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -1149,6 +1149,8 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\ingroup model-view
\inmodule QtWidgets
+ \image windows-listview.png
+
QListWidget is a convenience class that provides a list view similar to the
one supplied by QListView, but with a classic item-based interface for
adding and removing items. QListWidget uses an internal model to manage
@@ -1191,15 +1193,6 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
current item changes, the currentItemChanged() signal is emitted with the
new current item and the item that was previously current.
- \table 100%
- \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list widget
- \li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table widget
- \li \inlineimage fusion-listview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list widget.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} list widget.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} list widget.
- \endtable
-
\sa QListWidgetItem, QListView, QTreeView, {Model/View Programming},
{Config Dialog Example}
*/
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index ed6482a8bc..b79932327b 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -988,6 +988,8 @@ int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QS
\ingroup advanced
\inmodule QtWidgets
+ \image windows-tableview.png
+
A QTableView implements a table view that displays items from a
model. This class is used to provide standard tables that were
previously provided by the QTable class, but using the more
@@ -1052,21 +1054,6 @@ int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QS
columnViewportPosition() functions provide the equivalent conversion
operations between x-coordinates and column indexes.
- \section1 Styles
-
- QTableView is styled appropriately for each platform. The following images show
- how it looks on three different platforms. Go to the \l{Qt Widget Gallery} to see
- its appearance in other styles.
-
- \table 100%
- \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table view
- \li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table view
- \li \inlineimage fusion-tableview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table view.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} table view.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} table view.
- \endtable
-
\sa QTableWidget, {View Classes}, QAbstractItemModel, QAbstractItemView,
{Chart Example}, {Pixelator Example}, {Table Model Example}
*/
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index ed83ef7b85..663cd4adc6 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1504,6 +1504,8 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
\ingroup model-view
\inmodule QtWidgets
+ \image windows-tableview.png
+
Table widgets provide standard table display facilities for applications.
The items in a QTableWidget are provided by QTableWidgetItem.
@@ -1545,15 +1547,6 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
number of columns with columnCount(). The table can be cleared with the
clear() function.
- \table 100%
- \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table widget
- \li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table widget
- \li \inlineimage fusion-tableview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table widget.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} table widget.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} table widget.
- \endtable
-
\sa QTableWidgetItem, QTableView, {Model/View Programming}
*/
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 63d6580435..f92cef50be 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -71,6 +71,8 @@ QT_BEGIN_NAMESPACE
\ingroup advanced
\inmodule QtWidgets
+ \image windows-treeview.png
+
A QTreeView implements a tree representation of items from a
model. This class is used to provide standard hierarchical lists that
were previously provided by the \c QListView class, but using the more
@@ -150,15 +152,6 @@ QT_BEGIN_NAMESPACE
Describe the expanding/collapsing concept if not covered elsewhere.
\endomit
- \table 100%
- \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree view
- \li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree view
- \li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree view
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree view.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree view.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} tree view.
- \endtable
-
\section1 Improving Performance
It is possible to give the view hints about the data it is handling in order
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 1338ce4585..8ce36ab47e 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2354,6 +2354,8 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\ingroup model-view
\inmodule QtWidgets
+ \image windows-treeview.png
+
The QTreeWidget class is a convenience class that provides a standard
tree widget with a classic item-based interface similar to that used by
the QListView class in Qt 3.
@@ -2387,15 +2389,6 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\l{QTreeView::isSortingEnabled()}{isSortingEnabled()} function indicates
whether sorting is enabled.
- \table 100%
- \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree widget
- \li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree widget
- \li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree widget
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree widget.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree widget.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} tree widget.
- \endtable
-
\sa QTreeWidgetItem, QTreeWidgetItemIterator, QTreeView,
{Model/View Programming}, {Settings Editor Example}
*/
diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp
index d9c1c524d7..b8b6f4302d 100644
--- a/src/widgets/kernel/qstackedlayout.cpp
+++ b/src/widgets/kernel/qstackedlayout.cpp
@@ -253,7 +253,7 @@ QLayoutItem *QStackedLayout::itemAt(int index) const
// on the object then)
static bool qt_wasDeleted(const QWidget *w)
{
- return QWidgetPrivate::get(w)->wasDeleted;
+ return QObjectPrivate::get(w)->wasDeleted;
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index caa17e4aea..37114449ba 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5847,7 +5847,7 @@ QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) con
void QWidgetEffectSourcePrivate::draw(QPainter *painter)
{
- if (!context || context->painter != painter) {
+ if (!context || context->painter != painter || !context->sharedPainter) {
m_widget->render(painter);
return;
}
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 7d7b553da1..653714743c 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -161,6 +161,10 @@ QObject *QWidgetWindow::focusObject() const
if (!windowWidget)
return Q_NULLPTR;
+ // A window can't have a focus object if it's being destroyed.
+ if (QWidgetPrivate::get(windowWidget)->data.in_destructor)
+ return nullptr;
+
QWidget *widget = windowWidget->focusWidget();
if (!widget)
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index d4ba17b08e..9b49916774 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -73,6 +73,8 @@ public:
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-checkbox.png
+
A QCheckBox is an option button that can be switched on (checked) or off
(unchecked). Checkboxes are typically used to represent features in an
application that can be enabled or disabled without affecting others.
@@ -117,18 +119,6 @@ public:
setAutoRepeat(), toggle(), pressed(), released(), clicked(), toggled(),
checkState(), and stateChanged().
- \table 100%
- \row
- \li \inlineimage macintosh-checkbox.png Screenshot of a Macintosh style checkbox
- \li A checkbox shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row
- \li \inlineimage windowsvista-checkbox.png Screenshot of a Windows Vista style checkbox
- \li A checkbox shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row
- \li \inlineimage fusion-checkbox.png Screenshot of a Fusion style checkbox
- \li A checkbox shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QAbstractButton, QRadioButton, {fowler}{GUI Design Handbook: Check Box}
*/
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 4a49542fdd..29c51a2de1 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -909,6 +909,8 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-combobox.png
+
A QComboBox provides a means of presenting a list of options to the user
in a way that takes up the minimum amount of screen space.
@@ -969,8 +971,6 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent)
of the view(), e.g., by using
\l{QAbstractItemView::}{setSelectionMode()}.
- \image qstyle-comboboxes.png Comboboxes in the different built-in styles.
-
\sa QLineEdit, QSpinBox, QRadioButton, QButtonGroup,
{fowler}{GUI Design Handbook: Combo Box, Drop-Down List Box}
*/
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 0eaa110bee..2e0a8a3cd7 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -76,6 +76,8 @@ QT_BEGIN_NAMESPACE
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-datetimeedit.png
+
QDateTimeEdit allows the user to edit dates by using the keyboard or
the arrow keys to increase and decrease date and time values. The
arrow keys can be used to move from section to section within the
@@ -103,15 +105,6 @@ QT_BEGIN_NAMESPACE
calendar pop-up by calling the setCalendarWidget() function. The existing
calendar widget can be retrieved with calendarWidget().
- \table 100%
- \row \li \inlineimage windowsvista-datetimeedit.png Screenshot of a Windows Vista style date time editing widget
- \li A date time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-datetimeedit.png Screenshot of a Macintosh style date time editing widget
- \li A date time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage fusion-datetimeedit.png Screenshot of a Fusion style date time editing widget
- \li A date time editing widget shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QDateEdit, QTimeEdit, QDate, QTime
*/
@@ -1505,6 +1498,8 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-timeedit.png
+
Many of the properties and functions provided by QTimeEdit are implemented in
QDateTimeEdit. These are the relevant properties of this class:
@@ -1518,15 +1513,6 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
to format the time displayed in the widget.
\endlist
- \table 100%
- \row \li \inlineimage windowsvista-timeedit.png Screenshot of a Windows Vista style time editing widget
- \li A time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-timeedit.png Screenshot of a Macintosh style time editing widget
- \li A time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage fusion-timeedit.png Screenshot of a Fusion style time editing widget
- \li A time editing widget shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QDateEdit, QDateTimeEdit
*/
@@ -1582,6 +1568,8 @@ QTimeEdit::~QTimeEdit()
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-dateedit.png
+
Many of the properties and functions provided by QDateEdit are implemented in
QDateTimeEdit. These are the relevant properties of this class:
@@ -1595,15 +1583,6 @@ QTimeEdit::~QTimeEdit()
to format the date displayed in the widget.
\endlist
- \table 100%
- \row \li \inlineimage windowsvista-dateedit.png Screenshot of a Windows Vista style date editing widget
- \li A date editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-dateedit.png Screenshot of a Macintosh style date editing widget
- \li A date editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage fusion-dateedit.png Screenshot of a Fusion style date editing widget
- \li A date editing widget shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QTimeEdit, QDateTimeEdit
*/
diff --git a/src/widgets/widgets/qdial.cpp b/src/widgets/widgets/qdial.cpp
index cee39e2ae3..a219e4ccb6 100644
--- a/src/widgets/widgets/qdial.cpp
+++ b/src/widgets/widgets/qdial.cpp
@@ -179,6 +179,8 @@ int QDialPrivate::valueFromPoint(const QPoint &p) const
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-dial.png
+
QDial is used when the user needs to control a value within a
program-definable range, and the range either wraps around
(for example, with angles measured from 0 to 359 degrees) or the
@@ -226,16 +228,6 @@ int QDialPrivate::valueFromPoint(const QPoint &p) const
by \l {QAbstractSlider::singleStep} {singleStep}, and
\l {QAbstractSlider::pageStep} {pageStep}.
- \table
- \row \li \inlineimage fusion-dial.png Screenshot of a dial in the Fusion widget style
- \li \inlineimage windowsvista-dial.png Screenshot of a dial in the Windows Vista widget style
- \li \inlineimage macintosh-dial.png Screenshot of a dial in the Macintosh widget style
- \row \li {3,1} Dials shown in various widget styles (from left to right):
- \l{Fusion Style Widget Gallery}{Fusion},
- \l{Windows Vista Style Widget Gallery}{Windows Vista},
- \l{Macintosh Style Widget Gallery}{Macintosh}.
- \endtable
-
\sa QScrollBar, QSpinBox, QSlider, {fowler}{GUI Design Handbook: Slider}, {Sliders Example}
*/
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index fda68879d1..9e323df9a6 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -145,6 +145,8 @@ void QGroupBoxPrivate::click()
\ingroup geomanagement
\inmodule QtWidgets
+ \image windows-groupbox.png
+
A group box provides a frame, a title on top, a keyboard shortcut, and
displays various other widgets inside itself. The keyboard shortcut moves
keyboard focus to one of the group box's child widgets.
@@ -166,15 +168,6 @@ void QGroupBoxPrivate::click()
\snippet widgets/groupbox/window.cpp 2
- \table 100%
- \row \li \inlineimage windowsvista-groupbox.png Screenshot of a Windows Vista style group box
- \li \inlineimage macintosh-groupbox.png Screenshot of a Macintosh style group box
- \li \inlineimage fusion-groupbox.png Screenshot of a Fusion style group box
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} group box.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} group box.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} group box.
- \endtable
-
\sa QButtonGroup, {Group Box Example}
*/
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 39e072234e..e3225800cc 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -72,7 +72,7 @@ QLabelPrivate::QLabelPrivate()
#ifndef QT_NO_PICTURE
picture(Q_NULLPTR),
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
movie(),
#endif
control(Q_NULLPTR),
@@ -116,6 +116,8 @@ QLabelPrivate::~QLabelPrivate()
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-label.png
+
QLabel is used for displaying text or an image. No user
interaction functionality is provided. The visual appearance of
the label can be configured in various ways, and it can be used
@@ -181,18 +183,6 @@ QLabelPrivate::~QLabelPrivate()
was a button (inheriting from QAbstractButton), triggering the
mnemonic would emulate a button click.
- \table 100%
- \row
- \li \inlineimage macintosh-label.png Screenshot of a Macintosh style label
- \li A label shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row
- \li \inlineimage fusion-label.png Screenshot of a Fusion style label
- \li A label shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row
- \li \inlineimage windowsvista-label.png Screenshot of a Windows Vista style label
- \li A label shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \endtable
-
\sa QLineEdit, QTextEdit, QPixmap, QMovie,
{fowler}{GUI Design Handbook: Label}
*/
@@ -582,7 +572,7 @@ QSize QLabelPrivate::sizeForWidth(int w) const
} else if (picture && !picture->isNull()) {
br = picture->boundingRect();
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
} else if (movie && !movie->currentPixmap().isNull()) {
br = movie->currentPixmap().rect();
br.setSize(br.size() / movie->currentPixmap().devicePixelRatio());
@@ -1015,7 +1005,7 @@ void QLabel::paintEvent(QPaintEvent *)
int align = QStyle::visualAlignment(d->isTextLabel ? d->textDirection()
: layoutDirection(), QFlag(d->align));
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
if (d->movie) {
if (d->scaledcontents)
style->drawItemPixmap(&painter, cr, align, d->movie->currentPixmap().scaled(cr.size()));
@@ -1216,7 +1206,7 @@ void QLabelPrivate::updateShortcut()
#endif // QT_NO_SHORTCUT
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
void QLabelPrivate::_q_movieUpdated(const QRect& rect)
{
Q_Q(QLabel);
@@ -1276,7 +1266,7 @@ void QLabel::setMovie(QMovie *movie)
d->updateLabel();
}
-#endif // QT_NO_MOVIE
+#endif // QT_CONFIG(movie)
/*!
\internal
@@ -1309,7 +1299,7 @@ void QLabelPrivate::clearContents()
q->releaseShortcut(shortcutId);
shortcutId = 0;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
if (movie) {
QObject::disconnect(movie, SIGNAL(resized(QSize)), q, SLOT(_q_movieResized(QSize)));
QObject::disconnect(movie, SIGNAL(updated(QRect)), q, SLOT(_q_movieUpdated(QRect)));
@@ -1329,7 +1319,7 @@ void QLabelPrivate::clearContents()
}
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
/*!
Returns a pointer to the label's movie, or 0 if no movie has been
@@ -1344,7 +1334,7 @@ QMovie *QLabel::movie() const
return d->movie;
}
-#endif // QT_NO_MOVIE
+#endif // QT_CONFIG(movie)
/*!
\property QLabel::textFormat
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h
index 3978e34d14..469254a145 100644
--- a/src/widgets/widgets/qlabel.h
+++ b/src/widgets/widgets/qlabel.h
@@ -76,7 +76,7 @@ public:
#ifndef QT_NO_PICTURE
const QPicture *picture() const;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
QMovie *movie() const;
#endif
@@ -122,7 +122,7 @@ public Q_SLOTS:
#ifndef QT_NO_PICTURE
void setPicture(const QPicture &);
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
void setMovie(QMovie *movie);
#endif
void setNum(int);
@@ -152,7 +152,7 @@ protected:
private:
Q_DISABLE_COPY(QLabel)
Q_DECLARE_PRIVATE(QLabel)
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
Q_PRIVATE_SLOT(d_func(), void _q_movieUpdated(const QRect&))
Q_PRIVATE_SLOT(d_func(), void _q_movieResized(const QSize&))
#endif
diff --git a/src/widgets/widgets/qlabel_p.h b/src/widgets/widgets/qlabel_p.h
index d13c05fc99..f3236ac527 100644
--- a/src/widgets/widgets/qlabel_p.h
+++ b/src/widgets/widgets/qlabel_p.h
@@ -59,7 +59,9 @@
#include "qtextdocumentfragment.h"
#include "qframe_p.h"
#include "qtextdocument.h"
+#if QT_CONFIG(movie)
#include "qmovie.h"
+#endif
#include "qimage.h"
#include "qbitmap.h"
#include "qpicture.h"
@@ -79,7 +81,7 @@ public:
void updateLabel();
QSize sizeForWidth(int w) const;
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
void _q_movieUpdated(const QRect&);
void _q_movieResized(const QSize&);
#endif
@@ -116,7 +118,7 @@ public:
#ifndef QT_NO_PICTURE
QPicture *picture;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
QPointer<QMovie> movie;
#endif
mutable QWidgetTextControl *control;
diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp
index aa052ef5cb..282714843c 100644
--- a/src/widgets/widgets/qlcdnumber.cpp
+++ b/src/widgets/widgets/qlcdnumber.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qlcdnumber.h"
-#ifndef QT_NO_LCDNUMBER
+
#include "qbitarray.h"
#include "qpainter.h"
#include "private/qframe_p.h"
@@ -74,6 +74,8 @@ public:
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-lcdnumber.png
+
It can display a number in just about any size. It can display
decimal, hexadecimal, octal or binary numbers. It is easy to
connect to data sources using the display() slot, which is
@@ -103,17 +105,6 @@ public:
Incidentally, QLCDNumber is the very oldest part of Qt, tracing
its roots back to a BASIC program on the \l{Sinclair Spectrum}{Sinclair Spectrum}.
- \table
- \row \li
- \inlineimage windows-lcdnumber.png Screenshot of a Windows style LCD number widget
- \inlineimage windowsvista-lcdnumber.png Screenshot of a Windows Vista style LCD number widget
- \inlineimage macintosh-lcdnumber.png Screenshot of a Macintosh style LCD number widget
- \inlineimage fusion-lcdnumber.png Screenshot of a Fusion style LCD number widget
- \row \li LCD number widgets shown in various widget styles (from left to right):
- \l{Windows Style Widget Gallery}{Windows}, \l{Windows Vista Style Widget Gallery}{Windows Vista},
- \l{Macintosh Style Widget Gallery}{Macintosh}, \l{Fusion Style Widget Gallery}{Fusion}.
- \endtable
-
\sa QLabel, QFrame, {Digital Clock Example}, {Tetrix Example}
*/
@@ -1220,5 +1211,3 @@ bool QLCDNumber::event(QEvent *e)
QT_END_NAMESPACE
#include "moc_qlcdnumber.cpp"
-
-#endif // QT_NO_LCDNUMBER
diff --git a/src/widgets/widgets/qlcdnumber.h b/src/widgets/widgets/qlcdnumber.h
index 33669fa900..28fd530e6e 100644
--- a/src/widgets/widgets/qlcdnumber.h
+++ b/src/widgets/widgets/qlcdnumber.h
@@ -45,8 +45,7 @@
QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_LCDNUMBER
+QT_REQUIRE_CONFIG(lcdnumber);
class QLCDNumberPrivate;
class Q_WIDGETS_EXPORT QLCDNumber : public QFrame // LCD number widget
@@ -115,8 +114,6 @@ private:
Q_DECLARE_PRIVATE(QLCDNumber)
};
-#endif // QT_NO_LCDNUMBER
-
QT_END_NAMESPACE
#endif // QLCDNUMBER_H
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index b7f19a3bcf..75e3524ab2 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -127,6 +127,8 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-lineedit.png
+
A line edit allows the user to enter and edit a single line of
plain text with a useful collection of editing functions,
including undo and redo, cut and paste, and drag and drop (see
@@ -141,7 +143,6 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
on the same line edit, it is best to clear the validator or input mask to
prevent undefined behavior.
-
A related class is QTextEdit which allows multi-line, rich text
editing.
@@ -201,15 +202,6 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
Any other key sequence that represents a valid character, will
cause the character to be inserted into the line edit.
- \table 100%
- \row \li \inlineimage macintosh-lineedit.png Screenshot of a Macintosh style line edit
- \li A line edit shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsvista-lineedit.png Screenshot of a Windows Vista style line edit
- \li A line edit shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-lineedit.png Screenshot of a Fusion style line edit
- \li A line edit shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QTextEdit, QLabel, QComboBox, {fowler}{GUI Design Handbook: Field, Entry}, {Line Edits Example}
*/
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 4567f7c2a3..955d445b24 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1535,6 +1535,8 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image fusion-menu.png
+
A menu widget is a selection menu. It can be either a pull-down
menu in a menu bar or a standalone context menu. Pull-down menus
are shown by the menu bar when the user clicks on the respective
@@ -1546,14 +1548,6 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
response to button presses; these are just like context menus
except for how they are invoked.
- \table 100%
- \row
- \li \inlineimage fusion-menu.png
- \li \inlineimage macintosh-menu.png
- \endtable
- \caption Fig. A menu shown in \l{Fusion Style Widget Gallery}{Fusion widget style}
- and \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
-
\section1 Actions
A menu consists of a list of action items. Actions are added with
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 39faf2e458..e26673a010 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -177,6 +177,8 @@ bool QProgressBarPrivate::repaintRequired() const
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-progressbar.png
+
A progress bar is used to give the user an indication of the
progress of an operation and to reassure them that the application
is still running.
@@ -198,15 +200,6 @@ bool QProgressBarPrivate::repaintRequired() const
example, when using QNetworkAccessManager to download items when
they are unable to determine the size of the item being downloaded.
- \table
- \row \li \inlineimage macintosh-progressbar.png Screenshot of a Macintosh style progress bar
- \li A progress bar shown in the Macintosh widget style.
- \row \li \inlineimage windowsvista-progressbar.png Screenshot of a Windows Vista style progress bar
- \li A progress bar shown in the Windows Vista widget style.
- \row \li \inlineimage fusion-progressbar.png Screenshot of a Fusion style progress bar
- \li A progress bar shown in the Fusion widget style.
- \endtable
-
\sa QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator}
*/
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index a4318681c9..57af09fef5 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -77,6 +77,8 @@ QT_BEGIN_NAMESPACE
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-pushbutton.jpg
+
The push button, or command button, is perhaps the most commonly
used widget in any graphical user interface. Push (click) a button
to command the computer to perform some action, or to answer a
@@ -148,6 +150,11 @@ QT_BEGIN_NAMESPACE
button is probably not what you want. When in doubt, use a tool
button.
+ \note On \macos when a push button's width becomes smaller than 50 or
+ its height becomes smaller than 30, the button's corners are
+ changed from round to square. Use the setMinimumSize()
+ function to prevent this behavior.
+
A variation of a command button is a menu button. These provide
not just one command, but several, since when they are clicked
they pop up a menu of options. Use the method setMenu() to
@@ -156,20 +163,6 @@ QT_BEGIN_NAMESPACE
Other classes of buttons are option buttons (see QRadioButton) and
check boxes (see QCheckBox).
- \table 100%
- \row \li \inlineimage macintosh-pushbutton.png Screenshot of a Macintosh style push button
- \li A push button shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
-
- Note that when a button's width becomes smaller than 50 or
- its height becomes smaller than 30, the button's corners are
- changed from round to square. Use the setMinimumSize()
- function to prevent this behavior.
-
- \row \li \inlineimage windowsvista-pushbutton.png Screenshot of a Windows Vista style push button
- \li A push button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-pushbutton.png Screenshot of a Fusion style push button
- \li A push button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
In Qt, the QAbstractButton base class provides most of the modes
and other API, and QPushButton provides GUI logic.
diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp
index 284c5f56cf..ac711d34c7 100644
--- a/src/widgets/widgets/qradiobutton.cpp
+++ b/src/widgets/widgets/qradiobutton.cpp
@@ -80,6 +80,8 @@ void QRadioButtonPrivate::init()
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-radiobutton.png
+
A QRadioButton is an option button that can be switched on (checked) or
off (unchecked). Radio buttons typically present the user with a "one
of many" choice. In a group of radio buttons, only one radio button at
@@ -113,15 +115,6 @@ void QRadioButtonPrivate::init()
setDown(), isDown(), autoRepeat(), group(), setAutoRepeat(),
toggle(), pressed(), released(), clicked(), and toggled().
- \table 100%
- \row \li \inlineimage fusion-radiobutton.png Screenshot of a Fusion radio button
- \li A radio button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row \li \inlineimage windowsvista-radiobutton.png Screenshot of a Windows Vista radio button
- \li A radio button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-radiobutton.png Screenshot of a Macintosh radio button
- \li A radio button shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \endtable
-
\sa QPushButton, QToolButton, QCheckBox, {fowler}{GUI Design Handbook: Radio Button},
{Group Box Example}
*/
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 79bfedb8c4..66f1a4c689 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -187,15 +187,6 @@ QT_BEGIN_NAMESPACE
Most GUI styles use the pageStep() value to calculate the size of the
slider.
- \table 100%
- \row \li \inlineimage macintosh-horizontalscrollbar.png Screenshot of a Macintosh style scroll bar
- \li A scroll bar shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsvista-horizontalscrollbar.png Screenshot of a Windows Vista style scroll bar
- \li A scroll bar shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-horizontalscrollbar.png Screenshot of a Fusion style scroll bar
- \li A scroll bar shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QScrollArea, QSlider, QDial, QSpinBox, {fowler}{GUI Design Handbook: Scroll Bar}, {Sliders Example}
*/
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 744a43253a..356cbcfce7 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -203,6 +203,8 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-slider.png
+
The slider is the classic widget for controlling a bounded value.
It lets the user move a slider handle along a horizontal or vertical
groove and translates the handle's position into an integer value
@@ -252,15 +254,6 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
\li End moves to the end (maximum).
\endlist
- \table 100%
- \row \li \inlineimage macintosh-slider.png Screenshot of a Macintosh slider
- \li A slider shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsvista-slider.png Screenshot of a Windows Vista slider
- \li A slider shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-slider.png Screenshot of a Fusion slider
- \li A slider shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QScrollBar, QSpinBox, QDial, {fowler}{GUI Design Handbook: Slider}, {Sliders Example}
*/
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 0daa624ae8..508cb05cfc 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -112,6 +112,8 @@ public:
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-spinbox.png
+
QSpinBox is designed to handle integers and discrete sets of
values (e.g., month names); use QDoubleSpinBox for floating point
values.
@@ -151,15 +153,6 @@ public:
choice in addition to the range of numeric values. See
setSpecialValueText() for how to do this with QSpinBox.
- \table 100%
- \row \li \inlineimage windowsvista-spinbox.png Screenshot of a Windows Vista spin box
- \li A spin box shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-spinbox.png Screenshot of a Fusion spin box
- \li A spin box shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row \li \inlineimage macintosh-spinbox.png Screenshot of a Macintosh spin box
- \li A spin box shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \endtable
-
\section1 Subclassing QSpinBox
If using prefix(), suffix(), and specialValueText() don't provide
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index 85c63077eb..d1b59b5196 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -39,8 +39,6 @@
#include "qsplashscreen.h"
-#ifndef QT_NO_SPLASHSCREEN
-
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qpainter.h"
@@ -354,5 +352,3 @@ bool QSplashScreen::event(QEvent *e)
QT_END_NAMESPACE
#include "moc_qsplashscreen.cpp"
-
-#endif //QT_NO_SPLASHSCREEN
diff --git a/src/widgets/widgets/qsplashscreen.h b/src/widgets/widgets/qsplashscreen.h
index de58d86592..1971b8bacf 100644
--- a/src/widgets/widgets/qsplashscreen.h
+++ b/src/widgets/widgets/qsplashscreen.h
@@ -44,10 +44,10 @@
#include <QtGui/qpixmap.h>
#include <QtWidgets/qwidget.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(splashscreen);
+QT_BEGIN_NAMESPACE
-#ifndef QT_NO_SPLASHSCREEN
class QSplashScreenPrivate;
class Q_WIDGETS_EXPORT QSplashScreen : public QWidget
@@ -82,8 +82,6 @@ private:
Q_DECLARE_PRIVATE(QSplashScreen)
};
-#endif // QT_NO_SPLASHSCREEN
-
QT_END_NAMESPACE
#endif // QSPLASHSCREEN_H
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index be870133ee..7c75f859ed 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -64,6 +64,8 @@ QT_BEGIN_NAMESPACE
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-tabwidget.png
+
A tab widget provides a tab bar (see QTabBar) and a "page area"
that is used to display pages related to each tab. By default, the
tab bar is shown above the page area, but different configurations
@@ -117,15 +119,6 @@ QT_BEGIN_NAMESPACE
(at the top, providing the tabs) and a QStackedWidget (most of the
area, organizing the individual pages).
- \table 100%
- \row \li \inlineimage windowsvista-tabwidget.png Screenshot of a Windows Vista style tab widget
- \li \inlineimage macintosh-tabwidget.png Screenshot of a Macintosh style tab widget
- \li \inlineimage fusion-tabwidget.png Screenshot of a Fusion style tab widget
- \row \li A Windows Vista style tab widget.
- \li A Macintosh style tab widget.
- \li A Fusion style tab widget.
- \endtable
-
\sa QTabBar, QStackedWidget, QToolBox, {Tab Dialog Example}
*/
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 086585f0e6..1779c8d183 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -20,7 +20,6 @@ HEADERS += \
widgets/qgroupbox.h \
widgets/qkeysequenceedit.h \
widgets/qkeysequenceedit_p.h \
- widgets/qlcdnumber.h \
widgets/qlineedit.h \
widgets/qlineedit_p.h \
widgets/qmainwindow.h \
@@ -41,7 +40,6 @@ HEADERS += \
widgets/qsizegrip.h \
widgets/qslider.h \
widgets/qspinbox.h \
- widgets/qsplashscreen.h \
widgets/qsplitter.h \
widgets/qsplitter_p.h \
widgets/qstackedwidget.h \
@@ -84,7 +82,6 @@ SOURCES += \
widgets/qframe.cpp \
widgets/qgroupbox.cpp \
widgets/qkeysequenceedit.cpp \
- widgets/qlcdnumber.cpp \
widgets/qlineedit_p.cpp \
widgets/qlineedit.cpp \
widgets/qmainwindow.cpp \
@@ -99,7 +96,6 @@ SOURCES += \
widgets/qsizegrip.cpp \
widgets/qslider.cpp \
widgets/qspinbox.cpp \
- widgets/qsplashscreen.cpp \
widgets/qsplitter.cpp \
widgets/qstackedwidget.cpp \
widgets/qstatusbar.cpp \
@@ -165,6 +161,13 @@ qtConfig(label) {
widgets/qlabel.cpp
}
+qtConfig(lcdnumber) {
+ HEADERS += \
+ widgets/qlcdnumber.h
+
+ SOURCES += \
+ widgets/qlcdnumber.cpp
+}
qtConfig(pushbutton) {
HEADERS += \
@@ -191,6 +194,14 @@ qtConfig(dialogbuttonbox) {
widgets/qdialogbuttonbox.cpp
}
+qtConfig(splashscreen) {
+ HEADERS += \
+ widgets/qsplashscreen.h
+
+ SOURCES += \
+ widgets/qsplashscreen.cpp
+}
+
qtConfig(widgettextcontrol) {
HEADERS += \
widgets/qwidgettextcontrol_p.h \