Commit Graph

34925 Commits

Author SHA1 Message Date
Edward Welbourne
34a095848d Inline QString's conversions to integral types, except long long ones
As requested by a ### Qt6 comment.

Task-number: QTBUG-85700
Change-Id: I7c2813c0d8fbc38bcd2f7229de3a9d8e1b8b1f03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:29:18 +02:00
Edward Welbourne
0d11a92af9 QLatin1String: finish up the qsizetype conversion
Correct one QString::lastIndexOf() whose return and parameter had been
changed, but body and comment hadn't.

Task-number: QTBUG-85700
Change-Id: Icbcd049f72346f0e696e6b22fe0893f6de5a2646
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:29:06 +02:00
Edward Welbourne
69014b6cd6 Use qsizetype for the size of QByteArray's raw data methods
A ### comment said to use int in setRawData(), which took a uint; but
the underlying QArrayDataPointer::fromRawData() takes a qsizetype, so
propagate that all the way.

Change-Id: Iba1f8d020c509b33f5c202c22c6a9bf85b3bab7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:28:47 +02:00
Edward Welbourne
e7db401b48 Use char32_t for QLocaleData::zeroUcs() and friends
Also catch some stray ushort that should be char16_t by now, use
unicode character values for some constants and rename a UCS2 variable
to not claim it's UCS4.

Change-Id: I374b791947f5c965eaa22ad5b16060b475081c9d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:27:40 +02:00
Edward Welbourne
2d6705575c Don't second-guess strcoll()
It's defective on Android, but no worse so than the fall-back we were
using; and we can't remember why we had that fall-back anyway.

Task-number: QTBUG-63518
Change-Id: I28e9b5c7cc64963c9e3941eb1bad85aced280a9b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-28 21:27:24 +02:00
Edward Welbourne
2d5dcd1b9f Include qhash.h in header instantiating QHash
Include what you use. In this case, the include needs to happen before
qpa/qplatformmenu.h, since that seems to pull in
src/gui/kernel/qwindowdefs.h, which confuses matters (somehow) with a
forward declaration.

Change-Id: Ic09ecb014563e8ebee86f338c7e98e470f82185b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:27:06 +02:00
Edward Welbourne
86ebe46f59 Make QTranslator::load() insist that its return value be checked
Add Q_REQUIRED_RESULT to force callers to check the return; the
QTranslator object is unusable if load() fails.
Check the result in QTranslator's own test.

Task-number: QTBUG-85700
Change-Id: I07509c76470cc87626190670665cd3162bfb17e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-28 21:26:21 +02:00
Edward Welbourne
a144820ae7 QLine: swap IntersectType and IntersectionType
Make IntersectionType the enum and the obsolete IntersectType an
alias, with at least a comment to say it's deprecated.
Adjust the docs to match.

Task-number: QTBUG-85700
Change-Id: I0de9166b0d936f5b9a15fdd4f90cf7b01198e8d7
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-28 21:23:20 +02:00
Edward Welbourne
26547c296b Purge qalgorithm.h of deprecated API
A large slice of it has been deprecated since 5.2.

Reflowed a doc paragraph pointed out, in the deprecation commit, as
having been left ragged by its edits.

Note: qSwap() is documented as \deprecated but not marked, where it's
defined, as deprecated.

Change-Id: Iaff10ac0c4c38e5b85f10eca4eedeab861f09959
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:22:32 +02:00
Edward Welbourne
17ba201a3f QAnimationDriver: remove deprecated startTime(), setStartTime()
Deprecated since 5.13

Change-Id: Ie833647e4bd87698a882352f89b4727790ffeeaa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-28 21:22:10 +02:00
Edward Welbourne
ae9a16b5cd Remove deprecated QDataStream::unsetDevice()
Deprecated since 5.13.

Change-Id: I9f8f58fb92bc12d32eab5b0ae8611611fe2481e5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-28 21:21:40 +02:00
Edward Welbourne
3f0c2ed9ac Qt namespace: purge deprecated enum members and a typedef
Since 5.0 - WFlags
Since 5.6 - ItemIsTristate
Since 5.14 - WA_NoBackground, WA_MacNoClickThrough,
WA_MacBrushedMetal, WA_MacMetalStyle, WA_MSWindowsUseDirect3D
WA_MacFrameworkScaled, ImMicroFocus
Since 5.15 - MatchRegExp, MidButton (really since 5.7.0),
WA_ContentsPropagated (really since 4.5.1, as are the following),
WA_WState_DND, WA_ForceAcceptDrops.

Change-Id: Ib1db3d85bf28823c704b5f3857546764b158e1ed
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-08-28 21:21:25 +02:00
Edward Welbourne
072fb7de51 Remove QTimeLine's curveShape
Deprecated in 5.15.1, removed in Qt 6. It is entirely redundant with
easingCurve, which has been there since 4.6.

Task-number: QTBUG-85520
Change-Id: Ib1daa322a17da390dd264ed8d48ac572138a5d84
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-08-28 21:21:09 +02:00
Cristian Adam
039c2f7a4b CMake: Support add_executable for Android
With the ANDROID_GUI target property set on add_executable targets,
CMake will generate a lib<target>.so file, which is what Qt requires
from a target.

By setting CMAKE_RUNTIME_OUTPUT_DIRECTORY with the same value as
CMAKE_LIBRARY_OUTPUT_DIRECTORY the ANDROID_GUI case will work as
expected in Android multi-abi case.

Instead of the following CMake code:

if (ANDROID)
    add_library(test-android SHARED
      main.cpp
      qml.qrc
    )
else()
    add_executable(test-android
      main.cpp
      qml.qrc
    )
endif()

you can have:

set(CMAKE_ANDROID_GUI ON)
add_executable(test-android
    main.cpp
    qml.qrc
)

Change-Id: I3995d6ff731d0525ca86f7260fe61d9ecb7b01ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-08-28 20:37:25 +02:00
Mike Achtelik
6e7b750791 Use ApplicationInfo to get metaData
Since the load*Libraries functions might also be invoked when using an android service,
where no activity is present, we can't rely on the activity to get the metaData.

Pick-to: 5.15
Change-Id: I493c68591dbcfbe3063971cfd9ab384df71d03d7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-08-28 20:37:22 +02:00
Joerg Bornemann
8dbb70f44d Remove fxc configure test
This was used for ANGLE, which was removed in 752497910b.

Change-Id: I29bad031b296fddc425145cd206a372baf650267
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-08-28 20:09:31 +02:00
Tor Arne Vestbø
dce106c77c High-DPI: Remove usage of Qt::AA_EnableHighDpiScaling
This attribute is now on by default.

Change-Id: I7c9d2e3445d204d3450758673048d514bc9c850c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-28 20:08:43 +02:00
Tor Arne Vestbø
891fc4b42b macOS: Remove documentation for removed function
Change-Id: Ibf983006bdea47cf49e63665c3eb7e296dff3ac5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-28 20:08:41 +02:00
Laszlo Agocs
7819574c4c rhi: d3d: Allow compiling source shaders with debug at run time
Relevant for Qt Quick 3D. As in many cases Quick3D will rely on runtime
generated shader code, the translated HLSL will be compiled via
D3DCompile() at run time. To make such shaders debuggable, the necessary
flag (D3DCOMPILE_DEBUG) should be requestable somehow.

Change-Id: I4d5c3b57bf58df8d46556eebb5cf6fb75e9d0afe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-28 15:24:50 +02:00
Robert Loehning
e0da5159dc Avoid overflows in variantHash()
Fixes: oss-fuzz-24702
Pick-to: 5.12 5.15
Change-Id: I876bac9e2c276693e59802dfeeea2229a873ee34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 15:20:17 +02:00
Robert Loehning
0bd770fb87 QTextHtmlParserNode: Avoid extreme values for font's pixelsize
They currently cause an integer-overflow in variantHash().

Fixes: oss-fuzz-24702
Pick-to: 5.12 5.15
Change-Id: Ibee4413ca766c8ade9aeff2f2052b82cb9f7d213
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 13:19:56 +00:00
Ulf Hermann
8dc38d3525 qmetatype.h: Rename ValueTypeIsMetaType to SequentialValueTypeIsMetaType
It is only used for sequential containers.

Change-Id: Id6e01e03d36222605c56b6db935fcf78815d383f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-28 14:45:01 +02:00
Andrei Golubev
90a053d203 Properly fix issue in qtablewidget.cpp
The original fix done in 4b2f5371d9
actually introduced another subtle issue which should in theory cause
additional overhead. Fixed the behavior to be in fact compatible to the
old one

Task-number: QTBUG-84320
Change-Id: I22b130076f9eedbcf7c5eeae78362adfd0eee9af
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-28 14:44:09 +02:00
Tor Arne Vestbø
92a32e050f Remove QMacNativeWidget and QMacCocoaViewContainer
The functionality should be available via QWidget::winId(),
and QWidget::createWindowContainer() + QWindow::fromWinId().

Any bugs in this area should be fixed by improving the general
wrapping APIs.

Fixes: QTBUG-83254
Change-Id: I86584a4a8138d17d65a50da39efd58039f10da91
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-08-28 14:16:52 +02:00
Maurice Kalinowski
8b1b6d04da Fix warning
Missing override

Change-Id: Ic714110686338c4cfdbe583dba22c5a2f7c8ce1c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-28 13:20:16 +02:00
Morten Johan Sørvig
89e1289b2a High-DPI: Don’t round scale factors in Qt 6
Set HighDpiScaleFactorRoundingPolicy to PassThough
by default. This makes Qt track the system UI setting
accurately, and is overall the least confusing option.

Historically, Qt has rounded the scale factor (for example,
Windows 175% -> DPR 2) due to faulty handling of fractional
scale factors in Qt Widgets and with the native Windows
style.

Other areas of Qt such as Qt Quick have had few issues
with fractional scale factors and support this well.

Qt has never rounded the scale factor on the Android
platform.

Support for fractional scale factors in Qt Widgets and
the windows style has improved, which makes changing
the default for Qt 6 viable.

Task-number: QTBUG-83068
Change-Id: I38b60f621f95be8ebb6cb84a07d3370fec19ab92
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-28 13:00:17 +02:00
Morten Johan Sørvig
080a8285eb High-DPI: Enable scaling by default in Qt 6
Enable high-DPI support for all platforms which use
QHighDpiScaling. This changes the default behavior
of Qt applications on X11, Windows, and Android.

Qt::AA_EnableHighDpiScaling is now effectively on by
default, and Qt 6 applications do not have to set
this application attribute. Opting out is possible by
setting the Qt::AA_DisableHighDpiScaling attribute.

Task-number: QTBUG-83068
Change-Id: Ia2bd3e6f490130afcacd3a951bc50dbb40a79d7f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-28 13:00:08 +02:00
Paul Wicking
da9a57a1e6 Doc: Compile text snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: Ib39bb66a724542dcac4ca70072628b9bfcaf200d
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:38:17 +02:00
Paul Wicking
ea85f77a07 Doc: Compile QOpenGLShader snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: Id5a3d0fe540e94ce0e44062efeacff5f317bc886
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:33:43 +02:00
Paul Wicking
4853cff109 Doc: Compile painting snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: I223cb257539d2ac4cb0a1ea209f0c3cebddb3d54
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:32:22 +02:00
Paul Wicking
176e7d4d8c Doc: Remove unused snippet file
These snippets aren't used anywhere.
Remove the file.

Change-Id: Ie9fc9d73a20757d51c24e2e4fca8581f44d2e9d2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:26:03 +02:00
Paul Wicking
ef5b4a9891 Doc: Compile OpenGL snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: I022ac0382ae1068a75246964c37532e7e15417b0
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:25:34 +02:00
Allan Sandfeld Jensen
ea70c3c9f9 Add rgb64 inplace generic conversion
Can avoid having direct conversions between all high precision formats.

Change-Id: I36dd223d028cfda1b6f4116b38ca79cdb7bc5243
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-08-28 12:18:03 +02:00
Paul Wicking
28f31002c4 Doc: Compile QQuaternion snippets
Change-Id: Ica53a7307c3e77abeffa616db15c8e8ec39fce8f
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:16:20 +02:00
Paul Wicking
ed3f50507a Doc: Compile GUI kernel snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: I103a81a1a5acbfa1ece083a467d23a8544cf647a
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:08:23 +02:00
Paul Wicking
3dda54c02d Doc: drop obsolete snippet
QApplication::setColorSpec is obsolete. Drop the unused snippet
to avoid clutter when compiling snippet file (multiple main
entry points, etc.)

Change-Id: I5e34cc69aa6f1ccae248f625caa1528e70cb836e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:07:03 +02:00
Paul Wicking
4845a0de2e Doc: Compile standard item model snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I46301d37112bddcd38dbff9940d0c22eaae74208
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:06:11 +02:00
Paul Wicking
ebabbd0264 Doc: Compile image snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.
Update documentation to use same snippet to avoid duplication of
snippets across snippet files. Remove offending snippet.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: Ia45549d50e8f4e22ce72667a19c38132306d38b3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:05:49 +02:00
Paul Wicking
186eb6d50f Doc: Compile coordinate system snippets
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Change-Id: I8b765c2d2889cae91543c865f3b9df845ef6205b
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:01:01 +02:00
Paul Wicking
f0fb5eac85 Doc: Compile more GUI snippets
Compile snippets from snippets/code.
Fix minor issues (e.g. whitespace, missing semi-colon) in passing.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: Ifbdd5c3152e84c608a6562f4061075b61331a5d6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 12:00:07 +02:00
Paul Wicking
6454d227fa Doc: Remove unused snippet
The snippet isn't used anywhere. Remove it.

Change-Id: I56fdadaeb115e4e865476cf2b40e355f753dddf7
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 11:59:17 +02:00
Paul Wicking
2c7d57259c Doc: Remove unused snippet
Change-Id: Ie7a904fac93ea991820795852cd4dcf175bffe21
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 11:59:06 +02:00
Paul Wicking
ab6a007a4c Doc: Compile rich text code snippets
Extend GUI snippet compilation by adding rich text snippets
from /code sub-directory.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I4f3c978cc1c9042767fda9e33719042e18fd4bee
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 11:58:45 +02:00
Paul Wicking
8ff63383e4 Doc: Compile textdocument-end snippets
* Extend GUI snippet compilation with textdocument-end snippet.
* Rename the snippet file and replace main() with wrapper().
* Dedent the snippet itself.
* Update documentation that includes the snippet.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: Id5e5b284587da1e7fdfd00baa9c899626832a113
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 11:58:25 +02:00
Paul Wicking
2870c201dc Doc: Compile qfontdatabase snippets
* Extend GUI snippets by adding the qfontdatabase project.
* Rename the snippet file and replace main() with wrapper().
* Minor adjustments of the snippet itself.
* Update documentation that includes the snippet.

Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: Id23aff01a4c919c5264f7059971cb63398c2298c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 11:58:17 +02:00
Paul Wicking
b5a0baa061 Doc: Add skeleton project for GUI snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Change-Id: I4bd1f2f56561298573ae57adb149d77e374d8449
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-08-28 11:58:10 +02:00
Assam Boudjelthia
09ac1bdfc5 Android: enable androiddeployqt to get the host's rcc binary path
Since Qt 6 CMake installs the host and target into separate directories,
androiddeployqt fails to get the correct path to rcc. This change
includes the host's rcc binary path in deployment-settings.json.

Task-number: QTBUG-85399
Change-Id: I610bb6fea1180a119e4c0ceb75bf78c175ae430e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-28 12:44:14 +03:00
Topi Reinio
239982901b Doc: Fix documentation warnings for Qt GUI
* Drop deprecation warnings for now-dropped items
* Use the 'qt6' define and a new \nothing doc macro to conditionally
  document items on Qt 6
* Add a custom module header for docs that pulls in also Vulkan headers
* Add \internal command for internal classes/functions
* Move QtGUI-related code snippets from widgets to gui docs

Change-Id: Ieb386b96631a49568d09059906d307c45c01d93a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-28 11:37:35 +02:00
Assam Boudjelthia
00a1e5da7e Android: add option to get app arguments with AndroidManifest.xml
AndroidManifest.xml file and the Android plugin already has a way
to provide commandline-arguments to app with the tag
"android.app.arguments". This change allow to set it from qmake/cmake
and allow Qt Creator to use that.

Task-number: QTCREATORBUG-23712
Change-Id: I3e680f40fd36ba6aaac7f344fb9509d2c3360e74
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-08-28 10:23:18 +03:00
Mårten Nordheim
949254d5e4 qnetconmon: Downgrade Warning to Debug
It triggers when connecting to localhost (or when using socks proxy) and
is nothing you can act on most of the time, so change it to qCDebug.

Change-Id: I669fbde4fa0ed194703ea6a4dab13790aa771852
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-08-28 08:53:38 +02:00
Jonas Karlsson
174154bcac Remove "internal" parameter in QTextLine::draw()
The method is split up into a private and public version, where the
parameter is moved into the private method.

Fixes: QTBUG-84210
Change-Id: I79e9e02c9b4cc25d31db066e5a9567fdb9bc9fd0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2020-08-28 07:27:27 +02:00
Jonas Karlsson
3558704ed5 Use OpenType font weights
Task-number: QTBUG-42248
Change-Id: Icdb301b27d6699c2b842c4563fbef9df73c23cbc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-08-28 07:26:54 +02:00
Chen Bin
eb98bed4e7 Linux: Fix QLabel content truncated under high dpi
Fixed truncation of pixmap content under high device pixel ratio of
QLabel.

Pick-to: 5.15
Fixes: QTBUG-86170
Change-Id: I795815e0d8a9e57e0dfcca9cf104e86e45027b18
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-08-28 01:08:18 +00:00
Marcel Krems
257285553f Use qsizetype in QRegularExpression
PCRE2 already uses size_t which we can now make full use of.

Change-Id: Icb5efd5c6ef27f2e31a9780bf62f5671ddc603cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 02:22:10 +02:00
Fabian Kosmale
4d5a048d96 Improve connect: Use existing metatypes if possible
As there is now a chance that a QMetaMethod already contains the
metatypes for its arguments, we can just query it directly (and use the
fallback to name lookup logic that already exists there).
This also allows us to avoid creating a QList of names, and only
requires us to do a name lookup in case the connection actually fails.

Change-Id: Idda30bc4b538a94476ae6c533776c22340f0030d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 00:41:00 +02:00
Morten Johan Sørvig
462b36c3de QIconEngine: move away from virtual_hook usage
Upgrade existing functions to be virtual functions:
  - virtual QString iconName()
  - virtual bool isNull()
  - virtual QPixmap scaledPixmap(...)
  - virtual QList<QSize> availableSizes(...)

Make all of them non-const and remove the const_casts in
the implementation. Keep the default implementation
which calls virtual_hook(), for compatibility.

Note: availableSizes was already virtual, but now loses
the “const”. Port two overrides in the platform themes.

Keep virutal_hook() around for future expansion.

Task-number: QTBUG-85885
Change-Id: I76d0c9f75bfd6ca870c669047d4ef18b82c692e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-27 22:47:33 +02:00
Assam Boudjelthia
fc4a73aa54 Add QOffScreenSurface platform API abstraction
This follows the work done in 6ff79478a4.

The API is available by including qoffscreensurface.h, scoped in
the QPlatformInterface namespace. The namespace
exposes platform specific type-safe interfaces that provide:

 a) Factory functions for adopting native contexts, e.g.

    QAndroidPlatformOffscreenSurface::fromNative(ANativeWindow);

 b) Access to underlying native handles, e.g.

    surface->platformInterface<QAndroidPlatformOffscreenSurface>()
                ->nativeSurface()

Fixes: QTBUG-85874
Change-Id: I29c459866e0355a52320d5d473e8b147e050acb3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-27 23:35:16 +03:00
Volker Hilsheimer
15db957585 Remove obsolete ### Qt 6 comment
Change-Id: Ia0c903a1bccbd9e495778834a56ed2caebdfbac7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-08-27 22:29:20 +02:00
Volker Hilsheimer
d6d662bba5 Rename QStyleOptionMenuItem::tabWidth to reservedShortcutWidth
As per ### Qt 6 comment, and the documentation for the variable.

Change-Id: I58df784a72129dc97c5f13eb54e34cb7feb9748c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-08-27 22:29:12 +02:00
Volker Hilsheimer
062d283184 macOS: fix standaloneMonthName implementation for system locale
macOS has specific formatters for the standalone month names, so use
them.

Change-Id: Ic4ad547c7d1c29d71c85f60301acd5a5f0f263d2
Fixes: QTBUG-86191
Pick-to: 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Evgeniy Dushistov <dushistov@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-08-27 18:58:21 +02:00
Mårten Nordheim
bba0bdb35c Redo QNetworkAccessBackend and various cleanups around it
Makes the QNetworkAccessBackendFactory a real interface to be used in
plugins. Requires exporting some classes but they're not made public
yet.

Removes unused features and functions.
    Some things are likely still unused due to being specific for HTTP
    but the HTTP network replies don't use this backend system.
Changes QNetworkAccessBackend to use a more traditional
read(char*, qint64) function for the "downloaded" data.
    And an optional readPointer if supported. So far no backends have it
    so it's somewhat useless, but it may be useful going forward.
        If not it shall be deleted
Converts all current backends to the new setup
    Easy enough, also gets rid of some unused functions.

Task-number: QTBUG-80340
Change-Id: I9339e6c6eb394c471c921f5cafd3af6175936399
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-08-27 18:58:21 +02:00
Mårten Nordheim
f7f79483e7 Remove QFtp sources etc. in favor of alternate distribution
While we initially wanted to just disable the functionality the way it
is currently built forces people to do a full build of Qt just to enable
it. Instead of doing this half-measure let's just remove the code
completely from QtBase and rather prepare QtNetwork to handle being a
plugin that can be compiled at any time.

Task-number: QTBUG-80340
Change-Id: I19155c8c167cf932088f01b2a9706d0e7ab792d1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-08-27 18:58:21 +02:00
Lars Knoll
3964ece5a5 Pass QByteArrayView by value
Change-Id: I65df03e7781bac63d98b8d3b59568841601d8f25
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-27 18:58:21 +02:00
Lars Knoll
03a0937754 Inline the equality operator
There's no reason to have this out of line.

Change-Id: I52aa2ba941f9c81c2194865b156dbc0a2104363b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-27 18:58:21 +02:00
Lars Knoll
84f3690947 Make QUUid constructors from string like types explicit
I don't think we want to have implicit conversion
from a const char * or a QByteArray to a QUuid.

Change-Id: Idfe7450ce15b89e295aa7af7ccf1fc94f5acd4f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-27 18:58:21 +02:00
Tasuku Suzuki
9067b8a456 Fix build without features.animation
This has been broken since 359616066e.

Change-Id: I9428bf4e1bca3f10c59a7ea334e6bb7e43c4e020
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-28 01:58:21 +09:00
Lars Knoll
50661a9558 Change QByteArray to handle large arrays
Use qsizetype throughout.

Change-Id: I787af7fcfa17e1be87decb64c41c609cc24be117
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-27 18:58:20 +02:00
Andrei Golubev
f48dba0665 Update allocation interface of QArrayDataPointer
Added overload to allocGrow that figures the capacity to allocate from
the newSize argument passed. This is useful in QList (and likely in other
places)

Fixed QArrayPodOps::reallocate as a drive by: don't call memmove when
it is not needed

Task-number: QTBUG-84320
Change-Id: I67efe55a60efaf3ab6057b0249d6a446e04a09e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-27 18:58:20 +02:00
Andrei Golubev
15553c39f4 Make *ArrayOps::createInPlace protected
No user of QArrayDataPointer functionality must use createInPlace. This
is a special function to be called by the internal logic. It's usage is
unsafe with prepend optimization in place

Task-number: QTBUG-84320
Change-Id: Idc0e82975a98e799272bdb61fe7828b3c8c67e8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-27 18:58:20 +02:00
Andrei Golubev
4a56a5f6cf Support GrowsBackwards prepend in QList
Restored previously deleted logic of setting GrowsBackwards flag for
prepend-like cases. This should be sufficient to fully enable prepend
optimization

Fixed QList::emplace to not use implementation detail logic. Updated
tests to cover changed behavior and its correctness

Task-number: QTBUG-84320
Change-Id: I4aadab0647fe436140b7bb5cf71309f6887e36ab
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-27 18:58:20 +02:00
Andrei Golubev
f9bb3aa5ce Add prepend optimization to QCommonArrayOps
Introduced prepend optimization logic to QCommonArrayOps.
Trying to rely on original QList behavior

Task-number: QTBUG-84320
Change-Id: I46e6797b4edad804a3e3edb58307c9e96990fe01
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-27 18:58:20 +02:00
Andrei Golubev
e35d0ae0cc Support GrowsBackwards flag in QArrayDataPointer
Introduced allocation function in QArrayDataPointer with
interface similar to QArrayData::allocate that supports growing
strategies. This func is used instead of the original in cases
when prepend-aware storage is needed. Tried to follow Qt5 QList
policy in terms of space reservation

Updated QPodArrayOps::reallocate to be aware of growing
shenanigans. It doesn't look like a perfect solution but it is
rather close and similar to what Qt6 QList is doing when not
growing (e.g. reserve/squeeze)

Added initial QCommonArrayOps with helper function that tells
when reallocation is preferable over just using the insert-like
operation. This comes up later on when GrowsBackwards policy is
properly supported in operations

Essentially, 2/3 main data management blocks for prepend optimization
are introduced here. The last one being a generalized data move that
is done instead of reallocation when existing free space is not enough

Task-number: QTBUG-84320
Change-Id: I9a2bac62ad600613a6d7c5348325e0e54aadb73d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-27 18:58:20 +02:00
Andrei Golubev
4b2f5371d9 Fix subtle issue in tst_qtablewidget
Fixed UB when QList::begin() iterator is used after a call to
QList::remove(). As QList is now effectively double-ended container,
there is no guarantee on iterator validity upon erasure

Task-number: QTBUG-84320
Change-Id: I27793f131e8e23a41ac6c2c1db0bdc61ee58891f
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-27 18:58:19 +02:00
Edward Welbourne
7883bf7304 Mark some Qt namespace enum members properly as deprecated
A comment is not good enough, Some of the enum members were even still
in use, or mentioned in documentation.

WA_ContentsPropagated, WA_WState_DND and WA_ForceAcceptDrops have been
deprecated since 4.5.1; and at least the last has been an \omitvalue
in the docs for even longer.  (WA_ShowModal and WA_GroupLeader have
been similarly marked, but are in use, see QTBUG-85816.)

Push back to 5.15.1 in order to be able to remove these at Qt 6.

Pick-to: 5.15.1
Change-Id: I6ea3839767e5f5158b0fed508f65798470191908
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-27 13:05:42 +00:00
Morten Johan Sørvig
ffde7e8995 QIcon: Add pixmap() overload which take devicePixelRatio
Add new QIcon::pixmap() overload:

  QPixmap pixmap(const QSize &size, qreal devicePixelRatio, ...)

This function replaces the existing pixmap() function which
take a QWindow pointer, and should be more convenient in use.

Task-number: QTBUG-85885
Change-Id: Ie4ca96a266d9278864678dc61bdfc2836cabdb93
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-08-27 12:13:08 +02:00
Giuseppe D'Angelo
7a5f865186 QLayout::indexOf: redo implementation
Stop relying on the "magic" of itemAt returning nullptr for out of
bounds. Just use count().

Unfortunately, QMainWindowLayout breaks the API contract by NOT
implementing count() properly. So, make its count() crash if called;
and move the itemAt implementation there.

Change-Id: I120686a834bab15dd537598a56bd93d6a5924aa5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-08-26 23:07:22 +02:00
Morten Johan Sørvig
fded035b1c Make QPaintDevice::devicePixelRatio() return qreal
For historical reasons Qt 5 has:

  int QPaintDevice::devicePixelRatio()
  qreal QPaintDevice::devicePixelRatioF()

Change the int to qreal so that Qt 6 will have

  qreal QPaintDevice::devicePixelRatio()
  qreal QPaintDevice::devicePixelRatioF() [to-be-removed]

Change-Id: Ie904e02ec490cbcd2acb5dcecb193e9af4cb90f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 20:09:51 +00:00
Peng Wenhao
4073d3a10e QColumnView: replace QItemDelegate with QStyledItemDelegate
Resolve remaining Qt6 TODOs

Change-Id: Ida72cbb58dafe4bde5da82996de7434c767bbe63
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-26 17:33:45 +00:00
Volker Hilsheimer
02d4495115 Remove ### Qt 6 comment
Adding the role that changed to the itemChanged signal is
computationally expensive for the general case. Not going to be done,
at least not for Qt 6.0.

Change-Id: I3e6fca6a5c7b517c3c035477ce5d23d8870bad57
Reviewed-by: David Faure <david.faure@kdab.com>
2020-08-26 18:32:19 +02:00
Volker Hilsheimer
556511f9f3 Move the QPalette::resolveMask into the private
With 64bits, the mask is exhausted with the 21 colors x 3 color groups
we have right now.

In order to support accent colors, we need more palette entries. By
moving the mask into the d-pointer, we can extend QPalette within
the Qt 6 series, without breaking binary compatibility.

The resolveMask/setResolveMask methods that take integers are
documented as internals, so we can change those signatures after
Qt 6.0 as well.

As a side effect, setting the resolve mask on a QPalette detaches now.
Setting a mask is in most cases done on the result of
QPalette::resolve, which is usually detached already. And the QPalette
default constructor will have to detach from the global application
palette if that palette has any colors set explicitly.

Task-number: QTBUG-82925
Change-Id: I1e70f1c4d0dd98303e353b91df5dba2b1fe8ba01
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 18:03:09 +02:00
Volker Hilsheimer
c501e09efa Replace QAbstractItemView::viewOptions with initViewItemOption
viewOptions returned a QStyleOptionViewItem object. Such a method
can never support newer versions of the option structure.

Most styleable QWidget classes provide a virtual method
initStyleOption that initializes the option object passed in as a
pointer, e.g QFrame, QAbstractSpinBox, or QComboBox.

Follow that API convention, but name it initViewItemOption, as the
QStyleOptionViewItem struct contains information about the item as
well as the widget itelf.

This is a source incompatible change that will go unnoticed unless
existing subclasses mark their overrides as 'override', or call
the removed QAbstractItemView::viewOption virtual function.

[ChangeLog][QtWidgets][QAbstractItemView] The virtual viewOptions
method that previously returned a QStyleOptionViewItem object has
been renamed to initViewItemOption, and initializes a
QStyleOptionViewItem object that's passed in through a pointer.

Change-Id: Ie058702aed42d77274fa3c4abb43ba302e57e348
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-08-26 18:02:58 +02:00
Volker Hilsheimer
70f7c484c3 Merge QOffscreenSurface constructor overloads
Address ### Qt 6 comment

Change-Id: I4ca9085266f9008b769bb164e6169439adadb12f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 18:02:50 +02:00
Lars Knoll
a5c71e4366 Remove the alignas() from QVariant::Private
This was causing miscompilations with clang on macOS. As it's
not really required, remove the alignment requirement.

Change-Id: Iacef1af7f51990daddc73fe74449adc1a823aa33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-26 17:34:55 +02:00
Kai Koehne
10b5db1393 Improve license information for libpng
Use the official name and ID from SPDX:

https://spdx.org/licenses/libpng-2.0.html

Pick-to: 5.15
Change-Id: I199efd600373cdc150d48a449b122f90ff2c48ef
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-08-26 17:30:50 +02:00
Tor Arne Vestbø
b5f972361a Introduce QWindow::paintEvent with QPA plumbing
The explicit paint event on QtGui and QPA level allows us to untangle
the expose event, which today has at least 3 different meanings.

It also allows us to follow the platform more closely in its semantics
of when painting can happen. On some platforms a paint can come in
before a window is exposed, e.g. to prepare the first frame. On others
a paint can come in after a window has been de-exposed, to save a
snapshot of the window for use in an application switcher or similar.

The expose keeps its semantics of being a barrier signaling that the
application can now render at will, for example in a threaded render
loop.

There are two compatibility code paths in this patch:

  1. For platform plugins that do not yet report the PaintEvents
     capability, QtGui will synthesize paint events on the platform's
     behalf, based on the existing expose events coming from the platform.

  2. For applications that do not yet implement paintEvent, QtGui will
     send expose events instead, ensuring the same behavior as before.

For now none of the platform plugins deliver paint events natively,
so the first compatibility code path is always active.

Task-numnber: QTBUG-82676
Change-Id: I0fbe0d4cf451d6a1f07f5eab8d376a6c8a53ce8c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-08-26 16:44:53 +02:00
Tor Arne Vestbø
c3555fc33d Add note about use of receivedExpose member in QGuiApplication
Change-Id: I221586a4fac394a9110d28905a898ab9688c1183
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-26 16:44:49 +02:00
Jordi Pujol Foyo
560117351c Allow arbitrary baseline shift in QTextCharacterFormat
Added 6 new methods in QTextFormat and QTextDocument to
allow setting/getting specific % positioning for baseline and super/
subscript. Modified QTextLayout to honor those new settings.

[ChangeLog][QtGui][QTextLayout,QTextFormat,QTextDocument] Allow text
layout modification based on baseline offset and super/subscript % height
positioning

Fixes: QTBUG-18260
Change-Id: I0796f18224aac8df6baf8359c35022fd98fe64ef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-08-26 16:40:10 +02:00
Jarek Kobus
cba2d04434 QtConcurrent: Add documentation for runWithPromise()
Task-number: QTBUG-84702
Change-Id: Ic8233aeffbdbd1420bdbde7ad7d03f25cd438ea8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-26 16:37:43 +02:00
Morten Johan Sørvig
77e04acb4e X11: restrict fallback logical DPI to 96 and higher
QXcbScreen determines logical DPI using the following priority:

1) use Xft.dpi if set
2) virtual desktop size / virtual desktop physical size

(This change does not restrict or alter the value obtained from
Xft.dpi in any way)

The fallback option 2) has several problems:
- It is a physical DPI, which does not account for
  viewing distance or user preference
- It is a global value for the entire virtual desktop
  (not per-screen)
- X servers usually fake the virtual desktop physical
  size such that the computed DPI ends up at 96; in
  cases where this does not happen we can end up with
  a surprising DPI value.

We might be better off just hardcoding 96 here, to avoid
picking up an incorrect physical DPI when for example
connecting to a TV (as reported in QTBUG-67928).

This change does not go as far as hardcoding 96, but instead
restricts the (fallback) DPI value to be 96 or higher.

Pick-to: 5.15
Task-number: QTBUG-67928
Change-Id: Ieea6c7a137261282b40302fb4c19273c5def10af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 16:37:43 +02:00
Richard Moe Gustavsen
ed813c19fa macOS: rename 'macintosh' style to 'macos'
Change the name/key of the style to 'macos'. Besides the
name 'macintosh' being archaic, we also need this
change to avoid creating 'macintosh' style folders
in QtQuickControls, now that we plan to use QPlatformTheme
also there to resolve the style.

[ChangeLog][Widgets][QStyle] The 'macintosh' style
has been renamed to 'macos'.

Change-Id: I14b8a8b4dbd369e7a7d16b94e4ad27e501e7e8d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 16:37:43 +02:00
Sona Kurazyan
9efe2a8603 Fix QFuture::waitForFinished to wait until QFuture is started
Currently QFuture::waitForFinished() exits as soon as the future is not
in the running state. If the user calls it before
QPromise::reportStarted() is called, it will exit immediately, because
nothing is running yet. Fix the behavior to wait for the finished state.

[ChangeLog][Important Behavior Changes][QtCore] Fixed the behavior of
QFuture::waitForFinished() to wait until the future is actually in the
finished state, instead of exiting as soon as it is not in the running
state. This prevents waitForFinished() from exiting immediately, if at
the moment of calling it the future is not started yet.

Task-number: QTBUG-84867
Change-Id: I12f5e95d8200cfffa5653b6aa566a625f8320ca8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-26 16:37:43 +02:00
Sona Kurazyan
7d35e31efb Add back QByteArray's relational operators taking QString
QString still has the overloads of relational operators taking
QByteArray. Add back QByteArray's relational operators taking
QString for symmetry. See also the comments of
d7ccd8cb45 for more details.

[ChangeLog][EDITORIAL] Remove the changelog about QString/QByteArray
operators being removed. They're back.

Change-Id: I22c95e727285cf8a5ef79b3a4f9d45cb66319252
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 14:37:43 +00:00
Alex Trotsenko
fe4b246446 Synchronize QEventDispatcherWin32::processEvents() with QCoreApplication
QCoreApplication has a special internal mechanism to control whether
the event dispatcher should block after delivering the posted events.

To handle queued connections in nested loops properly, we should use
that functionality.

Pick-to: 5.15
Fixes: QTBUG-85981
Change-Id: I124179a23b26a995cf95ed379e97bfa62c95f42a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-26 11:08:15 +03:00
Shawn Rutledge
5449bddb04 Rename QTabletEvent::m_zTilt to m_z
This is a z coordinate unrelated to tilt, AFAIK.
Amends ea2ae140e9

Change-Id: If165df3af290fbe7c2e5bfa94d578175debd53cd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 05:21:30 +02:00
Giuseppe D'Angelo
67c3c7a29c Smart pointers: port to explicit operator bool
Enough with the restricted bool trick; use the established solution.

[ChangeLog][Potentially Source-Incompatible Changes] QScopedPointer,
QSharedPointer and QWeakPointer's conversion operator towards bool
is now explicit. In some cases this may require an explicit cast
towards bool that was not needed before (notably, when returning
an object of these types from a function that actually returns bool).

Change-Id: I02b89278e75b7e7493ee7e35460504719e00f028
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 02:19:17 +02:00
Marcel Krems
8dd50ef206 Remove deprecated qGenericMatrix{To,From}Matrix4x4 functions
Change-Id: I3b43d48f5324f3a1f2fff8e22bb4f9563d3ea997
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 01:49:24 +02:00
Marcel Krems
ba9c4ee2cb QXmlString::size(): Change return type to qsizetype
Task-number: QTBUG-86224
Change-Id: I32baa08d2d116d7d81ba980d077f2e144a23b966
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 01:49:16 +02:00
Thiago Macieira
ad5a65b6a2 QStandardPaths/Unix: improve the XDG_RUNTIME_DIR creation/detection
First, use QT_MKDIR instead of QFileSystemEngine::createDirectory(), as
the latter can't create a directory with the right permissions. That
would allow an attacker to briefly obtain access to the runtime dir
between the mkdir() and chmod() system calls.

Second, make sure that if the target already exists that it is a
directory and not a symlink (even to a directory). If it is a symlink
that belongs to another user, it can be changed to point to another
place, which we won't like.

And as a bonus, we're printing more information to the user in case
something went wrong. Sample outputs:

 QStandardPaths: runtime directory '/root' is not owned by UID 1000, but a directory permissions 0700 owned by UID 0 GID 0

 QStandardPaths: runtime directory '/dev/null' is not a directory, but a character device, socket or FIFO permissions 0666 owned by UID 0 GID 0

 QStandardPaths: runtime directory '/etc/passwd' is not a directory, but a regular file permissions 0644 owned by UID 0 GID 0

 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-tjmaciei'
 QStandardPaths: runtime directory '/tmp/runtime-tjmaciei' is not a directory, but a symbolic link to a directory permissions 0755 owned by UID 1000 GID 100

Pick-to: 5.15 5.12 5.9
Change-Id: Iea47e0f8fc8b40378df7fffd16248b663794c613
Reviewed-by: David Faure <david.faure@kdab.com>
2020-08-25 16:13:44 -07:00
Volker Hilsheimer
872e37b2ff Implement QAbstractFileIconProvider to use theme and mime databases
This doesn't give useful defaults on all platforms; icon themes are not
provided on platforms other than Linux, and the mime database doesn't
always return user-friendly names based on file names.

However, both icon themes and the mime database can be customized by
application developers by shipping a data file side-by-side with the
application, without the need for reimplementing the provider class.

Change-Id: Ie4b18ac1b861e2da64f01d1f209986b27fbe6bd5
Task-number: QTBUG-66177
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 01:13:19 +02:00
Steffen Kieß
2cb8568ab2 Properly free m_mtdev when mtdev_open() returns an error
Pick-to: 5.15
Change-Id: I57813da1eafe9fbc9d60b865e867558791e34528
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-08-26 01:12:59 +02:00