From c8df1a2c6dcf47bb784d31905b3cb918ac02dac2 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Wed, 20 Nov 2019 08:30:50 +0100 Subject: QTemporaryFile: Add a note about behavior on Linux Mostly copied from the 5.10 changelog file. Task-number: QTBUG-80157 Change-Id: I58654fe998ada603241b9a7cb967f55e66ebc954 Reviewed-by: Christian Ehrlicher Reviewed-by: Tomasz Siekierda Reviewed-by: Thiago Macieira --- src/corelib/io/qtemporaryfile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index acd31f4d84..55d13dad70 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -631,6 +631,12 @@ QString QTemporaryFilePrivate::defaultTemplateName() case sensitive. If the template is not present in the filename, QTemporaryFile appends the generated part to the filename given. + \note On Linux, QTemporaryFile will attempt to create unnamed temporary + files. If that succeeds, open() will return true but exists() will be + false. If you call fileName() or any function that calls it, + QTemporaryFile will give the file a name, so most applications will + not see a difference. + \sa QDir::tempPath(), QFile */ -- cgit v1.2.3 From 3b98fe7f773668ed8b35478fa3a8ca0590acc450 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 18 Nov 2019 18:53:59 +0300 Subject: xcb: Simplify code by using helper QXcbIntegration::defaultConnection() Change-Id: Ieb0e21d85fcd0c168b1bb090e967d02a8a6a6083 Reviewed-by: Mikhail Svetkin --- src/plugins/platforms/xcb/qxcbintegration.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 95ca40fc95..efda6b67ce 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -317,8 +317,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const case OpenGL: case ThreadedOpenGL: { - const auto *connection = qAsConst(m_connections).first(); - if (const auto *integration = connection->glIntegration()) + if (const auto *integration = defaultConnection()->glIntegration()) return cap != ThreadedOpenGL || integration->supportsThreadedOpenGL(); return false; } -- cgit v1.2.3 From 5d1af4f0be0815778aa4f9c3e32a432d9989613b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 8 Nov 2019 16:55:06 +0100 Subject: Compile fontconfig-related code on non-Unix platforms ...if the feature is enabled. This fixes the build for MSYS2 with fontconfig. Fixes: QTBUG-79748 Change-Id: I2c834b6d968766f98c5df2f3df5c8c9bdbd80f11 Reviewed-by: Kai Koehne --- src/platformsupport/fontdatabases/fontdatabases.pro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/fontdatabases/fontdatabases.pro b/src/platformsupport/fontdatabases/fontdatabases.pro index f2bac9ab94..c3985ed398 100644 --- a/src/platformsupport/fontdatabases/fontdatabases.pro +++ b/src/platformsupport/fontdatabases/fontdatabases.pro @@ -17,9 +17,10 @@ qtConfig(freetype) { unix { include($$PWD/genericunix/genericunix.pri) - qtConfig(fontconfig) { - include($$PWD/fontconfig/fontconfig.pri) - } +} + +qtConfig(fontconfig) { + include($$PWD/fontconfig/fontconfig.pri) } win32:!winrt { -- cgit v1.2.3 From 73a764c24700089228b4092e983061f788c6d232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 19 Nov 2019 17:15:50 +0100 Subject: =?UTF-8?q?Don=E2=80=99t=20warn=20on=20QT=5FAUTO=5FSCREEN=5FSCALE?= =?UTF-8?q?=5FFACTOR=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This warning turned out to be spammy, since the env. variable may be set by KDE, in which case there is nothing the user or app developer can do to fix the situation. QT_AUTO_SCREEN_SCALE_FACTOR is now Done on X11, and remains Deprecated on all other platforms. Change-Id: I9d372655624b0e0b822f0a70e9aec4b18ab98630 Reviewed-by: Frederik Gladhorn --- src/gui/kernel/qhighdpiscaling.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 0782a49481..fde6bb0180 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -56,6 +56,9 @@ Q_LOGGING_CATEGORY(lcScaling, "qt.scaling"); #ifndef QT_NO_HIGHDPISCALING static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO"; + +// Note: QT_AUTO_SCREEN_SCALE_FACTOR is Done on X11, and should be kept +// working as-is. It's Deprecated on all other platforms. static const char legacyAutoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR"; static const char enableHighDpiScalingEnvVar[] = "QT_ENABLE_HIGHDPI_SCALING"; @@ -104,12 +107,6 @@ static inline qreal initialGlobalScaleFactor() if (dpr > 0) result = dpr; } - - if (qEnvironmentVariableIsSet(legacyAutoScreenEnvVar)) { - qWarning("Warning: %s is deprecated. Instead use:\n" - " %s to enable platform plugin controlled per-screen factors.", - legacyAutoScreenEnvVar, enableHighDpiScalingEnvVar); - } } return result; } -- cgit v1.2.3 From 924887965cbe0312df1271b097671a9e2266eb5a Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 21 Nov 2019 13:21:07 +0100 Subject: Fuzzing: Update location of testcases in Readme At the time of writing, they were still planned to be in qtbase. Change-Id: I27cba2bbd176d930990270ea68f077ec6e0a2d5b Reviewed-by: Paul Wicking --- tests/libfuzzer/README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/libfuzzer/README b/tests/libfuzzer/README index 57140cebfb..684c4bca5c 100644 --- a/tests/libfuzzer/README +++ b/tests/libfuzzer/README @@ -29,7 +29,8 @@ To run a test with libFuzzer: Depending on the expected input format of the tested function, you will get results faster if you: * provide a set of interesting input data by passing the path of a directory which contains - these data, each in one file. You can find such data sets in the subdirectory "testcases". + these data, each in one file. You can find such data sets in the subdirectory + "fuzzing/testcases" of the qtqa repository. * pass a so-called dictionary listing keywords of the input format using -dict= A couple of such dictionaries are provided by AFL (http://lcamtuf.coredump.cx/afl/) -- cgit v1.2.3 From 5142fe2c54970040fb6967848156a5f28b5a2dc9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 16 Nov 2019 19:25:11 +0100 Subject: rhi: d3d11: Do not rely on Win10-only enum value When building against a 8.1 or older SDK the Windows 10-only value DXGI_SWAP_EFFECT_FLIP_DISCARD may not be present. Just use the value directly. At runtime that code path cannot be hit anyway when running on 8.1 or older. Task-number: QTBUG-80084 Change-Id: I0974b82db770e5487315798432ee601937b96c5e Reviewed-by: Friedemann Kleint --- src/gui/rhi/qrhid3d11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 717f3e6d6c..5e576e9c6a 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -3922,7 +3922,7 @@ bool QD3D11SwapChain::buildOrResize() desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; desc.BufferCount = BUFFER_COUNT; desc.Scaling = DXGI_SCALING_STRETCH; - desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; + desc.SwapEffect = DXGI_SWAP_EFFECT(4); // DXGI_SWAP_EFFECT_FLIP_DISCARD // Do not bother with AlphaMode, if won't work unless we go through // DirectComposition. Instead, we just take the other (DISCARD) // path for now when alpha is requested. -- cgit v1.2.3 From 935681eaca1229f100e54f7447be0e23ceba684b Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Fri, 22 Nov 2019 11:01:23 +0100 Subject: QSortFilterProxyModel: Add change signals for properties Makes it more easily consumable from QML. This patch only adds them for properties where no behavior change (i.e. no "if (m_foo == foo) return" changes) is necessary. The other ones will be done in a follow-up patch. Change-Id: If9f35cf9ac382e6f626db138a88eb14cebda1d52 Reviewed-by: David Faure --- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 6 ++++++ src/corelib/itemmodels/qsortfilterproxymodel.h | 22 ++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 978102035e..21303549ab 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -2682,6 +2682,7 @@ void QSortFilterProxyModel::setFilterCaseSensitivity(Qt::CaseSensitivity cs) d->filter_about_to_be_changed(); d->filter_data.setCaseSensitivity(cs); d->filter_changed(); + emit filterCaseSensitivityChanged(cs); } /*! @@ -2707,6 +2708,7 @@ void QSortFilterProxyModel::setSortCaseSensitivity(Qt::CaseSensitivity cs) d->sort_casesensitivity = cs; d->sort(); + emit sortCaseSensitivityChanged(cs); } /*! @@ -2732,6 +2734,7 @@ void QSortFilterProxyModel::setSortLocaleAware(bool on) d->sort_localeaware = on; d->sort(); + emit sortLocaleAwareChanged(on); } /*! @@ -2856,6 +2859,7 @@ void QSortFilterProxyModel::setSortRole(int role) return; d->sort_role = role; d->sort(); + emit sortRoleChanged(role); } /*! @@ -2881,6 +2885,7 @@ void QSortFilterProxyModel::setFilterRole(int role) d->filter_about_to_be_changed(); d->filter_role = role; d->filter_changed(); + emit filterRoleChanged(role); } /*! @@ -2907,6 +2912,7 @@ void QSortFilterProxyModel::setRecursiveFilteringEnabled(bool recursive) d->filter_about_to_be_changed(); d->filter_recursive = recursive; d->filter_changed(); + emit recursiveFilteringEnabledChanged(recursive); } #if QT_DEPRECATED_SINCE(5, 11) diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 303226668f..91253dd601 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -68,12 +68,12 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel #endif Q_PROPERTY(int filterKeyColumn READ filterKeyColumn WRITE setFilterKeyColumn) Q_PROPERTY(bool dynamicSortFilter READ dynamicSortFilter WRITE setDynamicSortFilter) - Q_PROPERTY(Qt::CaseSensitivity filterCaseSensitivity READ filterCaseSensitivity WRITE setFilterCaseSensitivity) - Q_PROPERTY(Qt::CaseSensitivity sortCaseSensitivity READ sortCaseSensitivity WRITE setSortCaseSensitivity) - Q_PROPERTY(bool isSortLocaleAware READ isSortLocaleAware WRITE setSortLocaleAware) - Q_PROPERTY(int sortRole READ sortRole WRITE setSortRole) - Q_PROPERTY(int filterRole READ filterRole WRITE setFilterRole) - Q_PROPERTY(bool recursiveFilteringEnabled READ isRecursiveFilteringEnabled WRITE setRecursiveFilteringEnabled) + Q_PROPERTY(Qt::CaseSensitivity filterCaseSensitivity READ filterCaseSensitivity WRITE setFilterCaseSensitivity NOTIFY filterCaseSensitivityChanged) + Q_PROPERTY(Qt::CaseSensitivity sortCaseSensitivity READ sortCaseSensitivity WRITE setSortCaseSensitivity NOTIFY sortCaseSensitivityChanged) + Q_PROPERTY(bool isSortLocaleAware READ isSortLocaleAware WRITE setSortLocaleAware NOTIFY sortLocaleAwareChanged) + Q_PROPERTY(int sortRole READ sortRole WRITE setSortRole NOTIFY sortRoleChanged) + Q_PROPERTY(int filterRole READ filterRole WRITE setFilterRole NOTIFY filterRoleChanged) + Q_PROPERTY(bool recursiveFilteringEnabled READ isRecursiveFilteringEnabled WRITE setRecursiveFilteringEnabled NOTIFY recursiveFilteringEnabledChanged) public: explicit QSortFilterProxyModel(QObject *parent = nullptr); @@ -185,6 +185,16 @@ public: QStringList mimeTypes() const override; Qt::DropActions supportedDropActions() const override; + +Q_SIGNALS: + void dynamicSortFilterChanged(bool dynamicSortFilter); + void filterCaseSensitivityChanged(Qt::CaseSensitivity filterCaseSensitivity); + void sortCaseSensitivityChanged(Qt::CaseSensitivity sortCaseSensitivity); + void sortLocaleAwareChanged(bool sortLocaleAware); + void sortRoleChanged(int sortRole); + void filterRoleChanged(int filterRole); + void recursiveFilteringEnabledChanged(bool recursiveFilteringEnabled); + private: Q_DECLARE_PRIVATE(QSortFilterProxyModel) Q_DISABLE_COPY(QSortFilterProxyModel) -- cgit v1.2.3