summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/configure.json6
-rw-r--r--src/gui/doc/qtgui.qdocconf5
-rw-r--r--src/gui/image/qbmphandler.cpp2
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp9
-rw-r--r--src/gui/kernel/qplatformwindow.h2
-rw-r--r--src/gui/kernel/qtestsupport_gui.cpp10
-rw-r--r--src/gui/kernel/qwindow.cpp3
-rw-r--r--src/gui/painting/qdrawhelper_sse4.cpp2
-rw-r--r--src/gui/painting/qpdf.cpp7
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp1
-rw-r--r--src/gui/text/qtextengine.cpp12
12 files changed, 35 insertions, 26 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 39c0232c0b..70d0817791 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -239,7 +239,8 @@
"sources": [
{ "type": "pkgConfig", "args": "freetype2" },
{ "type": "freetype", "libs": "-lfreetype", "condition": "!config.wasm" },
- { "libs": "-s USE_FREETYPE=1", "condition": "config.wasm" }
+ { "libs": "-s USE_FREETYPE=1", "condition": "config.wasm" },
+ { "libs": "-lfreetype" }
],
"use": [
{ "lib": "zlib", "condition": "features.system-zlib" }
@@ -1436,7 +1437,7 @@
},
"eglfs_x11": {
"label": "EGLFS X11",
- "condition": "features.eglfs && features.xcb && features.xcb-xlib && features.egl_x11",
+ "condition": "features.eglfs && features.xcb-xlib && features.egl_x11",
"output": [ "privateFeature" ]
},
"gif": {
@@ -1569,7 +1570,6 @@
},
"xcb-xlib": {
"label": "XCB Xlib",
- "emitIf": "features.xcb",
"condition": "features.xlib && libs.xcb_xlib",
"output": [ "privateFeature" ]
},
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index e546c817a7..b8b8a00cd6 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -54,7 +54,10 @@ exampledirs += ../../../examples/gui \
imagedirs += images \
../../../examples/gui/doc/images \
- ../../../doc/src/images \
+ ../../../doc/src/images
+
+# Included in qttestlib.qdocconf instead
+excludefiles += ../kernel/qtestsupport_gui.cpp
manifestmeta.highlighted.names = "QtGui/Analog Clock Window Example"
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 5dff4ab0ac..7257853c3e 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -188,7 +188,7 @@ static bool read_dib_infoheader(QDataStream &s, BMP_INFOHDR &bi)
if (!(comp == BMP_RGB || (nbits == 4 && comp == BMP_RLE4) ||
(nbits == 8 && comp == BMP_RLE8) || ((nbits == 16 || nbits == 32) && comp == BMP_BITFIELDS)))
return false; // weird compression type
- if (bi.biWidth < 0 || quint64(bi.biWidth) * qAbs(bi.biHeight) > 16384 * 16384)
+ if (bi.biWidth <= 0 || !bi.biHeight || quint64(bi.biWidth) * qAbs(bi.biHeight) > 16384 * 16384)
return false;
return true;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index c02a396b00..16de045cf0 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3570,7 +3570,7 @@ void QImage::rgbSwapped_inplace()
The loader attempts to read the image using the specified \a format, e.g.,
PNG or JPG. If \a format is not specified (which is the default), it is
auto-detected based on the file's suffix and header. For details, see
- {QImageReader::setAutoDetectImageFormat()}{QImageReader}.
+ QImageReader::setAutoDetectImageFormat().
The file name can either refer to an actual file on disk or to one
of the application's embedded resources. See the
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index a455aa639d..22e46e0851 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -313,9 +313,12 @@ void QHighDpiScaling::updateHighDpiScaling()
}
m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
- QPlatformScreen *primaryScreen = QGuiApplication::primaryScreen()->handle();
- qreal sf = screenSubfactor(primaryScreen);
- QDpi primaryDpi = primaryScreen->logicalDpi();
+ QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ if (!primaryScreen)
+ return;
+ QPlatformScreen *platformScreen = primaryScreen->handle();
+ qreal sf = screenSubfactor(platformScreen);
+ QDpi primaryDpi = platformScreen->logicalDpi();
m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf);
}
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 995ccad70e..4d48cc2f13 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -110,7 +110,7 @@ public:
virtual bool isActive() const;
virtual bool isAncestorOf(const QPlatformWindow *child) const;
virtual bool isEmbedded() const;
- virtual bool isForeignWindow() const { return window()->type() == Qt::ForeignWindow; };
+ virtual bool isForeignWindow() const { return false; };
virtual QPoint mapToGlobal(const QPoint &pos) const;
virtual QPoint mapFromGlobal(const QPoint &pos) const;
diff --git a/src/gui/kernel/qtestsupport_gui.cpp b/src/gui/kernel/qtestsupport_gui.cpp
index 56e0eb52b3..8a6f662274 100644
--- a/src/gui/kernel/qtestsupport_gui.cpp
+++ b/src/gui/kernel/qtestsupport_gui.cpp
@@ -44,23 +44,21 @@
QT_BEGIN_NAMESPACE
-/*! \fn bool qWaitForWindowActive(QWindow *window, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a window is active.
Returns \c true if \c window is active within \a timeout milliseconds, otherwise returns \c false.
- \sa QTest::qWaitForWindowExposed(), QWindow::isActive()
+ \sa qWaitForWindowExposed(), QWindow::isActive()
*/
Q_GUI_EXPORT bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
{
return QTest::qWaitFor([&]() { return window->isActive(); }, timeout);
}
-/*! \fn bool qWaitForWindowExposed(QWindow *window, int timeout)
- \relates QTest
+/*!
\since 5.0
Waits for \a timeout milliseconds or until the \a window is exposed.
@@ -73,7 +71,7 @@ Q_GUI_EXPORT bool QTest::qWaitForWindowActive(QWindow *window, int timeout)
area is completely covered by other windows, or if the window is otherwise not visible. This function
will then time out when waiting for such a window.
- \sa QTest::qWaitForWindowActive(), QWindow::isExposed()
+ \sa qWaitForWindowActive(), QWindow::isExposed()
*/
Q_GUI_EXPORT bool QTest::qWaitForWindowExposed(QWindow *window, int timeout)
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index c85f6a118d..0b833cfbc7 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -919,8 +919,7 @@ void QWindow::setFlag(Qt::WindowType flag, bool on)
*/
Qt::WindowType QWindow::type() const
{
- Q_D(const QWindow);
- return static_cast<Qt::WindowType>(int(d->windowFlags & Qt::WindowType_Mask));
+ return static_cast<Qt::WindowType>(int(flags() & Qt::WindowType_Mask));
}
/*!
diff --git a/src/gui/painting/qdrawhelper_sse4.cpp b/src/gui/painting/qdrawhelper_sse4.cpp
index e4b93e8511..1da3b75ade 100644
--- a/src/gui/painting/qdrawhelper_sse4.cpp
+++ b/src/gui/painting/qdrawhelper_sse4.cpp
@@ -225,7 +225,7 @@ template<bool RGBA>
static inline void convertARGBFromRGBA64PM_sse4(uint *buffer, const QRgba64 *src, int count)
{
int i = 0;
- const __m128i alphaMask = _mm_set1_epi64x(Q_UINT64_C(0xffff) << 48);
+ const __m128i alphaMask = _mm_set1_epi64x(qint64(Q_UINT64_C(0xffff) << 48));
const __m128i alphaMask32 = _mm_set1_epi32(0xff000000);
const __m128i rgbaMask = _mm_setr_epi8(2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15);
const __m128i zero = _mm_setzero_si128();
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 83c7ba1add..b23cc903b1 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1954,13 +1954,14 @@ void QPdfEnginePrivate::writePage()
"/Contents %d 0 R\n"
"/Resources %d 0 R\n"
"/Annots %d 0 R\n"
- "/MediaBox [0 0 %f %f]\n",
+ "/MediaBox [0 0 %s %s]\n",
pageRoot, pageStream, resources, annots,
// make sure we use the pagesize from when we started the page, since the user may have changed it
- currentPage->pageSize.width() / userUnit, currentPage->pageSize.height() / userUnit);
+ QByteArray::number(currentPage->pageSize.width() / userUnit, 'f').constData(),
+ QByteArray::number(currentPage->pageSize.height() / userUnit, 'f').constData());
if (pdfVersion >= QPdfEngine::Version_1_6)
- xprintf("/UserUnit %f\n", userUnit);
+ xprintf("/UserUnit %s\n", QByteArray::number(userUnit, 'f').constData());
xprintf(">>\n"
"endobj\n");
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 3081a4b1b6..afb4613ba5 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -411,6 +411,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
} else if (!region.isEmpty()){
funcs->glBindTexture(GL_TEXTURE_2D, d_ptr->textureId);
QPlatformGraphicsBufferHelper::lockAndBindToTexture(graphicsBuffer, &d_ptr->needsSwizzle, &d_ptr->premultiplied);
+ graphicsBuffer->unlock();
}
if (graphicsBuffer->origin() == QPlatformGraphicsBuffer::OriginBottomLeft)
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index bdb5592e9e..506df0664d 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1972,14 +1972,18 @@ void QTextEngine::shape(int item) const
}
// fix log clusters to point to the previous glyph, as the object doesn't have a glyph of it's own.
// This is required so that all entries in the array get initialized and are ordered correctly.
- ushort *lc = logClusters(&li);
- *lc = item ? lc[-1] : 0;
+ if (layoutData->logClustersPtr) {
+ ushort *lc = logClusters(&li);
+ *lc = (lc != layoutData->logClustersPtr) ? lc[-1] : 0;
+ }
} else if (li.analysis.flags == QScriptAnalysis::Tab) {
// set up at least the ascent/descent/leading of the script item for the tab
fontEngine(li, &li.ascent, &li.descent, &li.leading);
// see the comment above
- ushort *lc = logClusters(&li);
- *lc = item ? lc[-1] : 0;
+ if (layoutData->logClustersPtr) {
+ ushort *lc = logClusters(&li);
+ *lc = (lc != layoutData->logClustersPtr) ? lc[-1] : 0;
+ }
} else {
shapeText(item);
}