Commit Graph

54968 Commits

Author SHA1 Message Date
Fabian Kosmale
348f67d7ec qmetatype.h: remove unused includes
[ChangeLog][Potentially Source-Incompatible Changes] The qmetatype.h
header no longer includes qvarlengtharray. It might be necessary to
include the header explicitly if code previously relied on it being
implicitly included.

Change-Id: If58245836715ec8a323ec8cbadc67d73a742b15f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-09 14:02:56 +01:00
Axel Spoerl
005f3ad625 Update widgets inheriting QAbstractSpinbox in tst_baseline_widgets
Create QAbstractSpinBox test
Update test for QSpinBox
Add tests for QDoubleSpinBox, QDateEdit, QTimeEdit
Add test for QDateTimeEdit incl. calendar popup

Task-number: QTBUG-99677
Change-Id: Ia74686f47a1520ab4c7e878b19fc774e00db88dd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-09 08:01:46 +01:00
Shawn Rutledge
49d3080155 xcb: Show valuator atom names properly in categorized logging
During a touch update, this looked questionable since I don't have any
barcode readers or buttonboxes attached:

XI2 touch event type 19 seq 1481 detail 193 pos  116.3,   77.8 root pos 6476.3, 2941.8 on window 3e00006
   valuator              BARCODE value 47796.365791 from range 0.000000 -> 65535.000000
   valuator            BUTTONBOX value 59504.858830 from range 0.000000 -> 65535.000000
   touchpoint  193  state  QEventPoint::Updated  pos norm  QPointF(0.729326,0.907986)  area  QRectF(...

After the fix it's like this:

XI2 touch event type 19 seq 1235 detail 201 pos  154.0,   64.3 root pos 6168.0, 2794.3 on window 5000006
    valuator    Abs MT Position X value 45520.589958 from range 0.000000 -> 65535.000000
    valuator    Abs MT Position Y value 56519.790001 from range 0.000000 -> 65535.000000
    touchpoint  201  state  QEventPoint::Updated  pos norm  QPointF(0.6946,0.862437)  area  QRectF(...

ValuatorClassInfo's QXcbAtom::Atom is a Qt enum, which has to be
converted to xcb_atom_t before we can call xcb_get_atom_name_name.
Originally in ce2fe90faa vci was of type
XIValuatorClassInfo; then 7499d4404f
changed it to our ValuatorClassInfo struct, but didn't add the lookup
indirection to this qCDebug.

Pick-to: 5.15 6.2 6.3
Change-Id: Ib6107f17d6c6c209573e3df54149d6cfffc0b8b6
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-02-09 06:47:19 +00:00
Shawn Rutledge
cf2ec5a5fc doc: clarify that passive-grab API is only for Qt Quick Pointer Handlers
...for now anyway. The plan is to have C++ API for custom handlers
later on; and we'll see if we find any other "must-have" use cases.

Task-number: QTBUG-68110
Pick-to: 6.2 6.3
Change-Id: I5e624a500af37797345d25bb5f54b146b13a45ca
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2022-02-09 06:46:57 +00:00
Thiago Macieira
8058127a9d QLibraryInfo: remove load-time variable
Since this is only used by qtpaths and qmake, let's not make every
application pay the price of dynamically initializing a QString whenever
QtCore is loaded (which 100% of Qt applications do). Instead,
initializing a null pointer costs zero and is one third the size of
QString. Even the assignment in qmake and qtpaths is faster this way.

Pick-to: 6.3
Change-Id: I6fcda969a9e9427198bffffd16ce8d1eb8dc19da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 11:57:34 -08:00
Fabian Kosmale
8b87c6f198 Blacklist tst_qscreen::grabWindow on Windows
Task-number: QTBUG-100412
Pick-to: 6.3
Change-Id: I8497cf31d690bc5fc22d808cba95254b7fedcc49
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 16:28:47 +00:00
Shawn Rutledge
6b2c9b81af Deprecate QContextMenuEvent and QMouseEvent ctors without globalPos
As with QHoverEvent, it's better to require globalPos rather than
"initialized to QCursor::pos(), which may not be appropriate" as the
docs have pointed out for many years now. This removes the remaining
calls to QCursor::pos() in event constructors.

Task-number: QTBUG-52430
Task-number: QTBUG-69433
Task-number: QTBUG-100324
Change-Id: I076dae56f37abaad7085cc95dddee453a80a45f3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-05 17:18:35 +01:00
Allan Sandfeld Jensen
a300c3810c Detect clang-cl features as clang not as msvc
Clang-cl supports the clang detections, and only approximates specific
MSVC version.

This works as the MSVC standard library is ahead of the clang standard
library. Where this logic was written 7 years ago when it was not the
case.

Pick-to: 6.3
Change-Id: Ic13e2f2fbcde011a0d8831cc48c0c9041bfe3b99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 11:06:37 +00:00
Fabian Kosmale
e400ba64a3 Use acq_rel ordering semantics in qatomic_cxx11.h ref/deref
Change ref() and deref() in qatomic_cxx11.h to use acq_rel ordered
semantics as documented instead of the stricter sequential consistency
that was previously used implicitly.

It was pointed out in the discussion on atomic reference counts that
acq_rel semantics should be sufficient for reference counts. It also
turned out that that is all that the definition of "Ordered" in the
documentation really guarantees.

Original-patch-by: Kevin Kofler <kevin.kofler@chello.at>
Change-Id: I6cd50b34bdc699ff8b7c8fe6d303b28d71494731
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 07:26:55 +01:00
Marc Mutz
4d8cbf9863 QLibraryInfo: de-duplicate QT_BUILD_STR
The string was used as the return value of QLibraryInfo::build() and
also string-pasted into the format string in qt_core_boilerplate(). As
a proper substring (not suffix) of the format string, QT_BUILD_STR
could not be shared among the two users.

Fix by interpolating QT_BUILD_STR into the format string, so
QT_BUILD_STR appears by itself in both functions. The string should
now be shared, but compilers have quite low limits on lengths of
strings they will share, so turn the macro into an static function so
the actual string literal appears only once, guaranteeing
de-duplication.

It also feels a bit safer to interpolate the build string instead of
pasting it into the format string; it's not immediately obvious that
it cannot contain %s itself, even if we could expect a compiler
warning in that case.

Change-Id: I69d90c37c3a3dcf8ac46d4f36e7c0d2cf3b947af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 07:26:55 +01:00
Marc Mutz
64de057ebe QLibraryInfo: mark isDebugBuild() noexcept and CONST
It's literally

   return true; // or
   return false;

so it can be marked as noexcept and (the stronger form of) pure.

Change-Id: Id55fee1db5d18201be2ea6c6778ece3de68b05f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 07:26:55 +01:00
Mårten Nordheim
d32fb5f1fe QProcess(Win): change int to qsizetype where appropriate
Even if it's unlikely any of those would exceed 2 billion entries.

Pick-to: 6.3 6.2
Change-Id: Ib0d4d4e7a64fcde03b7f24bc0667d63c4a737deb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 05:18:44 +01:00
Christian Strømme
96f16e7487 Convert string tables in QShaderDescription to use string literals [1/2]
Avoid allocating all these strings on load. Part 1: tables.

Pick-to: 6.3 6.2
Change-Id: Ibf7af9aea0088efe68b247c68022b98143634616
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-05 03:55:11 +01:00
Marc Mutz
c3c2a0f754 QDBusAdaptorConnector: place a static int into BSS instead of DATA
The cachedRelaySlotMethodIndex started out as -1, assuming no slot
could have that index.

But 0 is just as good a marker, because we know that method index 0
will be one of QObject's (destroyed() or deleteLater()).

So start out with a zero initial value, which means the variable can
be placed in the BSS segment now and doesn't need to be stored in
DATA.

Pick-to: 6.3 6.2
Change-Id: I40b96d54f11e60348f465cafa15af98d41038c95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 03:23:33 +01:00
Marc Mutz
7277ffee52 QCalendar: fix build
Apple Clang 12:

qcalendar.cpp:456:22: error: loop variable '[key, value]' is always a copy because the range of type 'QFlatMap<QString,
QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QStringList, std::vector<QCalendarBackend *>
>' (aka 'QFlatMap<QString, QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QList<QString>,
vector<QCalendarBackend *> >') does not return a reference [-Werror,-Wrange-loop-analysis]
    for (const auto &[key, value] : byName) {
                     ^

Change-Id: I54f205f6b7314351b078fffd16d05e5cd3ef4c22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-05 01:26:14 +01:00
Sona Kurazyan
013d0fcf5f Fix a typo in QFutureWatcher docs
Pick-to: 6.3 6.2
Change-Id: I431d21e6161d117a7b2ee28ee9db955726d50f79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-04 21:55:02 +01:00
Toni Saario
872bf376a7 Use common install functionality
Common module uses the qt-cmake-private-install to install.
This ensures all configurations are installed.

Pick-to: 6.2
Change-Id: I4be97685c25392838dbc7ab7c3526f55987c08e6
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2022-02-04 19:19:19 +02:00
Toni Saario
65358114db Conan: Fix is_used_value input
The option name should be passed instead of it's value.

Pick-to: 6.2 6.3
Change-Id: I74529c36c438f5d40ecd4dcf689b3ea2a100e5fb
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2022-02-04 17:19:19 +00:00
Mårten Nordheim
3e3a109ef2 QLocale: Un-inline QString& constructor
Because it's BiC.
From the API review.

Pick-to: 6.3
Change-Id: I69f1fe58428241a876ae9058e8a0108a8e496c22
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-04 16:15:43 +01:00
Shawn Rutledge
bd71fb2514 QGuiAppPrivate::processMouseEvent: don't assume eventpoint didn't move
During delivery of a pointer event, another type might be synthesized
from it; and we are not yet "done" with all access to the original event
until the delivery of the synthesized event is completed. Further,
there could be a nested event loop if exec() is called on a dialog.
If QPointingDevicePrivate::pointById() causes activePoints to grow
(for example if we handle a fresh incoming touch event in the nested
event loop), reallocation could cause the persistentPoint reference near
the top of processMouseEvent() to be dangling by the time we get to the
bottom; so we need to call queryPointById() again to be sure to get the
persistent QEventPoint that is actually used in the current mouse event
to ungrab.

Fixes: QTBUG-97157
Pick-to: 6.2 6.3
Change-Id: Ib3b90eef5db691675b03474fd75981e972d11d2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-04 12:33:25 +01:00
Eskil Abrahamsen Blomfeldt
26a0638222 Fix infinite loop in dash stroker
When the positions were large enough, we would get precision errors
with the floating point numbers.

We calculate the relative position:
  dpos = pos + dashes[istart] - doffset - estart
and then later
  pos = dpos + estart

If estart is a huge number (range of 10^18) and dashes[istart] is
a low number (10^1), then estart + dashes[istart] == estart and
the loop will never progress, dpos will be 0.

Since the loop should never iterate more than dashCount times
(since we cut away all full dash sequences before entering it),
we add a failsafe that exits the loop if it detects the error.

Fixes: QTBUG-99690
Pick-to: 5.15 6.2 6.3
Change-Id: Ia6a42f21b6b4c6adf5cdd703b6483750513a88ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-04 12:02:45 +01:00
Janne Juntunen
c984a9bf07 tst_qresourceengine: use QFINDTESTDATA() to find correct path
Use alternative method for finding searchPath since
QT_TESTCASE_SOURCEDIR did not point to a correct location on webOS
QEMU test environment.

Fixes: QTBUG-99954
Pick-to: 6.3
Change-Id: I05f95b4aa02027976036d0842ca564a602e01d0e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-04 11:02:07 +02:00
Thiago Macieira
4a93285b16 QtCore: use C++11 thread_local instead of QThreadStorage
It's more efficient than our QThreadStorage and definitely much better
than the Q_GLOBAL_STATIC+QThreadStorage solution. We can do this because
the last compiler not to have thread_local support was MSVC 2013, which
is no longer supported since Qt 5.11.

QThreadStorage also managed the lifetimes of pointers for us, so the
equivalent thread_local requires std::unique_ptr.

Change-Id: Id59bdd8f1a804b809e22fffd15405f1b394c48d8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-03 19:58:36 -08:00
Thiago Macieira
de6ced6692 QCborValue: fix incorrect to{Array,Map} when the value is empty
When QCborValue referred to an empty array or map, toArray() and toMap()
would respectively return the default value instead of the empty object,
as expected.

Pick-to: 6.2 6.3
Change-Id: I5e52dc5b093c43a3b678fffd16b60456d0037ad7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-03 14:45:46 -08:00
Marc Mutz
1e62f08998 QBuffer: exterminate three thread-safe static guard variables
Instead of duplicating two dynamically-initialized statics each in two
functions, causing four threading guards to be emitted by the
compiler, pack the two variables into a static struct and the struct
into an Extracted Method, leaving just a single threading guard.

https://godbolt.org/z/a9e5o848f

Uses C++14 NSDMI-in-aggregates, so doesn't work in 5.15.

Pick-to: 6.3 6.2
Change-Id: I98e053df48aafd5720ceffd514d6811fd3b28b1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-03 22:12:06 +00:00
Alexandru Croitor
bb9be22133 CMake: Fix rpath set for Qml plugins to not contain lib64
Qt6QmlMacros uses the value of GNUInstallDirs's CMAKE_INSTALL_LIBDIR
to calculate the rpath from a Qml plugin's location to the Qt
libraries.

By default CMake detects the value of CMAKE_INSTALL_LIBDIR, and on an
RHEL system it is set to 'lib64', whereas we usually configure Qt with
the lib dir set to just 'lib'. This might cause issues with Qml
plugins not locating the Qt libs due to an incorrect rpath.

Ensure that when building Qt libraries and plugins,
CMAKE_INSTALL_LIBDIR is set to the same lib dir value that Qt was
configured with.

Pick-to: 6.3
Fixes: QTBUG-99707
Task-number: QTBUG-100432
Change-Id: I17b2a22d46ef3b40084a2f6a4992f0e23b35d4d3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-03 21:55:38 +01:00
Marc Mutz
40828992eb QCollator: port from QString::compare_helper to QtPrivate::compareStrings
The call becomes simpler, and QCollator no longer needs to befriend
QString.

Pick-to: 6.3
Change-Id: Ie2c977dc39973423f07563a0702a83fa3c75270d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-03 21:21:29 +01:00
Alexandru Croitor
acaba63260 configure: Raise error if -skip/-submodules is used in per-repo build
Specifying the options would do nothing, so it's better to error out
early in case the developer accidentally added them.

Pick-to: 6.2 6.3
Change-Id: Ia516468a22c3c48e9e84dc78e522e8870186d96b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-03 21:21:29 +01:00
Alexandru Croitor
7cb2bbd9e7 configure: Introduce -submodules option
The option is used to specify a list of Qt repos (git submodules)
that should be included in the configuration of a top-level Qt build.

The option takes a comma-separated list of qt submodule names e.g.
'qtbase,qtsvg,qtdeclarative'

It can also take a single value like 'qtbase' or 'qtquick3d'.

Each specified submodule and all of its transitive dependencies will
be included when configuring the top-level Qt build (assuming that the
submodules have previously been already checked out).

Any missing submodules or dependencies will not be automatically
checked out, but rather skipped. This can result in a failed
configuration if a required submodule is missing.

If some optional transitive submodule dependency is not desired in the
build, you can combine the -submodules option together with -skip
options.

E.g. configuring with

  -submodules qtdoc,qtnetworkauth -skip qtmultimedia,qtimageformats

will result in a top-level build with the following  submodules:

 - qtbase (common dependency)
 - qttools (dependency of qtdoc)
 - qtactiveqt dependency of qttools)
 - qshadertools (dependency of qtdeclarative)
 - qtdeclarative (explicit)
 - qtnetworkauth (explicit)
 - qtdoc (explicit)

Pick-to: 6.2 6.3
Fixes: QTBUG-100388
Change-Id: Ie8c47cfd1d1e0e44a27260bf9ddf968531cc1cc0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-03 21:21:29 +01:00
Alexandru Croitor
40155ddd0e configure: Allow specifying a comma separated list to -skip option
This makes skipping a list of submodules more concise.

e.g. instead of passing

 -skip qtsvg -skip qtimageformats -skip qtmultimedia

pass

 -skip qtsvg,qtimageformats,qtmultimedia

Pick-to: 6.2 6.3
Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-03 21:21:28 +01:00
Alexandru Croitor
b43528ea00 Fix mach_port_t not being found
Fixes errors like
In file included from
qtbase/include/QtCore/6.4.0/QtCore/private/qcore_mac_p.h:1:
qtbase/src/corelib/kernel/qcore_mac_p.h:61:9:
error: unknown type name 'mach_port_t'

Amends e05300163e

Pick-to: 6.2 6.3
Change-Id: I8f4c579e9b8ef187859497361c4e126a486a543c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-03 20:05:05 +01:00
Alexandru Croitor
d1c825ae8c CMake: Temporarily disable building external examples in prefix builds
There are issues when building examples as external projects in the CI
in child repos like qtsvg.

QEMU configurations fail to find some CMake Config files, Windows
configs fail to find libraries.

Until these issues are fixed, build examples in-tree (without using
external projects) like we did before.

Temporarily disables 98c89c8cc1

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ia4b39812b27cfde5f5a103fd39cc1cb032842643
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-03 19:29:44 +01:00
Ievgenii Meshcheriakov
58c48b40d1 QUrl: Use Q_CORE_REMOVED_SINCE instead of explicit version checks
Use Q_CORE_REMOVED_SINCE macro for fromAce()/toAce() API changes.

Pick-to: 6.3
Change-Id: I057c6d648c2141929f04e4b4c4a38ba3275261ab
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-03 18:31:44 +01:00
Ievgenii Meshcheriakov
6afa04f16c QLocale: Use Q_CORE_REMOVED_SINCE instead of explicit version checks
Use Q_CORE_REMOVED_SINCE macro for languageToCode()/codeToLanguage()
API changes.

Pick-to: 6.3
Change-Id: I8cc5279b1272165541c345241af49523c0f25737
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-03 18:31:44 +01:00
Eskil Abrahamsen Blomfeldt
b0e8ba783b DirectWrite: Turn off grid-fitting for unhinted text
When QFont::PreferNoHinting is set, we disable the automatic
grid-fitting done by DirectWrite in order to get shapes as close
as possible to the original design.

[ChangeLog][Windows][Text] Automatic grid-fitting is now disabled
for fonts that set QFont::PreferNoHinting.

Change-Id: Idfd3707153799bb8aa13f0d23e4dd6f1893ce53d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-03 18:31:43 +01:00
Janne Juntunen
5170574532 tst_qlogging: use correct qlogging_helper path on webOS
Switched to use runtime path instead of compile time path for the
helper executable. Some tests cases were failing on webOS because of
wrong path.

Fixes: QTBUG-99846
Pick-to: 6.3
Change-Id: I566bc04bdb96ac6e7dd0a875eadb50685aef8282
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-03 14:24:21 +02:00
Edward Welbourne
06942138d6 Move prematureExec() to the end of tst_qsqlquery's testing
It leaves the system in a state that breaks at least one later test,
so put it last. (This was first seen when picking back to 6.2, but I
am now able to reproduce it on dev.)

Amends commit 78eac57f3d

Pick-to: 6.3
Change-Id: I918cf43cdfc27357329a175518d6f9755747bae5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-03 12:28:42 +01:00
Shawn Rutledge
0a64a044b6 Add a QHoverEvent ctor taking global mouse position; deprecate the other
The QSinglePointEvent ctor assumes that the given globalPos is correct,
so it was wrong that the QHoverEvent ctor passed along a local position
as global. It's better to require globalPos as an argument; and in fact
it seems that everywhere we construct a QHoverEvent, global position is
available, or possible to get by transformation (which is better than
resorting to QCursor::pos()).

Also, don't convert to QPoint: pointer events have qreal resolution and
there's no reason to truncate them.

Fixes: QTBUG-100324
Change-Id: I919455da36265988d3d149eb97563c9ed0d2c660
Pick-to: 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-03 10:18:43 +01:00
Volker Hilsheimer
5c6f8b2c67 Always wait in the QScreen::grabWindow test
On X11 we already had to wait as window managers might scroll windows
in. On macOS we also waited - albeit a bit shorter - also because
screens scroll in slowly.

We didn't wait on Windows, and on Windows the test is quite flaky.
Attempting to make it run stably by waiting for long enough so that all
paint events are flushed to the screen.

As a drive-by, break some overly long lines.

Task-number: QTBUG-100412
Pick-to: 6.3
Change-Id: I49b1e447aced2fe1af3c5d30b514f8df3cc1813c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-03 04:57:26 +01:00
Giuseppe D'Angelo
c7a52d9d54 QTestLib: code tidies
Rename the `failureLocation` variable to `messageLocation`, as
it does not necessarily contain information about a failure.

Change-Id: I9e78dc76c8111c78e34c36f6623e9a8cc9e4764e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-03 04:34:08 +01:00
Giuseppe D'Angelo
e7d627339c QPluginLoader: report the right load hints
A default-constructed QPluginLoader erroneously reports that the
load hints are empty. However, setting a filename would then
automatically set the PreventUnload hint, surprising the user.

Return the correct flags instead.

Amends 494376f980

Change-Id: I7a95964cb680afd3adf2f71ed73d2f93023238f2
Fixes: QTBUG-100416
Pick-to: 5.15 6.2 6.3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-03 03:26:40 +01:00
Axel Spoerl
cb4b29cc2a Extend baseline test for QTabWidget
tabsClosable and documentMode added, merge conflict fixed

Task-number: QTBUG-99773
Pick-to: 6.3
Change-Id: I8eb51b9f434bc97e6e7e55377801c6ee8aec52b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-03 03:23:53 +01:00
Giuseppe D'Angelo
a605b9297d QPlainTestLogger: do not print "failure location" if there's no failure
When running a test under increased verbosity levels, QTestLib would
print "failure location" for every QTest function (QVERIFY, QCOMPARE,
...), even if there's no failure at all.

Keep the code centralized, but split the formatting of failures and
non-failures (other messages).

Task-number: QTBUG-96844
Change-Id: I3c508653176b68579dc0eb0cffcc153a52da2e2c
Pick-to: 5.15 6.2 6.3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-02 23:08:37 +01:00
Alexey Edelev
63f79d7ffb Add documentation for qt_finalize_project command
Task-number: QTBUG-100207
Pick-to: 6.3
Change-Id: I902ae827efad422771494ae3ad2da48d48d5c9cb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-02 22:37:33 +01:00
Andreas Hartmetz
f84206ba69 Better document attaching a QFutureWatcher to a started QFuture
It is an important and useful part of the API contract that the
QFutureWatcher signals will emit complete information after
setFuture() on an already started QFuture. If that wasn't so, some
API clients would need two code paths to gather state and progress
information: one through the signals for not yet started QFutures,
and one through the state querying APIs for already started
QFutures.

The previous documentation was not precise enough to rely on, even
though the implemented behavior - cf.
QFutureInterfaceBasePrivate::connectOutputInterface() -
seems well thought out and implemented to rely on.

Pick-to: 6.3 6.2
Change-Id: Iaf3db37a851f07ac85881adaea5c83612a7fd843
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-02 21:53:41 +01:00
Giuseppe D'Angelo
64e33727bb QPlainTestLogger: code tidies
Remove a couple of unnecessary string literals that only coped with an
impossible situation (default return after a switch that cover all the
enumerators).
Add a Q_UNREACHABLE() for good measure.

Change-Id: I8065218554edf98408d9c0823b8c301932681c59
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-02 20:08:25 +01:00
Edward Welbourne
d98b43005e Nail down handling of nextTransition() when before the first rule
Avoid, for years before the first rule, a whole lot of complications
needed when handling dates later than that rule's start. It is not
entirely clear the code would previously have Done The Right Thing; it
now is clear what it does.

Change-Id: I00a79c0a4733f1deb0bbfecb03e1c64a104d08a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-02 19:36:43 +01:00
Edward Welbourne
830fd1908b Add some more QDate::{start,end}OfDay() tests
While investigating an assertion failure I noticed that the existing
tests didn't even exercise these methods for local time or zone time.
Of course, we can't robustly test these time-specs, due to vagueries
of offset details and zone availability, but we can at least verify
that they return date-times on the specified date. Add a test-case for
the start of 1900, on which the assertions were first seen; it is the
earliest moment representable with tm_year >= 0, after all.

One of these tests fails on 6.2 but the fix for that (as opposed to
the the assertion) requires 6.3's improvements to the handling of
time_t's fuller range - too risky a change to pick back to 6.2.

Pick-to: 6.3
Task-number: QTBUG-99747
Change-Id: I98f5d7850a701972b2d8ea2ce203a2b3e7071354
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-02 19:36:43 +01:00
Joerg Bornemann
9b2bf17f3e qmake: Print proper error if no .pro file could be detected
When passing a directory to qmake, it tries to detect a .pro file in
that directory.  Whenever the detection failed, qmake printed an error
message like "Access is denied." or "file to open is a directory".

Now, qmake prints an actually helpful error message:

    ***Cannot detect .pro file in directory '../foo'.

    QMake expects the file '../foo/foo.pro' or exactly one .pro file in
    the given directory.

Fixes: QTBUG-34673
Change-Id: I3d21ead247734172eee4eb68d3f9782d3ddaea52
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-02-02 19:36:42 +01:00
Joerg Bornemann
747bca3d67 qmake: Scan source files with QFile
The C API we've used so far underlies stronger restrictions regarding
path length than QFile.  Since qmake is not bootstrapped anymore, we can
use QFile.

Task-number: QTBUG-99791
Change-Id: Ic7765b0c09a8aa07c208c1b1d02efe0c54bb44f2
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-02 18:43:40 +01:00