From 6881699d7605c29f61d6809c9fa9eb04807bef9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 10 Dec 2018 15:00:58 +0100 Subject: Fix layering violation in isForeignWindow() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPlatformWindow::isForeignWindow() should return whether the native window is of the foreign window type, or false if the platform (plugin) does not support this concept. It should not call QWindow::type(), since that function may itself be implemented in terms of isForeignWindow(). Change-Id: Ib67a5a44c5c1db0acb4d3bc155e187f8164146d1 Reviewed-by: Tor Arne Vestbø Reviewed-by: Timur Pocheptsov --- src/gui/kernel/qplatformwindow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 1590a10554..075ac0f82b 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -108,7 +108,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; -- cgit v1.2.3 From f4b77570e21c2d29ccdb923af73867b5055a6e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 24 Oct 2018 14:46:32 +0200 Subject: Make QWindow::type() reflect ForeignWindow status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Qt::ForeignWindow flag is or’ed to d->windowFlags by QWindow::flags(). Use this getter function instead of accessing d->windowFlags() directly. Change-Id: I6a82aa7e379ba51272954ffe7b87f108034da8c6 Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index bc2d6e6a17..0f5873543b 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(int(d->windowFlags & Qt::WindowType_Mask)); + return static_cast(int(flags() & Qt::WindowType_Mask)); } /*! -- cgit v1.2.3 From 66c9161d055ad221d1a0c53d35e00484027cf775 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 20 Dec 2018 00:29:08 +0100 Subject: Doc: Fix link in QImage::load() documentation Change-Id: I9a3a059a860f5b21253ab0e7cdc616cbfc9a3885 Reviewed-by: Eirik Aavitsland --- src/gui/image/qimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 0105f1decd..830a110d68 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3543,7 +3543,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 -- cgit v1.2.3 From 3b03150aa2af76b13424c988c6c7892d19cce6c5 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 12 Dec 2018 12:36:39 +0100 Subject: Doc: Restore documentation for QTest functions in other modules Qt Test library sources specific to Core, GUI and Widgets modules were moved around in commit 88867e39b. The new source locations must be referenced in Qt Test documentation configuration. The same sources are excluded in their original doc projects, and the related snippet file is moved over to qttestlib. The commit also fixes the remaining documentation issues for Qt Test. Change-Id: Ibe011aa83639e574d647f12bc9e53e618781bce6 Reviewed-by: Martin Smith --- src/gui/doc/qtgui.qdocconf | 5 ++++- src/gui/kernel/qtestsupport_gui.cpp | 10 ++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/gui') 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/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) { -- cgit v1.2.3 From a8db9b8663f0bf3d66b36b5f743bd2fd47105cb6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 8 Jan 2019 13:48:47 +0100 Subject: Fix a crash in QTextEngine when a paragraph only contains a tab This fixes a regression introduced by change c3d2d83fcb0f88de7d08cb7d088db8942e2e0f64. Change-Id: Idf840804c68cd6b1751e122b45e9dd2775af56f5 Fixes: QTBUG-72900 Fixes: QTBUG-72754 Reviewed-by: David Faure --- src/gui/text/qtextengine.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gui') 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); } -- cgit v1.2.3 From 81c3c66bb44c98b29a0181450ffa38a1c1fa06d9 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Tue, 8 Jan 2019 13:00:46 +0100 Subject: Fix PDF generation for locales using comma as decimal separator A previous change that extended the maximum PDF size has caused the generation of invalid PDF output when the current locale was set to something using commas instead of points when outputting floating point numbers through printf(). This change uses QByteArray::number() instead, which uses points, irrespective of the current locale. Fixes: QTBUG-72868 Fixes: QTBUG-72848 Change-Id: I292eba2d6c89b3e01957bb8c04c04bdca8ada316 Reviewed-by: Friedemann Kleint Reviewed-by: Tobias Koenig --- src/gui/painting/qpdf.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index e69726b617..ae3df6f9ec 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1953,13 +1953,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"); -- cgit v1.2.3 From 74c8aa76089ce0b16ddd4d560530cf6df85d397e Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 4 Jan 2019 10:32:28 +0100 Subject: bmp image handler: Reject invalid 0-dimension files early Avoid spending time on decoding attempt of invalid bmp files specifying height or width as 0. Change-Id: Ia6666088515eee54777f7154868fb7d07c6b4438 Done-with: Albert Astals Cid Reviewed-by: Lars Knoll Reviewed-by: Albert Astals Cid --- src/gui/image/qbmphandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') 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; -- cgit v1.2.3