From 5771b5325b85f71a8f8ff78ed13eaee3df2e3ba8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 5 Nov 2019 22:10:24 +0100 Subject: syncqt: Add a means to suspend/resume the processing of a file Rather than tweaking the parser to cover every eventuality with corner case lines that could cause incorrect header files to be created then the means to suspend/resume the processing of a file is added. This enables us to have it skip over the template line that is causing a QList header to be created as part of the QtGui headers. This patch includes the fix to solve this in addition. Fixes: QTBUG-68129 Change-Id: I751646c4b20a4434347c149ae5e6dcb6e7618853 Reviewed-by: Joerg Bornemann --- src/gui/kernel/qevent.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 2b1c6a6e31..0a8a1925e7 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -827,7 +827,14 @@ private: qint64 m_numericId; }; Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE); + +#if 0 +#pragma qt_sync_suspend_processing +#endif template <> class QList {}; // to prevent instantiation: use QVector instead +#if 0 +#pragma qt_sync_resume_processing +#endif Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW; inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW -- cgit v1.2.3 From 8f2db974ab594125301aac62594510e146125cb4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 1 Nov 2019 11:15:32 +0100 Subject: Windows QPA: Fix wrong scaling of fixed size in window creation phase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a fixed size the window is moved to another screen by QPlatformWindow::initialGeometry(), the size constraints would be incorrectly scaled using the initial screen in the handling of WM_GETMINMAXINFO. To fix this, pass the resulting screen out of QPlatformWindow::initialGeometry() and use it during the window creation phase. Fixes: QTBUG-77307 Change-Id: I149a2a65e816da841a32abc14a495925bf9cc6f6 Reviewed-by: André de la Rocha Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qplatformwindow.cpp | 9 +++++++-- src/gui/kernel/qplatformwindow.h | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 2a0cb1094c..65accc9f68 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -694,9 +694,12 @@ static QSize fixInitialSize(QSize size, const QWindow *w, However if the given window already has geometry which the application has initialized, it takes priority. */ -QRect QPlatformWindow::initialGeometry(const QWindow *w, - const QRect &initialGeometry, int defaultWidth, int defaultHeight) +QRect QPlatformWindow::initialGeometry(const QWindow *w, const QRect &initialGeometry, + int defaultWidth, int defaultHeight, + const QScreen **resultingScreenReturn) { + if (resultingScreenReturn) + *resultingScreenReturn = w->screen(); if (!w->isTopLevel()) { const qreal factor = QHighDpiScaling::factor(w); const QSize size = fixInitialSize(QHighDpi::fromNative(initialGeometry.size(), factor), @@ -712,6 +715,8 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, : QGuiApplication::screenAt(initialGeometry.center()); if (!screen) return initialGeometry; + if (resultingScreenReturn) + *resultingScreenReturn = screen; // initialGeometry refers to window's screen QRect rect(QHighDpi::fromNativePixels(initialGeometry, w)); if (wp->resizeAutomatic) diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 4d48cc2f13..b6aeb3a86a 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -63,6 +63,7 @@ QT_BEGIN_NAMESPACE class QPlatformScreen; class QPlatformWindowPrivate; +class QScreen; class QWindow; class QIcon; class QRegion; @@ -142,8 +143,9 @@ public: virtual void invalidateSurface(); - static QRect initialGeometry(const QWindow *w, - const QRect &initialGeometry, int defaultWidth, int defaultHeight); + static QRect initialGeometry(const QWindow *w, const QRect &initialGeometry, + int defaultWidth, int defaultHeight, + const QScreen **resultingScreenReturn = nullptr); virtual void requestUpdate(); bool hasPendingUpdateRequest() const; -- cgit v1.2.3 From 364160600889d6055a556a189e6f3d4a8dc3f96d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 8 Nov 2019 14:02:01 +0100 Subject: Use default QTD font size for mono font when importing markdown QFontDatabase::systemFont(FixedFont) determines the font for inline code and code blocks in a markdown document. Now we change the size of that font to the same size as QTextDocument::defaultFont() so that the user has the ability to customize the font size in each document instead of only system-wide. Change-Id: Ief7367336f7613e88695dbb08bcb7e9f50db8961 Reviewed-by: Shawn Rutledge --- src/gui/text/qtextmarkdownimporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui') diff --git a/src/gui/text/qtextmarkdownimporter.cpp b/src/gui/text/qtextmarkdownimporter.cpp index c2ad1e5612..78d18a714b 100644 --- a/src/gui/text/qtextmarkdownimporter.cpp +++ b/src/gui/text/qtextmarkdownimporter.cpp @@ -160,6 +160,10 @@ void QTextMarkdownImporter::import(QTextDocument *doc, const QString &markdown) m_paragraphMargin = m_doc->defaultFont().pointSize() * 2 / 3; m_cursor = new QTextCursor(doc); doc->clear(); + if (doc->defaultFont().pointSize() != -1) + m_monoFont.setPointSize(doc->defaultFont().pointSize()); + else + m_monoFont.setPixelSize(doc->defaultFont().pixelSize()); qCDebug(lcMD) << "default font" << doc->defaultFont() << "mono font" << m_monoFont; QByteArray md = markdown.toUtf8(); md_parse(md.constData(), MD_SIZE(md.size()), &callbacks, this); -- cgit v1.2.3 From 103d307f2e596e5e7d2eb706117223bf65264e5f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 30 Sep 2019 12:00:43 -0700 Subject: Be explicit about QDataStream serialization: explicit casts to int The reader uses int variables, so use the same in the writer. Change-Id: I1496b069cc534f1a838dfffd15c94c7cacd3dd93 Reviewed-by: Laszlo Agocs --- src/gui/rhi/qshader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp index c22b029dc8..9d35d83336 100644 --- a/src/gui/rhi/qshader.cpp +++ b/src/gui/rhi/qshader.cpp @@ -348,10 +348,10 @@ void QShader::removeShader(const QShaderKey &key) static void writeShaderKey(QDataStream *ds, const QShaderKey &k) { - *ds << k.source(); + *ds << int(k.source()); *ds << k.sourceVersion().version(); *ds << k.sourceVersion().flags(); - *ds << k.sourceVariant(); + *ds << int(k.sourceVariant()); } /*! @@ -369,7 +369,7 @@ QByteArray QShader::serialized() const return QByteArray(); ds << QSB_VERSION; - ds << d->stage; + ds << int(d->stage); ds << d->desc.toBinaryJson(); ds << d->shaders.count(); for (auto it = d->shaders.cbegin(), itEnd = d->shaders.cend(); it != itEnd; ++it) { -- cgit v1.2.3 From 80ac9e8b7ce8e3f79af0b00610a0a4b0ff17abe4 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 12 Nov 2019 17:59:51 +0100 Subject: Compile fix for MinGW 8.1.0 Workaround for libpng bug in GCC 8.1.0. Task-number: QTQAINFRA-3303 Change-Id: Id7668e795cb4ab16de3199fc3727d844aa31bfad Reviewed-by: Ville Voutilainen --- src/gui/image/image.pri | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gui') diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri index 3b2ced3f58..1f42f28d1e 100644 --- a/src/gui/image/image.pri +++ b/src/gui/image/image.pri @@ -79,6 +79,14 @@ qtConfig(png) { HEADERS += image/qpnghandler_p.h SOURCES += image/qpnghandler.cpp QMAKE_USE_PRIVATE += libpng + + win32:mingw { + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86048 + GCC_VERSION = "$${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}.$${QMAKE_GCC_PATCH_VERSION}" + equals(GCC_VERSION, "8.1.0") { + QMAKE_CXXFLAGS += -fno-reorder-blocks-and-partition + } + } } # SIMD -- cgit v1.2.3