Commit Graph

47502 Commits

Author SHA1 Message Date
Edward Welbourne
1aa412987f Remove QUnicodeTools::DefaultOptionsCompat
Used in only one place, declared in a private header with a comment
saying to remove it. All callers of the one function that had it as
default parameter value are passing a value for the parameter.

Task-number: QTBUG-85700
Change-Id: Ic72e4df730740a4023b0a43be6bf7acf33a3166b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:29:45 +02:00
Edward Welbourne
429985b53a Convert QStringView::toWCharArray() to return qsizetype
As requested in a ### Qt6 comment.

Task-number: QTBUG-85700
Change-Id: I28a02bf49f4a6455a21a6032179318ce2915b8ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:29:29 +02:00
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
1fb35832df Simplify initialization of UnicodeData and PropertyFlags structs
Initialize values where they're declared, where possible.

Change-Id: Ib6bf33b27b19c76f406f78bc8a1bd9729bd8f2cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:27:51 +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
Alessandro Portale
7fe7bd326f CMake: Fix cmake wrapper creation when cross-building
Change-Id: I363ee470973df89d16314671e3c33771040061f2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-28 12:09:53 +00: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
Tor Arne Vestbø
756d7facf6 Fix tst_QHighDpiScaling::scale
Without an override for logicalDpi() the base class implementation
would use the geometry of the screen to figure out the DPI, and end
up with ~100, which combined with a 96DPI base logical DPI would
give a wrong scale factor.

Change-Id: I68aecce44d2ee672c7b707dfe5444af8f551e961
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-08-28 13:00:05 +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