summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-04-20 11:19:14 +0200
committerLiang Qi <liang.qi@qt.io>2017-04-20 12:31:27 +0200
commit7950b6b283549c98f1e0f981c84b68071a13b616 (patch)
treecf7281872045ebd57c68e10064ff0f400084aa13 /src/gui
parent58d2927861d3e57cac4f6db599e209d2bfb17a2c (diff)
parent0794d61c822585530243f638687b8a75f0a15d0c (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/configure.json26
-rw-r--r--src/gui/doc/qtgui.qdocconf3
-rw-r--r--src/gui/image/qimage.cpp6
-rw-r--r--src/gui/image/qimage.h8
-rw-r--r--src/gui/image/qpnghandler.cpp2
-rw-r--r--src/gui/kernel/qevent.cpp14
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
-rw-r--r--src/gui/kernel/qopenglwindow.cpp4
-rw-r--r--src/gui/kernel/qplatformgraphicsbuffer.cpp2
-rw-r--r--src/gui/kernel/qplatformsystemtrayicon.cpp7
-rw-r--r--src/gui/kernel/qtouchdevice.cpp5
-rw-r--r--src/gui/kernel/qwindow.cpp4
-rw-r--r--src/gui/math3d/qgenericmatrix.h2
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp4
-rw-r--r--src/gui/math3d/qmatrix4x4.h3
-rw-r--r--src/gui/math3d/qquaternion.h6
-rw-r--r--src/gui/math3d/qvector2d.h2
-rw-r--r--src/gui/math3d/qvector4d.h2
-rw-r--r--src/gui/opengl/qopengl.h6
-rw-r--r--src/gui/opengl/qopengltexture.cpp6
-rw-r--r--src/gui/painting/qcolor.h10
-rw-r--r--src/gui/painting/qgrayraster.c6
-rw-r--r--src/gui/painting/qmatrix.h2
-rw-r--r--src/gui/painting/qpainterpath.h16
-rw-r--r--src/gui/painting/qpolygon.h18
-rw-r--r--src/gui/painting/qregion.h28
-rw-r--r--src/gui/painting/qtransform.h6
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp21
-rw-r--r--src/gui/text/qplatformfontdatabase.h7
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp2
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp10
31 files changed, 159 insertions, 93 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 91e6bebc7f..854b187eb6 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -243,7 +243,7 @@
]
},
"xcb_syslibs": {
- "label": "XCB (secondary)",
+ "label": "XCB (extensions)",
"test": "qpa/xcb-syslibs",
"sources": [
{ "type": "pkgConfig",
@@ -737,11 +737,11 @@
"output": [ "privateFeature" ]
},
"system-xcb": {
- "label": "Using system provided XCB libraries",
- "enable": "input.xcb == 'system' || input.xcb == 'yes'",
- "disable": "input.xcb == 'qt' || input.xcb == 'no'",
+ "label": "Using system-provided XCB libraries",
+ "enable": "input.xcb == 'system'",
+ "disable": "input.xcb == 'qt'",
"autoDetect": "!config.darwin",
- "condition": "libs.xcb && libs.xcb_syslibs",
+ "condition": "features.xcb && libs.xcb_syslibs",
"output": [ "privateFeature" ]
},
"x11-prefix": {
@@ -757,8 +757,14 @@
},
"xcb-render": {
"label": "XCB render",
- "emitIf": "features.system-xcb",
- "condition": "libs.xcb_render",
+ "emitIf": "features.xcb",
+ "condition": "!features.system-xcb || libs.xcb_render",
+ "output": [ "privateFeature" ]
+ },
+ "xkb": {
+ "label": "XCB XKB",
+ "emitIf": "features.xcb",
+ "condition": "!features.system-xcb || libs.xcb_xkb",
"output": [ "privateFeature" ]
},
"xcb-xlib": {
@@ -775,6 +781,7 @@
},
"xinput2": {
"label": "Xinput2",
+ "emitIf": "features.xcb",
"condition": "libs.xinput2",
"output": [ "privateFeature" ]
},
@@ -791,11 +798,6 @@
"condition": "libs.xkbcommon_x11",
"output": [ "privateFeature" ]
},
- "xkb": {
- "label": "XCB XKB",
- "condition": "features.system-xcb && libs.xcb_xkb",
- "output": [ "privateFeature" ]
- },
"xkb-config-root": {
"label": "XKB config root",
"emitIf": "features.xcb",
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index 591d024f8f..3b3ebafc2d 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -39,7 +39,8 @@ depends += \
qtquick \
qtwidgets \
qtdoc \
- qmake
+ qmake \
+ qttestlib
headerdirs += ..
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index c1ea053204..fffd7a1ac2 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -1071,7 +1071,7 @@ QImage::operator QVariant() const
Nothing is done if there is just a single reference.
- \sa copy(), isDetached(), {Implicit Data Sharing}
+ \sa copy(), {QImage::isDetached()}{isDetached()}, {Implicit Data Sharing}
*/
void QImage::detach()
{
@@ -2127,7 +2127,7 @@ QImage QImage::convertToFormat(Format format, const QVector<QRgb> &colorTable, Q
/*!
\since 5.9
- Changes the format of the image without changing the data. Only
+ Changes the \a format of the image without changing the data. Only
works between formats of the same depth.
Returns \c true if successful.
@@ -4671,7 +4671,7 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode
}
// initizialize the data
- if (d->format == QImage::Format_Indexed8) {
+ if (target_format == QImage::Format_Indexed8) {
if (dImage.d->colortable.size() < 256) {
// colors are left in the color table, so pick that one as transparent
dImage.d->colortable.append(0x0);
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 204e7a54b2..225ef3d2e8 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -179,9 +179,9 @@ public:
Format format() const;
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QIMAGE_COMPAT_CPP)
- Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const & Q_REQUIRED_RESULT
+ Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const &
{ return convertToFormat_helper(f, flags); }
- Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) && Q_REQUIRED_RESULT
+ Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) &&
{
if (convertToFormat_inplace(f, flags))
return std::move(*this);
@@ -189,9 +189,9 @@ public:
return convertToFormat_helper(f, flags);
}
#else
- QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
#endif
- QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
bool reinterpretAsFormat(Format f);
int width() const;
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index 1d19c165fc..9506a95506 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -830,7 +830,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, volatile int quality_in, c
int color_type = 0;
- if (image.colorCount()) {
+ if (image.format() <= QImage::Format_Indexed8) {
if (image.isGrayscale())
color_type = PNG_COLOR_TYPE_GRAY;
else
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index ac9edc8eb0..2777e408c1 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -4090,6 +4090,20 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
}
dbg << ')';
break;
+ case QEvent::ScrollPrepare: {
+ const QScrollPrepareEvent *se = static_cast<const QScrollPrepareEvent *>(e);
+ dbg << "QScrollPrepareEvent(viewportSize=" << se->viewportSize()
+ << ", contentPosRange=" << se->contentPosRange()
+ << ", contentPos=" << se->contentPos() << ')';
+ }
+ break;
+ case QEvent::Scroll: {
+ const QScrollEvent *se = static_cast<const QScrollEvent *>(e);
+ dbg << "QScrollEvent(contentPos=" << se->contentPos()
+ << ", overshootDistance=" << se->overshootDistance()
+ << ", scrollState=" << se->scrollState() << ')';
+ }
+ break;
default:
dbg << eventClassName(type) << '(';
QtDebugUtils::formatQEnum(dbg, type);
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index a3b2c4c1e4..56f112c36c 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2027,13 +2027,23 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
window = QGuiApplication::focusWindow();
}
+#if defined(Q_OS_ANDROID)
+ static bool backKeyPressAccepted = false;
+ static bool menuKeyPressAccepted = false;
+#endif
+
#if !defined(Q_OS_OSX)
// FIXME: Include OS X in this code path by passing the key event through
// QPlatformInputContext::filterEvent().
if (e->keyType == QEvent::KeyPress && window) {
if (QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers,
- e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount))
+ e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount)) {
+#if defined(Q_OS_ANDROID)
+ backKeyPressAccepted = e->key == Qt::Key_Back;
+ menuKeyPressAccepted = e->key == Qt::Key_Menu;
+#endif
return;
+ }
}
#endif
@@ -2050,8 +2060,6 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
else
ev.setAccepted(false);
- static bool backKeyPressAccepted = false;
- static bool menuKeyPressAccepted = false;
if (e->keyType == QEvent::KeyPress) {
backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted();
menuKeyPressAccepted = e->key == Qt::Key_Menu && ev.isAccepted();
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index e1bd3d11b2..5170c7ab63 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -528,7 +528,9 @@ QImage QOpenGLWindow::grabFramebuffer()
return QImage();
makeCurrent();
- return qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
+ QImage img = qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
+ img.setDevicePixelRatio(devicePixelRatio());
+ return img;
}
/*!
diff --git a/src/gui/kernel/qplatformgraphicsbuffer.cpp b/src/gui/kernel/qplatformgraphicsbuffer.cpp
index 8080cb91ad..d42231e958 100644
--- a/src/gui/kernel/qplatformgraphicsbuffer.cpp
+++ b/src/gui/kernel/qplatformgraphicsbuffer.cpp
@@ -63,6 +63,8 @@ QT_BEGIN_NAMESPACE
QPlatformGraphicsBuffer is intended to be created by using platform specific
APIs available from QtPlatformHeaders, or there might be accessor functions
similar to the accessor function that QPlatformBackingstore has.
+
+ \internal
*/
/*!
diff --git a/src/gui/kernel/qplatformsystemtrayicon.cpp b/src/gui/kernel/qplatformsystemtrayicon.cpp
index 973b998059..5481997b3c 100644
--- a/src/gui/kernel/qplatformsystemtrayicon.cpp
+++ b/src/gui/kernel/qplatformsystemtrayicon.cpp
@@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtGui
\brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction.
+ \internal
\sa QSystemTrayIcon
*/
@@ -82,16 +83,10 @@ QT_BEGIN_NAMESPACE
\sa activated()
*/
-/*!
- \internal
- */
QPlatformSystemTrayIcon::QPlatformSystemTrayIcon()
{
}
-/*!
- \internal
- */
QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon()
{
}
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp
index 97cc8d179d..0f13412fb1 100644
--- a/src/gui/kernel/qtouchdevice.cpp
+++ b/src/gui/kernel/qtouchdevice.cpp
@@ -215,7 +215,10 @@ static void cleanupDevicesList()
/*!
Returns a list of all registered devices.
- \note The returned list cannot be used to add new devices. Use QWindowSystemInterface::registerTouchDevice() instead.
+ \note The returned list cannot be used to add new devices. To add a simulated
+ touch screen for an autotest, QTest::createTouchDevice() can be used.
+ To add real touch screens to QPA plugins, the private
+ \c QWindowSystemInterface::registerTouchDevice() function can be used.
*/
QList<const QTouchDevice *> QTouchDevice::devices()
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 3f5f71002b..6e7be2aec2 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1317,6 +1317,10 @@ void QWindow::setTransientParent(QWindow *parent)
qWarning() << parent << "must be a top level window.";
return;
}
+ if (parent == this) {
+ qWarning() << "transient parent" << parent << "can not be same as window";
+ return;
+ }
d->transientParent = parent;
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h
index 9a1ab54124..6a2a9e5bae 100644
--- a/src/gui/math3d/qgenericmatrix.h
+++ b/src/gui/math3d/qgenericmatrix.h
@@ -64,7 +64,7 @@ public:
void fill(T value);
- QGenericMatrix<M, N, T> transposed() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QGenericMatrix<M, N, T> transposed() const;
QGenericMatrix<N, M, T>& operator+=(const QGenericMatrix<N, M, T>& other);
QGenericMatrix<N, M, T>& operator-=(const QGenericMatrix<N, M, T>& other);
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index b6381e1d8f..6b18e1ab03 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -1940,7 +1940,7 @@ QMatrix4x4 QMatrix4x4::orthonormalInverse() const
Normally the QMatrix4x4 class keeps track of this special type internally
as operations are performed. However, if the matrix is modified
- directly with operator()() or data(), then QMatrix4x4 will lose track of
+ directly with {QLoggingCategory::operator()}{operator()()} or data(), then QMatrix4x4 will lose track of
the special type and will revert to the safest but least efficient
operations thereafter.
@@ -1948,7 +1948,7 @@ QMatrix4x4 QMatrix4x4::orthonormalInverse() const
the programmer can force QMatrix4x4 to recover the special type if
the elements appear to conform to one of the known optimized types.
- \sa operator()(), data(), translate()
+ \sa {QLoggingCategory::operator()}{operator()()}, data(), translate()
*/
void QMatrix4x4::optimize()
{
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index aca685920e..4db96d07c0 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -423,8 +423,9 @@ inline QMatrix4x4& QMatrix4x4::operator-=(const QMatrix4x4& other)
return *this;
}
-inline QMatrix4x4& QMatrix4x4::operator*=(const QMatrix4x4& other)
+inline QMatrix4x4& QMatrix4x4::operator*=(const QMatrix4x4& o)
{
+ const QMatrix4x4 other = o; // prevent aliasing when &o == this ### Qt 6: take o by value
flagBits |= other.flagBits;
if (flagBits < Rotation2D) {
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index eff427117f..7f7f89db4d 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -90,14 +90,14 @@ public:
float length() const;
float lengthSquared() const;
- QQuaternion normalized() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QQuaternion normalized() const;
void normalize();
inline QQuaternion inverted() const;
- QQuaternion conjugated() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QQuaternion conjugated() const;
#if QT_DEPRECATED_SINCE(5, 5)
- QT_DEPRECATED QQuaternion conjugate() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QT_DEPRECATED QQuaternion conjugate() const;
#endif
QVector3D rotatedVector(const QVector3D& vector) const;
diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h
index bdb56c9c1f..5e0394b998 100644
--- a/src/gui/math3d/qvector2d.h
+++ b/src/gui/math3d/qvector2d.h
@@ -82,7 +82,7 @@ public:
float length() const;
float lengthSquared() const; //In Qt 6 convert to inline and constexpr
- QVector2D normalized() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QVector2D normalized() const;
void normalize();
float distanceToPoint(const QVector2D &point) const;
diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h
index f63b2f141b..be373aa806 100644
--- a/src/gui/math3d/qvector4d.h
+++ b/src/gui/math3d/qvector4d.h
@@ -88,7 +88,7 @@ public:
float length() const;
float lengthSquared() const; //In Qt 6 convert to inline and constexpr
- QVector4D normalized() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QVector4D normalized() const;
void normalize();
QVector4D &operator+=(const QVector4D &vector);
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index a76da20910..b5df68a3aa 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -49,7 +49,7 @@
# include <QtCore/qt_windows.h>
#endif
-// Note: Mac OSX is a "controlled platform" for OpenGL ABI so we
+// Note: Apple is a "controlled platform" for OpenGL ABI so we
// use the system provided headers there. Controlled means that the
// headers always match the actual driver implementation so there
// is no possibility of drivers exposing additional functionality
@@ -64,7 +64,7 @@
// which the system headers do not.
#if defined(QT_OPENGL_ES_2)
-# if defined(Q_OS_MAC) // iOS
+# if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
# if defined(QT_OPENGL_ES_3)
# include <OpenGLES/ES3/gl.h>
# include <OpenGLES/ES3/glext.h>
@@ -81,7 +81,7 @@
*/
typedef void* GLeglImageOES;
-# else // "uncontrolled" ES2 platforms
+# elif !defined(Q_OS_DARWIN) // "uncontrolled" ES2 platforms
// In "es2" builds (QT_OPENGL_ES_2) additional defines indicate GLES 3.0 or
// higher is available *at build time*. In this case include the corresponding
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 0831bfe706..766d4a327a 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -3302,6 +3302,9 @@ void QOpenGLTexture::setData(int mipLevel, int layer, CubeMapFace cubeFace,
/*!
\since 5.9
\overload
+
+ Parameter \a layerCount is the number of layers in a texture array
+ that are being uploaded/populated by this call.
*/
void QOpenGLTexture::setData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options)
{
@@ -3476,6 +3479,9 @@ void QOpenGLTexture::setCompressedData(int mipLevel, int layer, CubeMapFace cube
/*!
\since 5.9
\overload
+
+ Parameter \a layerCount is the number of layers in a texture array
+ that are being uploaded/populated by this call.
*/
void QOpenGLTexture::setCompressedData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options)
{
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index e254de6ad0..0c5ebcbda9 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -197,7 +197,7 @@ public:
QColor toCmyk() const Q_DECL_NOTHROW;
QColor toHsl() const Q_DECL_NOTHROW;
- QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW;
static QColor fromRgb(QRgb rgb) Q_DECL_NOTHROW;
static QColor fromRgba(QRgb rgba) Q_DECL_NOTHROW;
@@ -217,10 +217,10 @@ public:
static QColor fromHsl(int h, int s, int l, int a = 255);
static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
- QColor light(int f = 150) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
- QColor lighter(int f = 150) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
- QColor dark(int f = 200) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
- QColor darker(int f = 200) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW;
bool operator==(const QColor &c) const Q_DECL_NOTHROW;
bool operator!=(const QColor &c) const Q_DECL_NOTHROW;
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 7b35cd6143..0143e9b602 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -188,11 +188,7 @@ typedef ptrdiff_t QT_FT_PtrDist;
#include <stdlib.h>
#include <stdio.h>
- /* This macro is used to indicate that a function parameter is unused. */
- /* Its purpose is simply to reduce compiler warnings. Note also that */
- /* simply defining it as `(void)x' doesn't avoid warnings with certain */
- /* ANSI compilers (e.g. LCC). */
-#define QT_FT_UNUSED( x ) (x) = (x)
+#define QT_FT_UNUSED( x ) (void) x
#define QT_FT_TRACE5( x ) do { } while ( 0 ) /* nothing */
#define QT_FT_TRACE7( x ) do { } while ( 0 ) /* nothing */
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index 76bf61671c..15e0ab5be1 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -108,7 +108,7 @@ public:
bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); }
qreal determinant() const { return _m11*_m22 - _m12*_m21; }
- QMatrix inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QMatrix inverted(bool *invertible = Q_NULLPTR) const;
bool operator==(const QMatrix &) const;
bool operator!=(const QMatrix &) const;
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h
index 131fcde8cc..db39c1c5a0 100644
--- a/src/gui/painting/qpainterpath.h
+++ b/src/gui/painting/qpainterpath.h
@@ -154,8 +154,8 @@ public:
void translate(qreal dx, qreal dy);
inline void translate(const QPointF &offset);
- QPainterPath translated(qreal dx, qreal dy) const Q_REQUIRED_RESULT;
- inline QPainterPath translated(const QPointF &offset) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPainterPath translated(qreal dx, qreal dy) const;
+ Q_REQUIRED_RESULT inline QPainterPath translated(const QPointF &offset) const;
QRectF boundingRect() const;
QRectF controlPointRect() const;
@@ -165,7 +165,7 @@ public:
bool isEmpty() const;
- QPainterPath toReversed() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPainterPath toReversed() const;
QList<QPolygonF> toSubpathPolygons(const QMatrix &matrix = QMatrix()) const;
QList<QPolygonF> toFillPolygons(const QMatrix &matrix = QMatrix()) const;
QPolygonF toFillPolygon(const QMatrix &matrix = QMatrix()) const;
@@ -185,12 +185,12 @@ public:
bool intersects(const QPainterPath &p) const;
bool contains(const QPainterPath &p) const;
- QPainterPath united(const QPainterPath &r) const Q_REQUIRED_RESULT;
- QPainterPath intersected(const QPainterPath &r) const Q_REQUIRED_RESULT;
- QPainterPath subtracted(const QPainterPath &r) const Q_REQUIRED_RESULT;
- QPainterPath subtractedInverted(const QPainterPath &r) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPainterPath united(const QPainterPath &r) const;
+ Q_REQUIRED_RESULT QPainterPath intersected(const QPainterPath &r) const;
+ Q_REQUIRED_RESULT QPainterPath subtracted(const QPainterPath &r) const;
+ Q_REQUIRED_RESULT QPainterPath subtractedInverted(const QPainterPath &r) const;
- QPainterPath simplified() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPainterPath simplified() const;
bool operator==(const QPainterPath &other) const;
bool operator!=(const QPainterPath &other) const;
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index c57802e84e..f192e8d10b 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -78,8 +78,8 @@ public:
void translate(int dx, int dy);
void translate(const QPoint &offset);
- QPolygon translated(int dx, int dy) const Q_REQUIRED_RESULT;
- inline QPolygon translated(const QPoint &offset) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPolygon translated(int dx, int dy) const;
+ Q_REQUIRED_RESULT inline QPolygon translated(const QPoint &offset) const;
QRect boundingRect() const;
@@ -95,9 +95,9 @@ public:
bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
- QPolygon united(const QPolygon &r) const Q_REQUIRED_RESULT;
- QPolygon intersected(const QPolygon &r) const Q_REQUIRED_RESULT;
- QPolygon subtracted(const QPolygon &r) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPolygon united(const QPolygon &r) const;
+ Q_REQUIRED_RESULT QPolygon intersected(const QPolygon &r) const;
+ Q_REQUIRED_RESULT QPolygon subtracted(const QPolygon &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygon)
@@ -162,7 +162,7 @@ public:
void translate(const QPointF &offset);
inline QPolygonF translated(qreal dx, qreal dy) const;
- QPolygonF translated(const QPointF &offset) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPolygonF translated(const QPointF &offset) const;
QPolygon toPolygon() const;
@@ -172,9 +172,9 @@ public:
bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
- QPolygonF united(const QPolygonF &r) const Q_REQUIRED_RESULT;
- QPolygonF intersected(const QPolygonF &r) const Q_REQUIRED_RESULT;
- QPolygonF subtracted(const QPolygonF &r) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QPolygonF united(const QPolygonF &r) const;
+ Q_REQUIRED_RESULT QPolygonF intersected(const QPolygonF &r) const;
+ Q_REQUIRED_RESULT QPolygonF subtracted(const QPolygonF &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygonF)
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 4f0a071da8..8dd7649447 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -99,23 +99,23 @@ public:
void translate(int dx, int dy);
inline void translate(const QPoint &p) { translate(p.x(), p.y()); }
- QRegion translated(int dx, int dy) const Q_REQUIRED_RESULT;
- inline QRegion translated(const QPoint &p) const Q_REQUIRED_RESULT { return translated(p.x(), p.y()); }
+ Q_REQUIRED_RESULT QRegion translated(int dx, int dy) const;
+ Q_REQUIRED_RESULT inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
- QRegion united(const QRegion &r) const Q_REQUIRED_RESULT;
- QRegion united(const QRect &r) const Q_REQUIRED_RESULT;
- QRegion intersected(const QRegion &r) const Q_REQUIRED_RESULT;
- QRegion intersected(const QRect &r) const Q_REQUIRED_RESULT;
- QRegion subtracted(const QRegion &r) const Q_REQUIRED_RESULT;
- QRegion xored(const QRegion &r) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QRegion united(const QRegion &r) const;
+ Q_REQUIRED_RESULT QRegion united(const QRect &r) const;
+ Q_REQUIRED_RESULT QRegion intersected(const QRegion &r) const;
+ Q_REQUIRED_RESULT QRegion intersected(const QRect &r) const;
+ Q_REQUIRED_RESULT QRegion subtracted(const QRegion &r) const;
+ Q_REQUIRED_RESULT QRegion xored(const QRegion &r) const;
#if QT_DEPRECATED_SINCE(5, 0)
- inline QT_DEPRECATED QRegion unite(const QRegion &r) const Q_REQUIRED_RESULT { return united(r); }
- inline QT_DEPRECATED QRegion unite(const QRect &r) const Q_REQUIRED_RESULT { return united(r); }
- inline QT_DEPRECATED QRegion intersect(const QRegion &r) const Q_REQUIRED_RESULT { return intersected(r); }
- inline QT_DEPRECATED QRegion intersect(const QRect &r) const Q_REQUIRED_RESULT { return intersected(r); }
- inline QT_DEPRECATED QRegion subtract(const QRegion &r) const Q_REQUIRED_RESULT { return subtracted(r); }
- inline QT_DEPRECATED QRegion eor(const QRegion &r) const Q_REQUIRED_RESULT { return xored(r); }
+ Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion unite(const QRegion &r) const { return united(r); }
+ Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion unite(const QRect &r) const { return united(r); }
+ Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion intersect(const QRegion &r) const { return intersected(r); }
+ Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion intersect(const QRect &r) const { return intersected(r); }
+ Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion subtract(const QRegion &r) const { return subtracted(r); }
+ Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion eor(const QRegion &r) const { return xored(r); }
#endif
bool intersects(const QRegion &r) const;
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 5ca1d46982..06ae611861 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -116,9 +116,9 @@ public:
qreal m21, qreal m22, qreal m23,
qreal m31, qreal m32, qreal m33);
- QTransform inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT;
- QTransform adjoint() const Q_REQUIRED_RESULT;
- QTransform transposed() const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QTransform inverted(bool *invertible = Q_NULLPTR) const;
+ Q_REQUIRED_RESULT QTransform adjoint() const;
+ Q_REQUIRED_RESULT QTransform transposed() const;
QTransform &translate(qreal dx, qreal dy);
QTransform &scale(qreal sx, qreal sy);
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 599b18ac05..4ad826e87b 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -45,6 +45,7 @@
#include <qpa/qplatformscreen.h>
#include <QtCore/QLibraryInfo>
#include <QtCore/QDir>
+#include <QtCore/QMetaEnum>
#include <algorithm>
#include <iterator>
@@ -201,6 +202,26 @@ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWr
return *this;
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QSupportedWritingSystems &sws)
+{
+ QMetaObject mo = QFontDatabase::staticMetaObject;
+ QMetaEnum me = mo.enumerator(mo.indexOfEnumerator("WritingSystem"));
+
+ QDebugStateSaver saver(debug);
+ debug.nospace() << "QSupportedWritingSystems(";
+ int i = sws.d->vector.indexOf(true);
+ while (i > 0) {
+ debug << me.valueToKey(i);
+ i = sws.d->vector.indexOf(true, i + 1);
+ if (i > 0)
+ debug << ", ";
+ }
+ debug << ")";
+ return debug;
+}
+#endif
+
/*!
Destroys the supported writing systems object.
*/
diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h
index 2d99183ca3..2ca783f0fd 100644
--- a/src/gui/text/qplatformfontdatabase.h
+++ b/src/gui/text/qplatformfontdatabase.h
@@ -84,11 +84,18 @@ private:
friend Q_GUI_EXPORT bool operator==(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
friend Q_GUI_EXPORT bool operator!=(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QSupportedWritingSystems &);
+#endif
};
Q_GUI_EXPORT bool operator==(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
Q_GUI_EXPORT bool operator!=(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QSupportedWritingSystems &);
+#endif
+
class QFontRequestPrivate;
class QFontEngineMulti;
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 8834afc80e..fcda17605f 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -292,7 +292,7 @@ void QSyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block)
/*!
Constructs a QSyntaxHighlighter with the given \a parent.
- If the parent is a QTextEdit, it installs the syntaxhighlighter on the
+ If the parent is a QTextEdit, it installs the syntax highlighter on the
parents document. The specified QTextEdit also becomes the owner of
the QSyntaxHighlighter.
*/
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index 3a78296c57..ea37695f4e 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -825,9 +825,13 @@ bool QTextHtmlImporter::closeTag()
break;
case Html_div:
- if (closedNode->children.isEmpty())
- break;
- Q_FALLTHROUGH();
+ if (cursor.position() > 0) {
+ const QChar curChar = cursor.document()->characterAt(cursor.position() - 1);
+ if (!closedNode->children.isEmpty() && curChar != QChar::LineSeparator) {
+ blockTagClosed = true;
+ }
+ }
+ break;
default:
if (closedNode->isBlock())
blockTagClosed = true;