Commit Graph

56267 Commits

Author SHA1 Message Date
Edward Welbourne
cfc2973eec Remove two unused resource files from tst_qsettings
Change-Id: Ia54fa1ffa6e739496667d1486ee7e5658cd6a74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
b0d55004b8 Inline a shared data-driven test table in tst_QSettings
Move its static populateWithFormats to before the class is declared
and make the _data() methods that call it (including one that did so
via another) inline so that we can see which are this simple - and
thus which aren't.

Change-Id: I71863244ba0e4bd188424b6a3f8d86d5d9f635a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
a7138c4fd1 Clean up includes involving tst_qmetatype_common.h
The functions it defines depend on many many types in QtCore for which
it did not have a #include; both files that included it thus had to
pull in QtCore to compile. Put that #include where it belongs and
clean out many specific QtCore includes that it makes redundant.

Change-Id: Ie9d9ec325d4879d771cb14baecb06fecbdaf62c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Edward Welbourne
76f9a768e8 Correct documentation of INI format's loss of type information
Although it loses type information for numeric types, it does preserve
the type of most other values.

This amends commit ee8a5f4917

Pick-to: 6.3 6.2 5.15
Change-Id: Id4d0e11eabff1874869b940c05055e0bebef5963
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-26 15:10:15 +02:00
Assam Boudjelthia
3a9aba287c Android: set useLegacyPackaging to true in build.gradle
Since we set android:extractNativeLibs to "true" in AndroidManifest.xml,
a warning is thrown by the gradle build, which needs the property
packagingOptions.jniLibs.useLegacyPackaging to be set to true.

Pick-to: 6.2 6.3 5.15
Change-Id: I725d2663d68ab88abfda630f8a61666510043967
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ramon Sadornil <ramon.sadornil@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-26 11:18:35 +00:00
Assam Boudjelthia
56dee3de5e Android: add missing properties in AndroidManifest.xml
Some missing values has to be defined in AndroidManifest.xml, otherwise,
warnings might be thrown.

* android:exported="true": because the manifest sets an intent-filter,
and it then has to explicitly to avoid the warning [1].
* android:allowBackup="true": this has to be explicitly set, we set it
to the default value here [2].
* android:fullBackupOnly="false": SDK 23+ use this to deteremine to
user auto backup or not, we set it to the default value here [3].

[1] https://developer.android.com/guide/topics/manifest/activity-
element#exported
[2] https://developer.android.com/guide/topics/manifest/application-
element#allowbackup
[3] https://developer.android.com/guide/topics/manifest/application-
element#fullBackupOnly

Pick-to: 6.2 6.3 5.15
Fixes: QTBUG-101320
Change-Id: I0872dc00e48a867154ec9ded26620383fb747918
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2022-04-26 11:18:35 +00:00
Sona Kurazyan
63b042fb21 QtWidgets: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Change-Id: I133b80334b66e0a5ab9546dd8e1ff0631e79601e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-26 09:01:26 +02:00
Sona Kurazyan
a7dc1e280b DBusConnection: reuse pre-defined constat values where possible
Change-Id: Ie32a0e87b1eed2db104bb23d58e747e651e04e63
Pick-to: 6.3 6.2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-26 07:01:06 +00:00
Sona Kurazyan
f0a72abfe3 AtSpiAdaptor: fix debug messages to output the values before clearing
Pick-to: 6.3 6.2
Change-Id: I945922c90396840128a79cb11443bf4ef5aadb13
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-26 09:01:01 +02:00
Sona Kurazyan
c1db1788c0 OpenGL: port away from QLatin1String
Replace the uses of QLatin1String with corresponding string literals
where applies, or with QLatin1StringView.

As a drive-by, fix formatting of a warning message in
qopenglengineshadermanager.cpp.

Task-number: QTBUG-98434
Change-Id: I12f4479637a8fe265138f240a1310d2d576454a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 07:00:43 +00:00
Yuhang Zhao
1ed449e168 Windows QPA: Only refresh the window theme if it really changes
WM_SETTINGCHANGE may be triggered in many different reasons,
we don't have to verify whether the system changes the global
theme or not in all cases. Although not officially documented,
there's a widely known and used technique to detect whether the
user actually changes the personalize settings or not, that is
when wParam is 0 and lParam is "ImmersiveColorSet", this
combination indicates system's personalize settings has been
changed. We can get rid of most unneeded verify of system theme
by only execute the logic in this specific case.

Change-Id: Iaf934c29975b3b2090fd692776f80b1125d3ddb3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-04-26 13:44:49 +08:00
Volker Hilsheimer
9f9be33180 Fix compiler warning from deprecated overloads
Change-Id: Id141c08dfe825ae39c57ba09a784dfdfd280fd0a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-26 06:55:17 +02:00
Lu YaNing
2f5f276b4a CUPS: Add support for accessible IPP printers
CUPS 2.2 adds accessible IPP printers to the list of destinations
that can be used. The "printer-uri-supported" option will be
present for those IPP printers that have been recently used.
https://github.com/OpenPrinting/cups/blob/master/cups/dest.c#L1611

Pick-to: 5.15 6.2 6.3
Change-Id: I49b4d2f1ee6d96e9bcc04ed1cc2ed48d7a6e7563
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-26 01:15:49 +00:00
Thiago Macieira
d7d6f46324 Fix build with GCC12: avoid QCborStreamReader::preparse()
GCC 12 doesn't like that we're calling preparse() on the empty
QByteArray() (whose .data() == &QByteArray::_empty), despite the
condition being impossible.

Reported at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105348

In function ‘void* qt_cbor_decoder_read(void*, void*, size_t, size_t)’,
    inlined from ‘void* read_bytes_unchecked(const CborValue*, void*, size_t, size_t)’ at cborinternal_p.h:234:51,
    inlined from ‘uint32_t read_uint32(const CborValue*, size_t)’ at cborinternal_p.h:271:25,
    inlined from ‘uint64_t _cbor_value_decode_int64_internal(const CborValue*)’ at cborparser.c:333:23,
    inlined from ‘uint64_t _cbor_value_extract_int64_helper(const CborValue*)’ at cbor.h:372:50,
    inlined from ‘void QCborStreamReader::preparse()’ at qcborstreamreader.cpp:769:59,
    inlined from ‘QCborStreamReader::QCborStreamReader(const QByteArray&)’ at qcborstreamreader.cpp:825:13,
    inlined from ‘QCborStreamReader::QCborStreamReader()’ at qcborstreamreader.cpp:790:37,
    inlined from ‘QtPrivate::QMetaTypeForType<QCborStreamReader>::getDefaultCtr()::<lambda(const QtPrivate::QMetaTypeInterface*, void*)>’ at qmetatype.h:2302:65,
    inlined from ‘static constexpr void QtPrivate::QMetaTypeForType<QCborStreamReader>::getDefaultCtr()::<lambda(const QtPrivate::QMetaTypeInterface*, void*)>::_FUN(const QtPrivate::QMetaTypeInterface*, void*)’ at qmetatype.h:2302:20:
qcborstreamreader.cpp:706:18: error: array subscript ‘unsigned int[0]’ is partly outside array bounds of ‘const char [1]’ [-Werror=array-bounds]
qbytearray.h:92:23: note: object ‘QByteArray::_empty’ of size 1

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e8485d34e36100
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-04-25 16:54:01 -07:00
Thiago Macieira
54eae2d610 QTextEngine: don't pass empty data to bidiReorder
The algorithm in QTextEngine::bidiReorder() doesn't like an empty level
and visual order list. Found by GCC 12's slightly misleading warning:

qtextengine.cpp:3838:29: error: ‘levels’ may be used uninitialized [-Werror=maybe-uninitialized]
qtextengine.cpp:1174:6: note: by argument 2 of type ‘const quint8*’ {aka ‘const unsigned char*’} to ‘static void QTextEngine::bidiReorder(int, const quint8*, int*)’ declared here
qtextengine.cpp:3835:28: note: ‘levels’ declared here
 3835 |     QVarLengthArray<uchar> levels(nItems);
      |                            ^~~~~~

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e8490f131f160e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-25 16:54:01 -07:00
Thiago Macieira
e92e48bc79 XCB: fix GCC 12 warning about uninitialized variable use
GCC is right that symbolsGroup2 could remain uninitialized for some
conditions. So always initialize it.

qxcbkeyboard.cpp:284:48: error: ‘symbolsGroup2’ may be used uninitialized [-Werror=maybe-uninitialized]

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e84af7d7806b0d
Reviewed-by: Zhang Hao <543985125@qq.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-25 16:54:01 -07:00
Stefan Wastl
1fbd8c282e macOS: Use originating view as drag source when dragging multiple items
We're already tracking the last view along with the last event, so
use that instead of always assuming the drag started from the window's
content view.

Fixes: QTBUG-102584
Pick-to: 6.2 6.3
Change-Id: Ibe8506b0f91ecdfe6e7fe91e17c129b4d7552880
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: <stefan.wastl@native-instruments.de>
2022-04-26 00:24:40 +02:00
Edward Welbourne
0248838ee0 Correct leap year sequence in systemTimeYearMatching()
In the sequence for the early 32-bit time_t leap years, I somehow
managed to get two of the entries swapped. This amends
commit 1f4b237dad

Pick-to: 6.3
Change-Id: I5cb9080f8c6a24e2163508e640747c6fbbe93dbd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-25 19:18:49 +02:00
Edward Welbourne
383368a321 Support test-case selection based on global data tag
In the same ways as for blacklisting. In the process, move reporting
of an unrecognised tag outside the global-data loop, as the tag might
be, or start with, a global data tag; and also report the global data
alongside the test-specific data. Indent the lines reporting tags, as
this makes the structure of the lists more evident. Converted the tag
argument to QLatin1String() to facilitate searching and matching.

Updated documentation, including expanding on the option of specifying
the data tags on the command-line. Drive-by: fixed a link in the
documentation, removed a snippet that was nowhere used.

[ChangeLog][QtTest] When specifying what tests to run on a QtTest
command-line, it is now possible to include a global data tag in the
same way as a function-specific data tag or in combination with it.
Thus if the test reports itself as tst_Class::function(global:local),
command-line option function:global:local will select that specific
test and function:global will run all data-rows for the function on
the given global data tag.

Fixes: QTBUG-102269
Change-Id: I7c86d6026933b05f7994bfc3663a2ea6a47f5f38
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-25 17:47:21 +02:00
Morten Sørvig
36507ae617 wasm: don't show the resize cursor for fullscreen windows
The compositor should not show the resize cursor for fullscreen and
maximized windows, since windows in those states aren't resizable.

Pick-to: 6.3
Change-Id: I58762b7729a02f9a3c78edafe5d9d5b364fb552f
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-04-25 15:42:20 +02:00
Morten Sørvig
029f90f7ea wasm: initialize htmlCursorName to "default"
The canvas cursor should always be restored to "default" if no cursor
is set, otherwise we get the I-beam cursor since the canvas is
contenteditable.

The code which handles setting and restoring the override cursors
handles this correctly, however we also need to set the default
htmlCursorName for cases where setOverrideWasmCursor() is not called.

Pick-to: 6.3
Change-Id: I23be7847d3a30ab78e3a8c9ec402285246bfefec
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-04-25 15:42:20 +02:00
Alexandru Croitor
7616e4aecf CMake: Handle detection of linux-g++-32 mkspec
If Qt is configured with -platform linux-g++-32 , make sure
to add the -m32 compile options for all built targets.

On 64 bit host OSes that provide both 32 and 64 bit libraries
we need to exclude the 64 bit libraries from being picked up.
The locations of the libraries are distro-specific.

This change by default excludes the Ubuntu x86_64 libraries
paths.
Opt outs are provided, which when used, forces Qt builders to
specify their own ignore paths in a custom CMake toolchain file.

The compile option and default path exclusions are added to the
Qt-generated CMake toolchain file as well, so they are reused
when building other Qt repositories.

Note that there is no foolproof way to tell CMake to ignore all
x86_64 packages / libraries, even if CMake 3.23
CMAKE_IGNORE_PREFIX_PATH is used, because there might not be
a single sysroot to exclude.
Both x86 and x86_64 libraries can co-exist in the same sysroot,
e.g in /usr

One would have to list each package / library directory in
CMAKE_IGNORE_PATH manually.

Additionally, the PKG_CONFIG_LIBDIR environment variable is also set
to Ubuntu specific prefixes, to ensure that pkg_check_modules ->
pkg-config don't pickup x86_64 libraries.

Fixes: QTBUG-101963
Change-Id: Ib17c8d2cd0ba33b2cf748772245bcd558de9120c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-25 15:42:19 +02:00
Andreas Eliasson
998b21c25d Doc: Revise Qt SQL module landing page
Include new CMake and qmake snippets and reorganize some of the sections
structure.

Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I47cc9b24818c26740e49e6365bf881874942b79c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-04-25 13:42:19 +00:00
Andreas Eliasson
3989f56c6b Doc: Revise OpenGL module landing page
Add the new qdocinc cmake and qmake snippets and reorganize some of the
sections structure.

Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: Iafa31856500e458c14feeb92bee660f44a65ffa9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-04-25 13:42:19 +00:00
Andreas Eliasson
b57e023b3b Doc: Revise Qt dbus module landing page
Move some of the detailed information into its own overview page and
reorganize the contents structure. Also, escape the _ character.

Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I396877912bed66537e4a97ee3d109ff92e15d843
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-04-25 13:42:19 +00:00
Andrei Golubev
b365186860 Fix unused variables in qtbase
clang compiler recently got smarter and detects "pseudo used variable"
patterns where we declare a variable and only use it in self-increments,
self-decrements and other similar expressions

Errors:

qtbase/src/corelib/text/qlocale.cpp:3898:9: error: variable 'group_cnt' set but not used [-Werror,-Wunused-but-set-variable]
    int group_cnt = 0; // counts number of group chars
        ^

qtbase/src/corelib/text/qunicodetools.cpp:1372:21: error: variable 'uc' set but not used [-Werror,-Wunused-but-set-variable]
    const char16_t *uc = text + from;
                    ^
and more of the kind

Remove the ones that have no usage, mark others with [[maybe_unused]]

Pick-to: 6.3 6.2
Change-Id: Ib2d0722110e3da8c39e29ec78c0ec290d064c970
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-25 15:05:25 +02:00
Venugopal Shivashankar
242633430b Doc: Fix typo in the HTML tabs config
Pick-to: 6.2 6.3
Change-Id: I00fad2e1e686f977bd508109c1a6a5d064d7a3d6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-04-25 10:07:05 +02:00
André de la Rocha
53c8d0d40b Fix crash when calling QMainWindow::restoreState()
Restoring the state of a window with a dock widget could cause a crash
in a multiple display configuration if the scale or screen arrangement
in the system had changed after the state was saved. In this case, the
original top-left coordinate of the window could now lie outside of any
screens, which would result in a NULL QScreen pointer being dereferenced
inside QDockAreaLayout::constrainedRect().

Fixes: QTBUG-102718
Fixes: QTBUG-102541
Pick-to: 6.2 6.3
Change-Id: Ie5e3209b82a33a1dc4568611c1b2ee3a6d8830b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-24 23:14:11 +02:00
Tor Arne Vestbø
d42ad7b01e QFontDatabase: Clear font cache before emitting fontDatabaseChanged
Matches the ordering in QFontDatabasePrivate::invalidate() and ensures
that when the fontDatabaseChanged signal is processed by clients the
cache is ready to be filled again.

Change-Id: I9d09060284c6090ae2748147f6ee75b9f9b173c5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-23 16:00:13 +02:00
Yuhang Zhao
4ec9b0cd19 Windows QPA: fix the FullScreen standard key
If you try to use the QKeySequence::FullScreen
as a shortcut for your Qt applications, you'll find
it's not working. This is due to this key combination
is being skipped by Qt and it's being passed to Windows's
default handling procedure. This is wrong because
Windows doesn't provide any default action for this
shortcut so nothing will happen.

Change-Id: Id73b7275764fe63c119a6d673a665b0090944fef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-04-23 19:02:02 +08:00
Yuhang Zhao
fa1f3ad73a Windows QPA: Enhance theme change notify
DWM colorization color change should also be considered
as a theme change event.

Change-Id: I55562b9d43988aafc8a60a6264fe16dccbefff92
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-04-23 19:02:02 +08:00
Sona Kurazyan
fedba8eaab uic: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Change-Id: I0d3c232a9fa95aea854445922f100b89c6d6f5a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-04-23 09:47:03 +02:00
Thiago Macieira
3aef84d600 qhashfunctions.h: add std::hash specialization for QByteArrayView
[ChangeLog][QtCore][QByteArrayView] Added std::hash specialization.

Change-Id: If05aeeb7176e4f13af9afffd16e7f03dfa413a66
Reviewed-by: Rui Oliveira
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-04-22 17:34:15 -07:00
Thiago Macieira
507115ebbb QtOpenGL: Fix build with GCC 12: qt_imageForBrush is in QtGui
/usr/bin/ld: lib/libQt6OpenGL.t.so.6.4.0: protected symbol `_Z16qt_imageForBrushib' isn't defined

Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e845af9638337b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-04-22 14:20:06 -07:00
Sona Kurazyan
77b9ddfb53 Android: use Qt major version for detecting OpenGL and QtQuick libraries
Change-Id: Ia7651ad09d7aab70cf32fcd56f9fb75202ace768
Pick-to: 6.3 6.2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-22 20:43:50 +02:00
Volodymyr Zibarov
7febf0b30e QGraphicsScene: Fix popup position for QGraphicsProxyWidget
screenGeometry() for proxy widget was returning visible part of the
scene instead of screen geometry for enclosing first view

Pass button center position to screenGeometry() to get correct screen
for cases when graphics view occupies two screens

Fixes: QTBUG-98785
Pick-to: 6.2 6.3
Change-Id: Idaeb3c3faf739751c93624a06fa0fd3d65388236
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-22 21:11:12 +03:00
Dimitrios Apostolou
72793ef31d Generalize exclusion list
It seems there are some tests in the various Qt modules that skip
writing the XML testlog file. If there are good reasons for that (for
example test is a custom shellscript) then it should be added to the
DUMB_TESTS list.

Change-Id: Iffb00e1fda42bb8e7338a94c9320e45900db1bc1
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2022-04-22 15:39:03 +02:00
Dimitrios Apostolou
399dbba775 qt-testrunner: improve error logging
Do not print full stack traces when a controlled exception occurs,
instead print just the exception name and the message.

Change-Id: I5669862d2e98c550d88d1d11fb2bf49f197cfc17
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-22 15:38:59 +02:00
Axel Spoerl
42444a18b0 Clarify comment for QDockAreaLayout::sep
QDockAreaLayout::sep represents the visual margin between a dock widget
and its frame, i.e. a dock within the main window.
The comment 'separator extent' has been replaced by a clearer version.

Change-Id: Icfb3d549a5bcb00c5f1cf4558c5a1c4f995e31f0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-04-22 15:35:02 +02:00
Axel Spoerl
a5dec542fa Shrink dock areas if main window width/height is below 160px
Empty drop areas have a fixed size of 80 pixels in QDockAreaLayout.
If a main window is below 160 pixels wide or high, drop areas start to
overlap. If a main window's width or height is 80px or less, drop areas
fully overlap. Dock widgets can't be dropped in overlapping areas,
because the dock area becomes ambigous.
This patch decreases the width and height used to calculate the drop
area rectangle by the extent necessary to prevent docking.
QDockAreaLayout::sep (margin between a dock widget and its dock) is
used as the new minimum height and width.

Change-Id: I1db3282cfc7c602b59bb2f20ba616efe1719b0cb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-04-22 15:35:02 +02:00
Tor Arne Vestbø
656dde05e8 QFontDatabase: Allow partially populating the font database
We were using the count of the registered families as the way to
determine if the font database had been populated yet. As a result
we needed to invalidate the font database every time an application
font was added to an empty database, as once the application font
was added, the font database was no longer empty, and we would end
up failing to populate any of the system/platform fonts.

We now have a dedicated flag for tracking whether the font database
has been populated, and we track whether an application font has been
populated by looking at its properties list, avoiding a second round
of populating when the full initialization happens.

This also opens up the possibility of the platform font database
populating (lazily or fully) fonts up front, for example as part
of resolving theme fonts.

The Windows font database had to be taught to invalidate itself
at the right moment, instead of assuming doing so during populate
was okey.

Change-Id: I80c893df755d8d35fb8a84dd7a83c6756a8f24a2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-22 15:27:43 +02:00
Edward Welbourne
396190686c Exploit the new macro varargs form of Q_GLOBAL_STATIC
Convert various uses of Q_GLOBAL_STATIC_WITH_ARGS() to the less
verbose form the recent reworking makes possible.

Change-Id: I57820660b5d00d39bf54b5a08cb921ebaec57c7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-22 15:27:43 +02:00
Kai Köhne
48561178e2 zlib as static library
Do build zlib as static 3rdparty library. This makes it easier to
disable warnings.

Pick-to: 6.3
Change-Id: I1db331b671b64e68d81c56b0df337983c3bbe7fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-22 14:34:47 +02:00
Tor Arne Vestbø
e3941facca Send ThemeChange event to all windows when system theme changes
The QWSI event for theme change has an optional window parameter to
specify the window affected, but most platform react to global theme
changes, and end up passing nullptr into the event.

The reasonable thing to do in QGuiApplication in that case is send
a theme change event to every QWindow, so that they are all notified
about the situation.

This approach is what the Windows platform plugin was doing already,
but did so by iterating manually over the windows, resulting in multiple
calls to QGuiApplicationPrivate::handleThemeChanged -- one for each QWSI
event.

Change-Id: Ifb27b6c31231377c0df389a592cafd0075d3d8bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-22 14:34:47 +02:00
Alexandru Croitor
dc4bc1e575 CMake: Fix interleaved configure output
message(STATUS) prints output to a buffered stdout, whereas
message(NOTICE) or just message() print to unbuffered stderr.

We use a mix of message() calls when printing the configuration
summary, which caused interleaved output.

Because CMake offers no message(FLUSH), we work around the issue
by calling execute_process(COMMAND -E echo " ") which does
call std::cout << s << std::flush;

We seem to have to do it twice, before and after the
detailed configuration summary is printed.

Pick-to: 6.2 6.3
Change-Id: Ibc075551fc0547073f0696477e54d9b9c1edca97
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-22 14:34:47 +02:00
Alexandru Croitor
8a56b4ad9b CMake: Embed an empty qt_prfxpath if Qt is relocatable
When Qt is configured as relocatable,
 QT_CONFIGURE_PREFIX_PATH_STR -> qt_configure_prefix_path_str ->
 qt_prfxpath
is not used in relevant code paths.

Specifically qlibraryinfo.cpp getPrefix() uses getRelocatablePrefix()
instead of QT_CONFIGURE_PREFIX_PATH.

Thus, when Qt is configured as relocatable, set qt_prfxpath to an
empty string.
This avoids embedding a CI path like /home/qt/work/install into the
official packages, which makes reproducible builds a closer reality.

Change-Id: I9209b08e651ad0b7fdc4049df333e0978e05f1f5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-22 14:34:47 +02:00
Alexandru Croitor
251033fb0a CMake: Work around build rpath issue when CMAKE_STAGING_PREFIX is set
CMake has logic to rewrite build rpaths that contain
CMAKE_STAGING_PREFIX to instead point to CMAKE_INSTALL_PREFIX.

This breaks running executables from the build directory, because
their build rpath will point to a location where the libraries might
not exist yet (we didn't install Qt yet).

Work around this by setting CMAKE_STAGING_PREFIX to a fake path, so
that CMake does not do the rewriting anymore.

CMAKE_STAGING_PREFIX needs to be set at subdirectory scope, not
function scope, which is why
qt_internal_apply_staging_prefix_build_rpath_workaround() is a macro
that is called from within each Qt internal function that creates
a target.

The workaround can be disabled by configuring with
-DQT_NO_STAGING_PREFIX_BUILD_RPATH_WORKAROUND=ON

The downside of this workaround is that it breaks per-subdirectory
install rules like 'ninja src/gui/install'.
Regular global installation like 'ninja install' works fine.

This is similar to what we do for tests in
qt_set_up_fake_standalone_tests_install_prefix()
introduced by 20292250d4
The reason it's not as good for other target types is because in
contrast to tests, we do want to install them.

In case if someone does call `ninja src/gui/install' they will most
likely get a permission error, telling them it's not possible to
install into
/qt_fake_staging_prefix/
 check_qt_internal_apply_staging_prefix_build_rpath_workaround

Fixes: QTBUG-102592
Change-Id: I6ce78dde1924a8d830ef5c62808ff674c9639d65
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-22 14:34:47 +02:00
Laszlo Agocs
4f2b4e0e5e rhi: Add a feature flag for non-fill polygon modes
It's one thing that this is not part of OpenGL ES, but it is optional
even with Vulkan, with some mobile GPUs not offering the feature at all.

Change-Id: I4e2c6642eccb0793e69074b4b6eeb2b7cef3516e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-04-22 14:34:46 +02:00
Eskil Abrahamsen Blomfeldt
7fa2a1a479 Remove last traces of old Harfbuzz
In Qt 6, we removed the "old" Harfbuzz and Harfbuzz-NG became the
only option. But the QT_HARFBUZZ=old environment variable would
still be read and would disable certain parts of the code path.

This has caused some confusion when porting older applications,
where QT_HARFBUZZ=old was used to work around issues with the
earlier versions of Harfbuzz-NG. Setting it now causes text to
disappear completely.

To avoid this confusion, we remove traces of the QT_HARFBUZZ
environment variable as well.

[ChangeLog][Text] Fixed an issue where setting the legacy
environment variable QT_HARFBUZZ=old would cause text to
disappear from the application.

Fixes: QTBUG-102774
Change-Id: I0f07cdb2418202fc36b82e766ad9547c34477175
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2022-04-22 13:10:59 +02:00
Friedemann Kleint
6eb9439809 Adapt generated sources of uic to latest string changes
Use _s literals everywhere, removing all codepaths generating
QLatin1Strings for comparisons and other optimizations.
This is now possible since string literals are now longer duplicated.

Task-number: QTBUG-98434
Change-Id: Ie35199593dc13a36afd92e3a0dd8d58ec492e4b7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-04-22 08:09:24 +02:00