Commit Graph

51577 Commits

Author SHA1 Message Date
Li Xinwei
d104d510ea CMake: fix build with static Brotli
BrotliCommon is a dependency of BrotliDec and BrotliEnc.

amends 5d2da76c1e

Pick-to: 6.1
Change-Id: I7741d417e95737f8caacd01962985a27dbb7514c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-07 02:06:44 +08:00
Eskil Abrahamsen Blomfeldt
76d3cda884 macOS: Fix synthesized bold
When a user requested bold and there was no available font for
this (which is quite common with CJK fonts and in fact is the case
for the official Japanese font on the system), we should synthesize
the boldness.

This was done by checking if the requested font weight boldness
matched the one in the font's traits, and if not, we flag the
font boldness to be synthesized.

But when initializing the font, we would first override the requested
weight with the selected font's weight, *before* performing the check
above. So even if there was a mismatch, we would not catch this and
as a result, e.g. the system Japanese font would never be bold.

[ChangeLog][macOS] Fixed an issue where boldness would not be
correctly synthesized for families with no bold variant.

Fixes: QTBUG-85634
Pick-to: 5.15 6.1
Change-Id: I36da59d7689455e29cca283cb0724a0841095918
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-06 15:46:37 +02:00
Eskil Abrahamsen Blomfeldt
a1e405ce11 Windows: Work-around misreporting of Script and Roman
Two legacy bitmap fonts are misreported as TMPF_VECTOR on
Windows: Roman and Script. This causes them to be marked as
scalable, and the automatic fallback to NativeRendering in
Qt Quick does not kick in - causing the text elements to look
empty instead.

To work around this, we exploit the peculiarity that the type
of these two fonts is reported as "0" in the enumeration, which is
not a valid value. No other fonts on the system is reported as type
0, so we simply detect this error case and mark the fonts as
non-scalable, which is the safer choice.

[ChangeLog][Windows] Fixed text in "Roman" and "Script" bitmap
fonts not showing in Qt Quick applications.

Pick-to: 6.1 5.15
Fixes: QTBUG-85826
Change-Id: Id889f0dedb1d529e6dd64c6da9e17e303f4a9d04
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-06 13:19:44 +02:00
Friedemann Kleint
8886462872 QMdiArea: Fix top level window title when using DontMaximizeSubWindowOnActivation
When trying to find the original window title, check for another
maximized sub window and use its title. Protect the calls to
setWindowTitle to prevent the original title from being cleared.

Pick-to: 6.1 5.15
Fixes: QTBUG-92240
Change-Id: I55175382ab261b4cf8b5528304adaaec4fbe2c31
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-06 13:08:14 +02:00
Fabian Kosmale
f8c1d339ec tst_moc: Use qtpaths instead of qmake
We only need to the location of certain paths for the test. For that,
qtpaths is sufficient.

Change-Id: I5af0d56b548629edc48949150ed8fbd408b617a6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-05 23:43:45 +02:00
Kai Köhne
fb56cf449b doc: Mention qmake6 as name of qmake executable on Linux
Task-number: QTBUG-89170
Pick-to: 6.1
Change-Id: I16c86f04b4c34e7099c220cf028ba1cdb20550e9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-05-05 20:31:26 +02:00
Allan Sandfeld Jensen
50b9a4b357 Remove Qt6 switches from QtGui
Removing now dead code

Change-Id: I021539da6517fdb8443f8ae9431fc172b7910cfc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-05 19:26:56 +02:00
Bartlomiej Moskal
93038767b7 QWidgets: show SoftwareInputPanel for key release
Virtual keyboard should be shown when editable widget get focus by key
(like Tab or BackTab). Before this change SoftwareInputPanel was
handled only for mouseKeyRelease event

Task-number: QTBUG-61652
Pick-to: 5.15
Change-Id: I85f80422b596592a04c2f9af214f991c471485c8
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2021-05-05 16:07:17 +00:00
Topi Reinio
d831035435 Doc: Fix documentation warnings for QJni* classes
Pick-to: 6.1
Change-Id: Iab836fbdf649f1b3b60e88d32266361299ac4bb2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-05-05 16:07:17 +00:00
Eirik Aavitsland
127f617387 Update bundled libjpeg-turbo to version 2.1.0
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.0

Pick-to: 6.1 6.0 5.15 5.12
Change-Id: I82a58609120923c18f6031fec7d597138ec473ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 18:07:17 +02:00
Eirik Aavitsland
5df88b85c6 Simplify bundled libjpeg build
Move the config headers of the bundled libjpeg back into its source
directory, where they originally live, to avoid having to trick with
the include path to find them.
The goal is unification across maintained Qt branches, making version
updates simpler.

Pick-to: 6.1 6.0 5.15 5.12
Change-Id: I5b574446bbd264b0a1cb3efceb4c1cb7203cac7d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 18:07:17 +02:00
Paul Olav Tvete
e2bdff3555 Fix rare integer overflow in text shaping
With extreme painter scaling, linearAdvance may be too large to fit in
an unsigned short.

Fixes: QTBUG-91758
Pick-to: 6.1 5.15
Change-Id: I7bbe6e77ec9bcef4aa5259da1d3000ed1a8eb27a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-05-05 17:14:12 +02:00
Giuseppe D'Angelo
31defb8339 Edid parser: fix performance issues
A) When a QEdidParser gets built, the code populates a QMap by parsing
the system's pnp ids file. With > 2000 entries in the file, that's 2000+
allocations for the QMap, plus 4000+ allocations for key/value
(QStrings), plus a bunch of temporaries created for processing.

What's more, on XCB and EGLFS, a QEdidParser gets built *per screen*;
the map is not shared and gets rebuilt for each screen.

It's however completely unnecessary to keep this map in memory.  The
lookup is required only once per monitor change event, which, apart from
application startup, is an extremely rare event.

When such an event happens, and we have to lookup a vendor id, we can
just process the pnp database "on the fly", therefore removing the
constant memory usage from the application run.

In order to also avoid an allocation spike, just don't build a map at
all: simply process the file, using no memory allocations, one line at a
time while searching for the vendor id. I was unable to find
information about the file format, so I am not sure if it's guaranteed
that it's kept sorted by id (this could allow for a faster fail path).

B) In case of a cache miss, a hardcoded vendor table is used to try and
identify the manufacturer.

Look up in the hardcoded table using binary search, rather than a linear
scan, and don't allocate memory for each element processed in the list
(!). The size of the list (2000+) is big enough to completely justify
binary search.

C) Drive-by, remove a TOCTOU bug when opening the system file.

D) Drive-by, fix the includes in the header to IWYU.

Change-Id: I57c7cbd09a145c6efe3023c227ed36b24bed96f9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 17:14:12 +02:00
Andy Shaw
72a5151403 Write out the HTML correctly for nested lists
When we are having nested lists then we need to ensure that the HTML is
outputted correctly so that the closing list and item tags are placed
in the right order.

[ChangeLog][QtGui][QTextDocument] The output of toHtml() now handles
nested lists correctly.

Fixes: QTBUG-88374
Pick-to: 6.1 5.15
Change-Id: I88afba0f897aeef78d4835a3124097fe6fd4d55e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 15:14:12 +00:00
Oliver Eftevaag
38f4e1f3e7 Unit test for checking text-decoration in html export
This unit test is related to the parent commit.
Html export used to omit the text-decoration for the default font,
this unit test ensures that this property is added to the exported
html.

Fixes: QTBUG-91171
Change-Id: Ib68bec27f9963cdcac5c553b2c07557717b1c22e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 16:28:54 +02:00
Allan Sandfeld Jensen
720defd2ca Export text-decoration
It used to be ignored because we couldn't disable it, but that works
fine now. So re-enable it.

Fixes: QTBUG-91171
Change-Id: I4cf966211bb200b73326e90fc7e4c4d3d4090511
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-05-05 16:28:54 +02:00
Edward Welbourne
358df462a0 Fix assertion on matchingLocales(Abhkazian, Any, Any)
CLDR v39 has no locales for Abkhazian, so the locale_index[] entry for
it actually indexes the last entry before the next language up the
enum. This has m_language_id less than Abkhazian.

Change-Id: If8b88f30476a981b3ee00ff8760a46ede0b7aab7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-05 16:28:53 +02:00
Tamás Martinec
3b155973c4 iOS: Keep undo/redo widgets enabled on the undo shortcut bar after undo
Having two undo/redo operations on the rebuilt undo stack always enables
the undo/redo widgets on the shorcut bar. This might be more desirable than
the current behavior that only allows one undo from the shortcut bar.

Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-63393
Change-Id: I2c99f27895def47b58534035461ceb7b4e5c3057
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-05 16:28:28 +03:00
Assam Boudjelthia
45daea19c3 Fix set*Field JNI template calls
The calls were trying to pass a JNIEnv* from a QJniEnvironment using
conversion operator which was removed, and weren't detected since they
are templates and were missing tests. This fix that and add test cases
for setField() and setStaticField() calls.

Pick-to: 6.1
Change-Id: I6e1e6b7f557bbc664248ad364c48d63f58b70756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-05 16:28:27 +03:00
Assam Boudjelthia
afd7460aff Add new app permissions API under QCoreApplication
The API allows users to request and check the status of various
permissions. A predefined enum class of the common permission types
on different platforms is used to allow requesting permission with
a common code. Platform specific permissions are defined only on their
relevant platform. For permissions that are not predefined, they can
be requested via a string variant of this API.

This adds the Android implementation only.

[ChangeLog][QtCore] Add new API for handling app permissions with an
initial implementation for Android.

Task-number: QTBUG-90498
Change-Id: I3bc98c6ab2dceeea3ee8edec20a332ed8f56ad4f
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-05 16:28:27 +03:00
Simo Fält
3969ef40cc Add instructions for Windows 10 on Arm config
Task-number: QTQAINFRA-3966
Change-Id: Ib8ac80a5b8aa5c88d9e5d0eaad9ba550cc2442f8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fathi Boudra
2021-05-05 16:28:27 +03:00
Joerg Bornemann
3886db82c6 Add -write-options-for-conan configure argument
Passing this configure argument will generate a JSON file that contains
information about configure options and features.

This file is used by Qt's conan recipes.

Fixes: QTBUG-92082
Change-Id: I2057ec8cbdb0a1ea198d7eeacb45f65bfa862d8a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-05 16:28:27 +03:00
Bartlomiej Moskal
e5686b35f0 Android: handle ImEnterKeyType flag
Replace KEYCODE_ENTER to KEYCODE_TAB if IME_ACTION_NEXT or
IME_ACTION_PREVIOUS flag is set.

Before this change any of imKeyEntryType [1] was handled as default
return key. After the fix, event is changed to Tab or Backtab (if any of
mentioned flag is set)

[1] https://doc.qt.io/qt-5/qt.html#EnterKeyType-enum

Fixes: QTBUG-61652
Pick-to: 5.15
Change-Id: Ia27aa308fdae75bc17d1e892d17048c5afa3e2cb
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-05 07:43:10 +00:00
Joerg Bornemann
33ac3cf766 Fix Windows build with CMake < 3.19
file(REAL_PATH) was introduced in CMake 3.19.

Use get_file_name_component(... REALPATH) instead that is available in
older CMake versions.

This amends commit b226e99c71.

Pick-to: 6.1
Change-Id: Ibb28ef757228e1a1176ff70c3ec57b7ca751a636
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-05 09:41:18 +02:00
Liang Qi
9f8d5bceb4 cocoa: move DEBUG_PASTEBOARD into logging category
Pick-to: 5.15 6.1
Change-Id: I8f49c030588122adff3c0eab4189bfa7e6aeff09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-05 09:34:11 +02:00
Ivan Solovev
8161a9e5c0 QAbstractProxyModel: port to new property system
The biggest trick here is the getter (QAbstractProxyModel::sourceModel),
which is returning nullptr, while internally using a global
staticEmptyModel() instance.
This lead to inconsistency while binding to a proxy model without
source model. The bound object would point to staticEmptyModel()
instance, while sourceModel() getter returns nullptr.
To solve this issue a custom QBindableInterface is implemented.

Task-number: QTBUG-85520
Change-Id: I597df891c7e425d51b55f50ccbacabdfe935cbac
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-05-04 22:58:59 +02:00
Tor Arne Vestbø
0fb77f80b8 Blacklist and skip failing tests on macOS ARM
Task-number: QTQAINFRA-4431
Change-Id: I4ae47bb461634d524995077501b54322f6beccf3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-04 22:58:59 +02:00
Timur Pocheptsov
3ab7449f12 Fix changes' doc
The name of attribute has a suffix 'Attribute' which was missing.

Pick-to: 6.1
Fixes: QTBUG-93416
Change-Id: I9ce96efb38caa03957ddbdb13a5e61767e8e74f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-04 22:11:24 +02:00
Tor Arne Vestbø
f9f64cd344 Tweak naming of QT_OVERLOADED_MACRO variants
Add a _ suffix before the number of arguments, to improve readability
of the argument-specific functions.

Change-Id: I1dfc4f381450825dd143ece524bb10e117c09971
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 22:11:24 +02:00
Giuseppe D'Angelo
3a7d0e516b QPrintEngineMac: code tidies
In preparation for a change (operator&(enum, flags) producing a
QFlags, not an int), just go through operator&(flags, flags).
This removes the need for a cast to the _enum_ type (although it
requires a enum->flag conversion, which however makes perfect sense.)

Change-Id: I159ee14d894c10365f53ca378bcb18bcf3f89dff
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-04 16:21:50 +02:00
Mårten Nordheim
48931167fb tst_moc: fix returning-reference-to-local warning
Although the code is never executed compilers still throw a warning
because it's compiled.

Amends 12b8283f89

Pick-to: 5.15 6.1
Change-Id: Ib790d4bcb33c4b9f2a55a784b852275b59debde9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 16:21:50 +02:00
Morten Johan Sørvig
07516c0811 Test at some Android DPIs in addition
Currently, we test at 1x, 2x, and mixed typical desktop
DPI values. Add android DPI values, with scale factors
in the 2.5 - 3.75 range.

This test currently uses 96 as the base DPI (and so
does the Android platform plugin), so we normalize
the values to use that base DPI.

Change-Id: I25b66f5e16d37c01758d5623b805e4141247a74a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-04 16:21:48 +02:00
Morten Johan Sørvig
5882131592 Remove setting of Qt 5 high-dpi attributes
This test is for Qt 6 now.

Change-Id: I839c2733d505cb4119b1fe3ad85d3c8d94a6c964
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-04 16:21:48 +02:00
Edward Welbourne
517745fc9d Ensure setDateTime clears status also when short
Previously, if multiplication overflowed when trying to set the date
and time of a formerly short-form QDateTime, its status didn't get set
to reflect the failed validity check. Added a test that now correctly
detects that it's produced an invalid date-time on overflow, where
previously it produced a wrong valid date-time.

Change-Id: Id46ca34d1e32e9b9b0630f3723cefd1c13b5761e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-04 15:21:48 +01:00
Volker Hilsheimer
5e89c1406e Delete less-than operator for QKeyCombination
QMetaType relies on QTypeTraits to identify whether a type provides
operator<. Due to the the deprecated implicit conversion to int, this
results in several screens of deprecation warnings when using
QKeyCombination in a signal parameter or as a property type.

QKeyCombination has no ordering semantics (is Alt+F5 larger than
Control+Up?), so delete the operator.

[ChangeLog][QtCore][QKeyCombination] Potentially source-incompatible change:
the less-than operator for QKeyCombination has been deleted. Code relying
on the deprecated implicit conversion to int will no longer compile.
Use QKeyCombination::toCombined explicitly.

Change-Id: Ic8522b88d68063f74b5a5582c51aee8e18982331
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 11:52:38 +00:00
Fabian Kosmale
1e0be201c3 QUntypedBindable: Allow controlled access to internals
In declarative, we need direct access to the bindable's pointers. Enable
this via a internal only helper struct in qproperty_p.h.

Change-Id: I56e4622f570ff08f85f1161af608658ea510671e
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-04 07:57:46 +02:00
Mårten Nordheim
12b8283f89 Moc: parse trailing return type
Pick-to: 5.15 6.1
Fixes: QTBUG-71123
Change-Id: I1c3749f0892fddcc433c9afcb1d6d7c30c97c9d9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 01:39:48 +02:00
Morten Sørvig
e3e070e87b iOS: Implement QIOSScreen::logicalBaseDpi()
logicalDpi() and logicalBaseDpi() should return the
same DPI on iOS, in order to make Qt not apply a scale
factor.

Accomplish this by overriding logicalBaseDpi() instead
of logicalDpi(). The default QPlatformScreen::logicalDpi()
implementation will then call logicalBaseDpi().

Pick-to: 6.1
Fixes: QTBUG-92579
Change-Id: I7a27cf61f0154cef32098069ab3dfb29ad6acf27
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-03 21:49:05 +00:00
Thiago Macieira
f95d6bb09d tst_QProcess: increase wait time and remove ill-advised QCOMPARE
The QCOMPARE made dead code of a more verbose QVERIFY2 below

Change-Id: I26b8286f61534f88b649fffd166b67d8603280a7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-05-03 20:43:01 +00:00
Fabian Kosmale
ba561efa9d Add QUntypedBindable::metaType function
This enables checking the metaType of a QUntypedBindable in the public
interface.
In addition, work around an oversight that can only be fully addressed
in Qt 7: The metatype function pointer does not take a
QUntypedPropertyData * parameter. However, we need this functionality
for an efficient QBindable proxy implementation in declarative (which is
needed to implement interceptors there). To work-aronud this in Qt 6,
reuse the value getter and turn it into a metatype getter if the value
pointer is flagged.

Change-Id: Ia3cce08ea761fce57bce59e02212525b996f2fee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-03 20:32:42 +02:00
Fabian Kosmale
98b4f4bc4d Q(Untyped)Bindable: Print warnings when operations fail
Instead of silently failing, we now print an explanatory warning to aid
with debugging.

Task-number: QTBUG-89512
Change-Id: I36dd2ce452af12d0523c19286919095e366bd390
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-03 20:32:42 +02:00
Ivan Solovev
d225c6afe7 QJniObject: add callStatic[Object]Method overloads for jmethodID
This patch extends the QJniObject::callStatic[Object]Method functions
with the overload which accepts a jmethodID parameter. This can be
convenient when the method id is already cached and you do not want
to query the method by its name and signature.

Task-number: QTBUG-92952
Change-Id: Ib0852a5a27da2a244ac63112784751ef9e32cfa5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-03 18:09:23 +02:00
Ivan Solovev
34f72ca52e QJniEnvironment: extend API
This patch adds some convenience methods to QJniEnvironment API:
* an overload of registerNativeMethods() that accepts jclass instead
  of const char *className.
* a findMethod() function is added to query a methodID of a static
  or nonstatic method by its name and signature.

Task-number: QTBUG-92952
Change-Id: Ib1bc892decea97e625c4822888b6183af6edd6dc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-03 18:09:23 +02:00
Friedemann Kleint
96d9cf8de4 uic: Fix font family code generation for python
Amend the code introduced by d8602ce58b
to generator correct code for Python.

Change-Id: I71fc9a1830d6bd591d32ce08002572c29f02a27f
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit b2ebc64dd9914359fe8acf2bc9960e341e98cf80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-03 16:09:23 +00:00
Laszlo Agocs
c28e609ff4 rhi: gl: Sanity check vertex outputs and fragment inputs
Print a warning if the name for a given location does not match. This is
relevant only to OpenGL and only to < 330 GLSL versions: there the
location qualifier is simply not present in the actual shader code and
all matching is name-based. This leads to hard to discover problems in
Qt Quick ShaderEffects for instance, where providing a custom fragment
shader but using a built-in vertex shader is common, and one may be
tempted to use a name other than qt_TexCoord0 for the input variable in
the fragment shader. Unfortunately this breaks, sometimes silently, when
not having location qualifiers. (and we won't, neither in GLSL 120 or
150 which are the standard for Qt Quick)

Make this situation recognizable by printing a warning to the debug
output.

Pick-to: 6.1
Task-number: QTBUG-92500
Task-number: QTBUG-93370
Change-Id: I0d0bcc135e23a228783f7633f872e39c4e43bb93
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2021-05-03 16:10:36 +02:00
Friedemann Kleint
21b3b54193 QSqlTableModel::orderByClause(): Quote the table name
This ensures correct handling of names with special characters.

Pick-to: 5.15 6.1
Fixes: QTBUG-92584
Change-Id: I95c7c54d9c7ee00b221a55f3d07ef1ec3a3bd217
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-03 14:10:36 +00:00
Volker Hilsheimer
18f5b83e97 Document that a toplevel window QSizeGrip doesn't get rendered on macOS
Amends b8947e9194 which removed the grip's
rendering unless they are in a QMdiSubwindow. This was a deliberate
choice to comply with the macOS HIG. Rather than putting in another
widget attribute, document that another style can be used.

Fixes: QTBUG-90945
Pick-to: 6.1
Change-Id: Id227fd31d8bafaaab7005e5ff5340da96c0f65b3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-03 15:04:47 +02:00
Kai Köhne
16a1ba69a6 Disable spurious MSVC warning C4273 in Qt Gui, Qt OpenGL
For optimized/release builds, cl 19.28 produces some false positive
"potential divide by 0" warnings even for code where no valid code path
can lead to such a division.

Fixes: QTBUG-92940
Pick-to: 6.1
Change-Id: I461f9104d7b9dc2d74839bf30bebb2b9d4cf2db3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-05-03 13:04:47 +00:00
Morten Johan Sørvig
b5ceba0128 Extend QT_SCREEN_SCALE_FACTORS test
Test the name=factor format and various incorrect spec
strings. We expect that the screen DPI is used if the
scale factor specification is incorrect.

Change-Id: Ia990e70cf71e370dd2bb4b1047a101dfe9e59cb0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-03 13:33:43 +02:00
Morten Johan Sørvig
51e2a64ed9 Parse QT_SCREEN_SCALE_FACTORS spec only once
Move parsing to initHighDpiScaling() and store the parsed
factors in a vector. The factors are later applied in
updateHighDpiScaling() where the factor list is compared
to the screen list.

Change-Id: I59fc67b84932dbe69868a3683686a91e51333104
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-03 13:33:43 +02:00