Commit Graph

10195 Commits

Author SHA1 Message Date
Liang Qi
b9585277e7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/tools/qlinkedlist.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmscreen.cpp

Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
2020-02-18 09:26:53 +01:00
Johan Klokkhammer Helsing
00eeed234f Move QOpenGLWidget from QtOpenGL to its own module
Same pattern as QtQuickWidgets. Gets rid of QtOpenGL's dependency on QtWidgets.

Task-number: QTBUG-74409
Change-Id: I4f9b55c23e25a1e0519734037b768a16e870c7d2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-18 09:22:51 +01:00
Volker Hilsheimer
189ae68d2a Try to stabilize tst_qwidget_qwindow::tst_resize_count on X11
This test fails sporadically on OpenSUSE, with the widget receiving
multiple resize events. Assuming that window management kicks in at
unpredictable moments and changes the geometry of the managed widget
possibly in several steps, we try to turn off all window management
on X11.

Change-Id: I7d2120c02eb870040b2ee94986a2ac5608d5a423
Fixes: QTBUG-66345
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-02-17 17:47:56 +01:00
Edward Welbourne
ed2b110b6a Allow surrogate pairs for various "single character" locale data
Extract the character in its proper unicode form and encode it in a
new single_character_data table of locale data. Record each entry as
the range within that table that encodes it. Also added an assertion
in the generator script to check that the digits CLDR gives us are a
contiguous sequence in increasing order, as has been assumed by the
C++ code for some time. Lots of number-formatting code now has to take
account of how wide the digits are.

This leaves nowhere for updateSystemPrivate() to record values read
from sys_locale->query(), so we must always consult that function when
accessing these members of the systemData() object. Various internal
users of these single-character fields need the system-or-CLDR value
rather than the raw CLDR value, so move QLocalePrivate's methods to
supply them down to QLocaleData and ensure they check for system
values, where appropriate first.

This allows us to finally support the Chakma language and script, for
whose number system UTF-16 needs surrogate pairs.

Costs 10.8 kB in added data, much of it due to adding two new locales
that need surrogates to represent digits.

[ChangeLog][QtCore][QLocale] Various QLocale methods that returned
single QChar values now return QString values to accommodate those
locales which need a surrogate pair to represent the (single
character) return value.

Fixes: QTBUG-69324
Fixes: QTBUG-81053
Change-Id: I481722d6f5ee266164f09031679a851dfa6e7839
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-17 14:55:24 +01:00
Nicolas Guichard
27d35a3ed0 QShaderGraph: Fix statement creation for graphs with dangling branches
For graphs like this one:

Input ----> Function1 ----> Output
      \
       ---> Function2
         (unbound output)

We would have generated only 2 statements, for Function1 and Output.

This change fixes this by treating Function2 like an output.
Therefore it generates 4 statements: Input, Function1, Output and
Function2.

Change-Id: Iaada40b9b949d771806dd47efad4f7ef2a775b48
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-17 14:35:56 +01:00
Karsten Heimrich
1b4dd753ed Disable FTP support in QNAM by default
If necessary, the feature still can be enabled with -feature-ftp.

Task-number: QTBUG-80339
Change-Id: I7dafaad254d1396f24ac5c339d55c3bedfa97f1c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-02-17 14:22:26 +01:00
Johan Klokkhammer Helsing
f2bbc9c69f Move QOpenGLFrameBufferObject from QtGui to QtOpenGL
Task-number: QTBUG-74409
Change-Id: I817ea6f052fc61a6465d443450c8017ac5d0c0e9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-17 08:01:27 +01:00
Edward Welbourne
1c0b69eac5 Only read the first BOM as a BOM; the rest are ZWNBS !
QUtf32::convertToUnicode() was forgetting to set headerdone when it
dealt with the header (for contrast, Utf16::convertToUnicode() does).

Fixes: QTBUG-62011
Change-Id: Ia254782ce0967a6cf9ce0e81eb06d41521150eed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-14 19:13:37 +01:00
Alexandru Croitor
d4c8ad79c4 Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev" 2020-02-14 14:55:04 +01:00
Thiago Macieira
210fd52e0d Autotest: adapt to certain OSes always allowing binding to low ports
Apple changed on macOS 10.14 (Mojave). Windows has always allowed.

Fixes: QTBUG-81905
Change-Id: I572733186b73423b89e5fffd15f12fee3f03c055
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-13 15:11:21 -08:00
Thiago Macieira
5ff37f13ee QTcpSocket::bind: fix issue found by BLACKLIST
The comment in QNativeSocketEnginePrivate::fetchConnectionParameters()
talked about IPv6 v4-mapped addresses. However, toIPv4Address also
converts the unspecified address (::), which resulted in QAbstractSocket
saying that it had bound to QHostAddress::Any instead of
QHostAddress::AnyV6

Change-Id: I572733186b73423b89e5fffd15f138579c5c0c50
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-13 15:11:11 -08:00
Alexandru Croitor
c53ee1f054 Merge remote-tracking branch 'origin/wip/cmake' into dev
Conflicts:
	tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt

Hopefully final merge from wip/cmake, and then all cmake changes
should target dev directly.

Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
2020-02-13 23:29:51 +01:00
Christian Ehrlicher
8471d267f1 QtSql: remove compat SQL plugin names
Remove the compat SQL plugin names (QMYSQL3, QOCI8, QODBC3, QPSQL7)
since they are not needed and just confuse the user

[ChangeLog][QtSql] The compat plugin names QMYSQL3, QOCI8, QODBC3 and
QPSQL7 are no longer available.

Change-Id: I6d88f449ef3e18881a6970fb374ba0ab074ef302
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-13 22:42:26 +01:00
Liang Qi
6b2535ea15 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/widgets/graphicsview/boxes/scene.h
	src/corelib/Qt5CoreMacros.cmake
	src/corelib/Qt6CoreMacros.cmake
	src/network/ssl/qsslsocket.cpp
	src/network/ssl/qsslsocket.h
	src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
	src/testlib/CMakeLists.txt
	src/testlib/.prev_CMakeLists.txt
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp

Disabled building manual tests with CMake for now, because qmake
doesn't do it, and it confuses people.

Done-With: Alexandru Croitor <alexandru.croitor@qt.io>
Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
2020-02-13 18:31:40 +01:00
Laszlo Agocs
cd02e29319 rhi: Allow detecting texelFetch support
Change-Id: I166c89af99e1289ae60febf2f41fab07eab9f7e8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-02-13 11:40:05 +01:00
Ulf Hermann
35f973d222 moc: Record whether a meta object is an object, gadget, or namespace
So far, objects had no identification, and both gadgets and namespaces
were called "gadget". qmltyperegistrar, however, is especially
interested in the distinction between namespaces and anything else.

Task-number: QTBUG-68796
Change-Id: Ic5739727bdef7766de6e535c6568920198fadb2b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-13 11:40:05 +01:00
Volker Hilsheimer
67491e2df5 Detect double timer during single timeout in registerTimer test, and skip
We observe this happening on macOS in the CI system, and it might happen
if a VM doesn't get CPU cycles for long enough time so that two timers
time out. Then event processing will process two timer events, and we
overwrite the timerIdFromEvent with the second event.

Instead, skip the test when this happens.

This is an ammendment to 5c520f4b0a

Change-Id: Ibc1169b5458c8dce9d4fe9ce715f49c396e17b86
Fixes: QTBUG-71751
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-12 22:16:26 +01:00
Alexandru Croitor
0d177053b9 Regenerate projects one last time before merge
Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-12 17:30:49 +00:00
Jan Arve Sæther
5e83a2eed2 Deprecate one overload of QInputDialog::getDouble() for 5.15
...and merge the two overloads of getDouble() in Qt6

Change-Id: I55faa2ff222b41e48889a0ef14dd00a6da691c36
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-12 16:10:24 +01:00
Eskil Abrahamsen Blomfeldt
04b50ed011 Remove work-around from thaiWithZWJ test
We added a work-around to disable the test when the Waree Book
font was not available, but this also excludes perfectly valid
versions of the font, so it is a bit unfortunate.

Change-Id: Ibeeff78d87acc384c1aa1b01e988edd524c60575
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-12 06:33:54 +00:00
Qt Forward Merge Bot
9a5df00a61 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8caee4d1ce0eed27d905194df3c3d46c5d07d2b0
2020-02-12 01:00:50 +01:00
Volker Hilsheimer
4e796e0b0d Stabilize QFileSystemModel::dirsBeforeFiles test
Make the test operate in its own temporary directory, so that entries
left behind by other test functions don't impact this test.

Also, call QFileSystemModel::sort explicitly; it would otherwise only
be done once through a single-shot timer, and the test processes events
until the model is populated, which might not process that delayed
sorting. Since dirsBeforeFiles tests the sorting algorithm and not
the sorting logic, best to do this explicitly.

In case of sort failure, print diagnostics.

Change-Id: I44c2b82ef1330cc8787aed2b5cbf109ef3a67876
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fixes: QTBUG-75452
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-11 17:27:41 +01:00
Alexander Akulich
c08b0cec2f QLocalSocket: Deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QLocalSocket::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I579c07564f5c470cf2867864755e0a26e6afce3b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-11 16:54:59 +03:00
Alexander Akulich
c034f92fc2 Revert "QLocalSocket - deprecate ambiguous 'error' overloads"
This reverts commit 0de6c26ac1.

The patch fixes ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commit to keep the getter as is and change the signal name instead.

Change-Id: I67dbb5cada25da473bdd02e71b1e2d9bd03f039e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-11 16:54:33 +03:00
Vitaly Fanaskov
11dc7b35c8 QComboBox: deprecate currentIndexChanged(const QString&)
Task-number: QTBUG-81845
Change-Id: Ia0ff5321423a5d3d4853bd425dd7236926f16047
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-02-11 10:37:10 +01:00
Alexandru Croitor
f1ae5ae726 Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev" 2020-02-11 10:19:42 +01:00
Alexandru Croitor
3af9d49bb7 Merge remote-tracking branch 'origin/wip/cmake' into dev
Change-Id: If75ae006db6eb977cf66af4c3d36cb5c8098a1f1
2020-02-10 18:35:07 +01:00
Vitaly Fanaskov
e59094cb86 QSpinBox: remove deprecated signal valueChanged(const QString &)
Task-number: QTBUG-81845
Change-Id: I91148cac553f63b44968337ccc121e7376ee4465
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-02-10 18:28:47 +01:00
Vitaly Fanaskov
9cc8949cc6 QComboBox: remove deprecated signals
The following signals have been removed:
- void activated(const QString &);
- void highlighted(const QString &);

Task-number: QTBUG-81845
Change-Id: I61b552d9258987d4252202953aaf4909f9bd718e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-02-10 18:28:45 +01:00
Vitaly Fanaskov
f19fbbdb2f QVector: implement methods for adding new elements constructed in place
Fixes: QTBUG-80293
Change-Id: I687dc05a9ad2bad7bab3dc2b1173edf75550d57e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-10 18:28:43 +01:00
Kai Koehne
e541a3f099 QTranslator: Expose language of translation file
This allows for instance to show the current UI language in the UI,
or to load additional translations that match the .qm file by other
means.

This is especially useful in the case of QTranslator::load(QLocale(),
...), in which case different language and country combinations might
be tried.

Another option is to inspect the file name via QTranslator::filePath();
however, this is more error-prone, and might also miss information
(if the .qm file name doesn't have a country suffix, or no suffix at
all).

Change-Id: I6f565d53d8f50e21241ccae6c4de264747ac8f81
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:14:55 +00:00
Kai Koehne
dce61f0450 QTranslator: Expose origin file of the translation
Task-number: QTBUG-36608
Change-Id: I8ef0968404370b8fc25dc8b4c1e2c9e4484ae55c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:14:48 +00:00
Tor Arne Vestbø
4777c6d76b testlib: Improve error message when detecting line count mismatch
Change-Id: I0e19b4c0dd7aa77063e02e6aac7e345dd7c8a5f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-10 15:06:14 +01:00
Dmitriy Purgin
9557715016 std::chrono overload added to QStateMachine::postDelayedEvent()
Some Qt classes already accept std::chrono durations in their methods
(see, for example, QTimer). The proposed change adds an overload
with std::chrono::milliseconds to QStateMachine::postDelayedEvent().

Change-Id: I360fd2bb54fedc7415e9ec17e096095be3604d41
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2020-02-10 15:04:39 +01:00
Marc Mutz
6b9a1824a4 Extend tst_qstringapisymmetry for member compare()
There were a few surprises:

- QByteArray::compare() are missing noexcept (will add)
- ibid., called with non-ascii content and CaseInsensitive fails
  (this was discussed on the ML, with tentative agreement that
  it's a feature, not a bug; waiting for QUtf8String(View) for a
  fix, then).
- As was the case when we did this exercise with the relational
  operators, QString(Ref)/QChar is not noexcept (will fix)

These have been QEXPECT_FAIL'ed.

Not much of the cartesian product is implemented at all, yet.  These
have been #ifdef'ed with NOT_YET_IMPLEMENTED to see what's still
missing.

Change-Id: I7d9b21e292b98f980aacdc6248e88188f7472ba2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-09 17:43:20 +00:00
Tor Arne Vestbø
dfaa61482c Blacklist tst_QGuiApplication::quitOnLastWindowClosedMulti on macOS in CI
Change-Id: I55cb9a6b3aebac68fb1b20127ba7aa501b4a3f2b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-08 14:01:11 +01:00
Qt Forward Merge Bot
9634055543 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I5d80d84d1fd9f52e7c8e4895cc34d4d29043f400
2020-02-08 01:00:08 +01:00
Ulf Hermann
f64694647a moc: Extend revision markers to allow for major and minor version
As we want Qt's own revisions to follow the Qt versioning scheme, we
need to allow for the minor version to reset to 0 now. In order to
facilitate this, we interpret the argument passed the current Q_REVISION
macro as major version and allow for an optional minor version. Both are
encoded it into the resulting revision number.

Change-Id: I3519fe20233d473f34a24ec9589d045cdd162a12
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-07 21:23:55 +01:00
Jarek Kobus
e14e5e104d Replace the QMatrix field of QTransform with qreal[3][3]
Remove temporarily the reference returned by QTransform::toAffine()
since we don't keep the QMatrix object internally anymore.
This is done in order to compile the rest of the code.
The follow-up patch is going to remove that method completely.

Task-number: QTBUG-81628
Change-Id: If7140eedb7582d81ac8da529017cf792174e86ab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-07 20:05:41 +01:00
Alexandru Croitor
1c571e5fe7 Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev" 2020-02-07 18:19:51 +00:00
Ulf Hermann
2145cdc54d Core: Provide comparison functions for QTypeRevision
The unspecified segment is between 0 and 1. This is because
QTypeRevision::zero(), as the default revisision needs to be smaller
than any other. At the same time we want explicitly specified non-zero
revisions to be larger than unspecified ones. Breaking this down on a
per segment level gives us the order shown here.

Change-Id: I1cca12f1180eb6f77563fb5b22c3400e118dc5e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-07 19:19:50 +01:00
Volker Hilsheimer
e79979ba40 On Windows 7, fall back to SHFileOperation to avoid confirmation dialogs
Moving a file to the trash should preferably done via IFileOperation.
However, the implementation on Windows 7 ignores the operation flags
that request the shell not to show any confirmation dialogs or other UI
elements.

SHFileOperation is an old API that doesn't show any UI, but has the
limitation that it doesn't report the location of the file in the trash
after the move. So an application cannot restore the file, but the user
can do so via Explorer.

Overall, the better compromise is to not have dialogs at the expense of
not being able to report the new path. This allows us to run the unit
test on Windows 7 as well.

Change-Id: Ib8e651a69e2c6750f668b52d2a70925d156cc8ae
Fixes: QTBUG-81927
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-07 12:21:13 +01:00
Timur Pocheptsov
4c4b5a97c3 Skip test cases that is failing on macOS >= 10.14
bind on port 1/82 is now success, in QTcpSocket's test things are more
broken: changing the test row makes the test flaky with port not available
due to the previous test case.

Task-number: QTBUG-81905
Change-Id: Iaf1b5457fa3961a4f6bc92b79aa4668a8359136e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-07 08:54:11 +01:00
Volker Hilsheimer
5c520f4b0a Discover the conditions under which registerTimer is flaky, and skip
On macOS, the registerTimer test case fails frequently, and blocks
valid integrations. With this change we try to detect the condition
and skip the test.

Change-Id: Id2065f606abfd431971becf63034a4c1f0fdb9e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-07 04:51:16 +01:00
Wang Chuan
75285b64ad QComboBox: send font change event to popup menu when font changed
The font change in QComboBox might cause incorrect appearance of popup
menu since it doesn't notify popup menu to relayout itself

Fixes the issue by send font change event to the item view of popup
menu when received a font change event in QComboBox

Fixes: QTBUG-75846
Change-Id: I4821015cca95a7e233a22262596a6fbf27f10aef
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-02-07 09:18:47 +08:00
Tor Arne Vestbø
8237e39f5d testlib: Move subtest argument handling to individual tests
The test orchestrator shouldn't have to deal with the individual options
needed for each test.

Change-Id: I78bbf4850cc649e625bd08a7aedf02267ba1314d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-06 23:43:05 +01:00
Tor Arne Vestbø
dbdb3cbc90 Reduce scope of testlib selftest regular expressions
Change-Id: I2fd7a39684bde44d82c4d877086f606413d68520
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-06 23:43:04 +01:00
Tor Arne Vestbø
a2832c577f Remove tst prefix for testlib selftests
These tests are apparently not run at the moment, otherwise they would
have failed to even start, but they should definitely not have the tst
prefix.

Change-Id: Iafcec2764ebb3570e6bc6ebfba27d92a94639893
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-06 23:43:02 +01:00
Friedemann Kleint
e9efd96e62 uic/Python: Add imports for Q(Date)Time, QKeySequence
Those types are used as properties of Q(Date)TimeEdit,
QKeySequenceEdit.

Fixes: PYSIDE-1215
Change-Id: I8b9ffebb8229fff447aa7dd6bee6e037d708333c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-02-06 17:46:21 +01:00
Edward Welbourne
26f6aa3e50 Configure the MS-Win long time format rather than assuming we know it
In tst_QLocale::windowsDefaultLocale(), we configure the long and
short date formats and the short time format eccentrically, then
verify that QLocale::system() does actually get these eccentric
formats. However, we did not configure the long time format (whose
MS-API name doesn't match that of the other formats), so had to rely
on a guess at the system locale's format. That, however, is not
robust; so now configure the long time format, too.

Removed a duplicated test, at the same time.

Fixes: QTBUG-36306
Change-Id: I04dc22c7eb1b58af55412b598873868f79e9c74f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-06 12:56:58 +01:00
Qt Forward Merge Bot
d37f58e75b Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-06 11:38:18 +01:00
Qt Forward Merge Bot
8ce0ad805d Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/network/ssl/qsslsocket_openssl_symbols.cpp

Change-Id: I8c13b5c48a8ecce96540b39c6d5f8ca146eb2339
2020-02-06 11:10:34 +01:00
Jan Arve Sæther
8c6c4df3e8 Maintain at least 500ms timestamp distance between each test function
If we had one test function that just did

tst_Mouse::f1()
{
    QTest::mouseMove(w, QPoint(0,0));
}

and another test function that did

tst_Mouse::f2()
{
    QTest::mouseMove(w, QPoint(500,500));
}

their corresponding event timestamps were only 1 apart from each other.
This meant that any code that tried to estimate the velocity of a mouse
cursor would get a really high velocity estimate inside f2(). This would
come as a surprise to most people. So to avoid this, we add a 500 ms
timestamp delay between each test function call.

In theory this could also prevent generating a mouseDoubleClickEvent
when a pair of test functions containing a press-release sequence was
run, but there is a separate pre-existing mechanism to handle that case.

Change-Id: Icd4fc35853c09f080466d22411208c7b5c4174b5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-06 09:31:47 +01:00
Volker Hilsheimer
74a2467edd Add QFile::moveToTrash, which moves a file to the trash
Due to the nature of QFile just operating on a file path, this also
works for paths that are actually directories.

The test covers files from different locations on which this
operation should typically succeed, but tries to handle the case
where trashing files will fail because of the file system
structure.

On Windows 7, running the test will open a confirmation dialog as
the implementation of IFileOperation doesn't respect the various
flags. This might depend on the specific Windows 7 patch level,
and the option to always use SHFileOperation on that platform needs
to be evaluated further.

[ChangeLog][QtCore][QFile] Introduce QFile::moveToTrash to allow
applications to move files to the trash.

Change-Id: I45019040c25b30f7db293b6933c63aca2f319514
Fixes: QTBUG-47703
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-05 20:21:45 +01:00
Morten Johan Sørvig
d29aaf598a tst_qnetworkreply: Print proxy warning to stderr instead of stdout
This way we produce valid xml also for the no-proxy case.

Change-Id: I5a277255d22c3814fe463c0cd013c04ddc6ad919
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-02-05 15:01:10 +00:00
VaL Doroshchuk
9ecc595d71 widgets: Don't create winId when the widget is being destroyed
When QWidget is being destroyed, its winId is cleared, and
a QEvent::WinIdChange is sent. If a listener of this event
reacted by calling winId() again, we might crash.

A crash can be observed when this child widget is destroyed in dtor of its parent.
E.g. here is a hierarchy of widgets:
1:QWidget
 2:QObject
 3:QWidget
  4:QWidget

If a listener subscribed for WinIdChange events from (4),
and there is a connection to destroy (4) when (2) is destroyed.

This will lead to infinite loop:

1. QWidget::~QWidget
2. QWidget::destroy
3. QWidgetPrivate::setWinId(0)
4. QCoreApplication::sendEvent(q, QEvent::WinIdChange);
5. eventFilter
6. QWidget::winId
7. QWidgetPrivate::createWinId (this=0x555555957600) at kernel/qwidget.cpp:2380
8. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387
9. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163
10. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387
11. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163
12. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387

Fixes: QTBUG-81849
Change-Id: Ib4c33ac97d9a79c701431ae107bddfb22720ba0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-05 11:05:24 +01:00
Friedemann Kleint
6baed76654 uic/Python: Set form object name correctly
Add missing "not" for the isEmpty() check.

Fixes: PYSIDE-1210
Change-Id: I3798d483df9d077300ff69dc5d3a8d08812f534e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-02-05 10:37:02 +01:00
Edward Welbourne
41b2c477b7 Take care of NULL data from QStringView in QCollator
Back-ends need to catch NULL data so as not to call system APIs with
invalid pointers.

[ChangeLog][QtCore][QCollator] Fixed a regression introduced in 5.14.0
that caused QCollator not to operate with default-constructed QStrings
and print a warning on Windows.

Fixes: QTBUG-81673
Change-Id: I2eafe1e188b436afcca3cf2ecdf98bba707c44c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-05 10:23:43 +01:00
Alexandru Croitor
5a985f020d Regenerate rest of qtbase
Change-Id: I3a1ce255d26522d8ad6694c5b0daaa53fb694de3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-04 18:50:48 +00:00
Johan Klokkhammer Helsing
fcaa7506ba Move QOpenGLTextureBlitter from QtGui to QtOpenGL
Task-number: QTBUG-74409
Change-Id: Ie4a3dfd01ba44715de6da71c4420fe9a95a0c242
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-04 18:02:41 +01:00
Volker Hilsheimer
336b3bb0dd Address failing test case for internal implementation of moveToTrash
This ammends 601ce9e08a, which added
a new test case for the internal Qt APIs. The test was not
getting executed by coin as it wasn't included in the io.pro file,
and trying to fix that generates link errors on Windows, since these
internal APIs depend on other internal APIs.

Short of bootstrapping much of QtCore into this test case, the only
sensible option is to remove this test case again, and cover the
testing when the public API is added in a follow up commit.

At the same time, address those failures that were discovered
on platforms that could build the test, and fix compilation on
iOS platforms in Coin.

Change-Id: Id31b43c9df9f205476c48bccb6b87c7a53ed15c5
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-04 11:58:56 +01:00
Qt Forward Merge Bot
97417e8f28 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	examples/widgets/widgets/imageviewer/imageviewer.cpp
	src/corelib/text/qchar.cpp
	src/corelib/time/qdatetime.cpp

Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
2020-02-04 10:44:00 +01:00
Lars Knoll
c6e1b54f94 Cleanup code where we mixed QHash and QMultiHash iterator code
Change-Id: Ib229cad13ca21d6288e009c6ee1c39fa974f80b8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-03 17:43:30 +01:00
Lars Knoll
4681f1fc2c Separate streaming of QHash and QMultiHash/QMap and QMultiMap
Those classes will not have relations anymore in Qt6, so they need
separate streaming operators. Writing of multi maps/hashes requires some
additional care so that restoring keeps the order of how iteme have been
inserted.

Change-Id: If41d0c5c24962764a2cb81bd2de9e2fadf1a2b63
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-03 17:43:30 +01:00
Alexandru Croitor
4e7af2061e Merge remote-tracking branch 'origin/wip/cmake' into dev
This pulls the CMake port, which not only adds CMake files but also
modifies existing code. A brief summary of "seemingly unrelated" changes:

    * configure.json was re-formatted to not use multi-line strings. That
      is an extension of the Qt JSON parser but not JSON compliant, which
      is needed for the configure.json-to-cmake conversion script (python).
    * Some moc inclusions were added due to CMake's slightly different way
      of handling moc. With the changes the files build with qmake and cmake.
    * Since CMake just grep's for the Q_OBJECT macro to determine whether to
      call moc (instead of doing pre-processing like qmake), the existing use
      of "Q_OBJECT" in our documentation was changed to \Q_OBJECT, which cmake
      doesn't see and which is now a qdoc macro.
    * QTestLib's qFindTestData was extended to also search in the source
      directory known at build time.

What this change also brings is a new way of building modules in Coin by using
YAML configuration files that describe the steps of building and testing in Coin
specific terms. The platform configuration files in qt5 are instructed to use the
old Coin built-in way of testing ("UseLegacyInstructions" feature) but for any
configurations that do not have this, these yaml files in the coin/ sub-directory
are used and shared across repositories.

Change-Id: I1d832c3400e8d6945ad787024ba60e7440225c08
2020-02-03 15:01:53 +00:00
Edward Welbourne
71fa90a37c Enable system locale to skip digit-grouping if configured to do so
On macOS it's possible to configure the system locale to not do digit
grouping (separating "thousands", in most western locales); it then
returns an empty string when asked for the grouping character, which
QLocale's system-configuration then ignored, falling back on using the
base UI locale's grouping separator. This could lead to the same
separator being used for decimal and grouping, which should never
happen, least of all when configured to not group at all.

In order to notice when this happens, query() must take care to return
an empty QString (as a QVariant, which is then non-null) when it *has*
a value for the locale property, and that value is empty, as opposed
to a null QVariant when it doesn't find a configured value. The caller
can then distinguish the two cases.

Furthermore, the group and decimal separators need to be distinct, so
we need to take care to avoid cases where the system overrides one
with what the CLDR has given for the other and doesn't over-ride that
other.

Only presently implemented for macOS and MS-Win, since the (other)
Unix implementation of the system locale returns single QChar values
for the numeric tokens - see QTBUG-69324, QTBUG-81053.

Fixes: QTBUG-80459
Change-Id: Ic3fbb0fb86e974604a60781378b09abc13bab15d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-02-03 15:34:02 +01:00
Giuseppe D'Angelo
2d265dce58 Markdown importer: properly set hyperlinks
The "title" in markdown is the tooltip, not the name attribute of
a link. Also, tell the char format that it's an anchor.

Change-Id: I2978848ec6705fe16376d6fe17f31007cce4b801
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-03 14:58:06 +01:00
Tor Arne Vestbø
27db9e458c testlib: Clarify that our XUnit reporter is actually a JUnit reporter
The reporter was probably named 'xunit' based on the historical use of
xUnit to refer to testing frameworks derived from Smalltalk's SUnit.
These frameworks typically added their own prefix, e.g. JUnit for Java,
RUnit for R, etc.

The most popular of these was the JUnit framework, and the corresponding
XML output produced by the Ant built tool became somewhat of a de facto
standard, which is probably why we chose to model our reporter after it.

Nowadays however, naming it 'xunit' is problematic as there is actually
a testing famework named xUnit.net, typically shortened to, you guessed
it: xunit.

Test report consumers will typically have a junit mode, and an xunit
mode, and the latter could easily be mistaken for what testlib outputs,
unless we clarify this.

The clarification also allows us to safely extend our support for the
JUnit XML format to incorporate some elements that are nowadays common,
but where we are lagging behind the standard.

[ChangeLog][QTestLib] The formerly named 'xunitxml' test reporter has
been renamed to what it actually is: a JUnit test reporter, and is now
triggered by passing -o junitxml to the test binary.

Change-Id: Ieb20d3d2b5905c74e55b98174948cc70870c0ef9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-03 13:48:25 +01:00
Vitaly Fanaskov
0b325602b1 QButtonGroup: remove deprecated signals
Task-number: QTBUG-80906
Change-Id: I6f697b0a070ba4c401117fe7cdf02429b47d9a11
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-02-02 02:05:49 +01:00
Vitaly Fanaskov
dd42e5d5e7 QSignalMapper: deprecate overridden signals
Task-number: QTBUG-80906
Change-Id: I9beab78d8fe8dfc712969f65792f50360a890287
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-02-01 21:23:44 +01:00
Kari Oikarinen
89f443dfbc QScopeGuard: Fix build failures with qScopeGuard()
Partially reverts 4f077b7e5f.

Can't overload with forwarding references and lvalue references. Use a single
forwarding reference overload, but take care of not trying to create a
QScopeGuard of reference type and forward instead of moving.

Add tests to ensure calling with both lvalues and rvalues is possible.

Change-Id: Ia034afe0a8feb08246c2c7c154a85cae37421c98
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 11:07:08 +02:00
Tor Arne Vestbø
828e14b5f9 Fix unused argument warning in test
Change-Id: I9f55efee82f8d855d89977b3e4db32855e110c87
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-01 00:49:11 +01:00
Sze Howe Koh
e6f479a830 tst_QDataStream::readQCursor(): Replace deprecated QCursor API
Task-number: QTBUG-48701
Change-Id: I4205d278b1cd6b088f8f58020f6a5e49a7f1ca33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-01 07:31:02 +08:00
Allan Sandfeld Jensen
967e55a628 Allow creating a valid QColorSpace one value at a time
The change to using setters left a quirk from the previous un-mutable
design where you couldn't set values on an invalid color space and
create a valid one.

This changes that so it works as expected for an imperative API, but
is also needed for the declarative QML bindings.

Change-Id: I246cfc38b364b156238151c42c1df82a3f1cc9d3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-01 00:31:01 +01:00
Allan Sandfeld Jensen
c76dd72dc6 Add a constructor for QRunnable from anonymous functions
This makes it easier to create one without having to create
a derivative class. The patch also adds a path to avoid using
QRunnable directly in QThreadPool.

Change-Id: I9caa7dabb6f641b547d4771c863aa6ab7f01b704
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
d6d98f782a Deprecate locale-related DateFormat enum members
Qt 6 shall remove all locale-dependence from Q(Date|Time)+.

Task-number: QTBUG-80441
Change-Id: Iebaaa2bd776bccfe0d73c15f36cbdd456b71ca59
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-31 19:20:43 +01:00
Edward Welbourne
b4b3b5c694 Clarify handling of unspecified year in two QCalendar methods
[ChangeLog][QtCore] QCalendar::monthsInYear(QCalendar::Unspecified)
now returns maximumMonthsInYear(). QCalendar::daysInYear() now makes
clear that its handling of unspecified year is undefined.

Change-Id: Ifef8723193868c666f6afeb7f190af4929d30dea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-31 12:26:34 +01:00
Alexandru Croitor
43d2b60a29 Post-merge fixes
Change-Id: I6acd29103f6cc550544e7422328d97ea0e2dcafb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 20:45:08 +00:00
Edward Welbourne
037369cc4d Deprecate QDateTime(const QDate &) in favor of QDate::startOfDay()
It needed re-implemented in terms of the new API (in case QTime(0, 0)
was skipped, on the date in question, by a spring-forwrd), which makes
it redundant (and supports choice of spec and zone or offset, which it
did not).

Change-Id: I1e3c3e794632c234f254be754ed6e4ebdaaaa6bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-01-30 19:56:21 +01:00
Edward Welbourne
264ed73052 Move old tst_QLocale::negativeZero() to tst_QString::number()
It was more complex than it needed to be and was a test of QString,
not of QLocale. This leaves tst_QLocale::negativeZero() available to
now test how QLocale handles negative zero.

Change-Id: Ic9aae250c29f579e6d60fba8404b38673a3b489f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-30 17:57:40 +01:00
Edward Welbourne
d5bb8d5150 Preserve the case of the exponent separator CLDR supplies
We have long (since 4.5.1) coerced it to lower-case, for no readily
apparent, much less documented, reason. CLDR says most locales use an
upper-case E for this - let's actually use what CLDR says we should
use.

The code that matches the exponent separator was doing so
case-insensitively in any case; that needed adaptation now that the
separator's case isn't pre-determined; and, in any case, should have
been done using case-folding rather than upper-casing. In the process,
removed some spurious checks for "'e' or 'E'" in the result, since the
exponent separator is always represented by 'e' (and an 'e' might also
be present for the separate reason of its use as a beyond-decimal
digit representing fourteen).

[ChangeLog][QtCore][QLocale] QLocale::exponential() now preserves the
case of the CLDR source, where previously it was lower-cased.

Change-Id: Ic9ac02136cff79cb9f136d72141b5dbf54d9e0a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-30 17:56:14 +01:00
Morten Johan Sørvig
17affdfbcb Blacklist failing tests on macOS 10.14
These tests fail locally, and have been reported to
fail on the CI system.

Change-Id: Ia76bb15c288af4171ebe47b3c30f3651a63df3f2
Task-number: QTBUG-75786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-30 13:47:27 +00:00
Ulf Hermann
ed080c64ae Core: Add a QTypeRevision class
QTypeRevision is needed to encode the value of the new two-argument
Q_REVISION(major, minor) macros. Those, in turn are necessary because
the minor version resets to 0, and we need to take the major version
into account when stating revisions for Qt classes.

Task-number: QTBUG-71278
Change-Id: I63eff6eab7d6e4f8f32b359a216767c98947a106
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-01-30 10:20:53 +01:00
Lars Knoll
daf1f3f9ce Fix a few test cases to not rely on QMultiHash only API for QHash
Change-Id: If4a741adec6f93d14bd5b21baa1dd062b49898ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:29:39 +01:00
Lars Knoll
8020a52793 Adjust QVariant autotest to prepare for upcoming QHash changes
QHash won't contain an insertMulti() method anymore.

Change-Id: I507e76d496c3a33a6e88d15aa30df06c07eeba9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:29:31 +01:00
Lars Knoll
1b3075dfcb Split QHash and QMultiHash in auto test
Change-Id: I0f31feaca740abe33f36a8c117d64447ddcc8043
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:29:25 +01:00
Lars Knoll
d5669a4854 Fix tests in QHash that would read beyond end()
A couple of tests in the QHash autotest could iterate beyond
end(), leading to undefined behavior. This is bound to crash
with the new upcoming QHash implementation.

Change-Id: I977fc939e6e472f05b7cb2fa0a79c2d5f8782f45
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:29:12 +01:00
Lars Knoll
dca3d467a7 Don't enforce C++11
We require C++17 in Qt6

Change-Id: I2dde485524208a1c7131869f4267f44ad2b32e9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:29:08 +01:00
Lars Knoll
c0d2deac8b Remove deprecated functionality from QSet
Remove support for reverse iteration over a QSet.

Change-Id: I1e9c986a118aea4ebeb7fcdceb41e9ce6593cdb6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 08:28:51 +00:00
Lars Knoll
e41d243789 Adjust autotest to coming QHash changes
QHash and QMultiHash are separate classes in the future, and
the iterator is not random access.

Change-Id: I7e1a4162ca964001c8da81a2fd7c41ccae27bdb3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:28:46 +01:00
Lars Knoll
866174307a Some fixes to collection autotest
Split QHash and QMultiHash, and get rid of some compiler warnings.

Change-Id: I48991f097f408ad5c1aa349443e26ab816e0b736
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:28:42 +01:00
Lars Knoll
f98a20a690 Prepare for separating QHash and QMultiHash
Prepare the test cases so that QHash and QMultiHash are used
as if they were fully independent classes.

Change-Id: Iaf5d65c8f6321ec2edaef490e657b144619655a0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 09:28:18 +01:00
Kari Oikarinen
4f077b7e5f QScopeGuard: Make constructor public
With Class Template Argument Deduction users might want to use the constructor
itself instead of a separate helper function. In both cases it's possible to let
the compiler deduce the template arguments.

Try to make the usefulness of the helper function in the absence of CTAD still
clear in the documentation.

Change-Id: I9b07983c1fb276a6dd9e7ed4c3e606764e9b68ca
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-01-30 07:30:17 +02:00
Volker Hilsheimer
601ce9e08a Implement moving of a single file system entry to the trash
This implements the operation for Windows, macOS, and Unix, for now
only as a private API (since QFileSystemEngine is private). This adds
the capability as a testable function; public API to be agreed on and
added in a separate commit.

The Unix implementation follows the freedesktop.org specification [1]
version 1.0.

[1] https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html

On macOS and Windows, native APIs are used, with each having some
limitations:

* on macOS, the file in the trash won't have a "put back" option,
  as we don't use Finder automation, for the reasons provided in the
  comments
* on Windows, we might not be able to use the modern IFileOperation
  API, e.g. if Qt is built with mingw which doesn't seem to provide
  the interface definition; the fallback doesn't provide access to
  the file name in the trash

The test case creates files and directories, and moves them to the
trash. As part of the cleanup routine, it deletes all file system
entries created. If run on Windows without IFileOperations support,
this will add a file in the trash for each test run, filling up
hard drive space.

Task-number: QTBUG-47703
Change-Id: I5f5f4e578be2f45d7da84f70a03acbe1a12a1231
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-01-30 06:14:56 +01:00
Mårten Nordheim
7321a2c624 QNetworkAccessManager: deprecate bearer related functions
In Qt6 QNAM will no longer use bearer in any way so we deprecate it now.

Also mark bearermanagement-conditioned sections for removal in Qt6,
the _q_networksession property is part of how QNAM passes the
QNetworkSession around.

Task-number: QTBUG-81609
Change-Id: I04aad9dd96482c6822dffba1b9af7aa58961149c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-30 05:29:35 +01:00
Giuseppe D'Angelo
78edc18057 QGraphicsProxyWidget: fix handling of proxy focus
If a widget inside a QGPW has a proxy focus, the code would keep
sending focus in events to the proxy even if the proxy was already
focused. Amend the check in place to prevent this from happening.

Change-Id: Id28d3bfe4f396da5c9477df713441ca7d506662f
Fixes: QTBUG-51856
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-29 19:57:02 +01:00
Alexandru Croitor
a1dbdcbd6e Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        src/corelib/Qt5CoreConfigExtras.cmake.in
        src/corelib/Qt5CoreMacros.cmake
        src/dbus/Qt5DBusConfigExtras.cmake.in
        src/widgets/Qt5WidgetsConfigExtras.cmake.in

Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
2020-01-29 16:57:27 +01:00
Qt Forward Merge Bot
6f44c40f18 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-29 01:01:12 +01:00
Qt Forward Merge Bot
a3fc03c130 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I98b1a5a11ece3957a1115c1d9be8841759206ffe
2020-01-29 01:00:56 +01:00
Volker Hilsheimer
6e1d70ae12 QPushButton: only trigger button when click occurs within the bevel rect
On the mac, the push button's bevel doesn't cover the entire widget
rectangle, but is smaller to leave space for focus frame, shadow, and
in general to meet style guidelines. Without this change, a click
anywhere inside the widget would activate the button.

QAbstractButton::hitButton can be reimplemented to limit the area in
which the button is triggered. However, getting the rectangle also
requires an addition to QStyle, so that we can query
QStyle::subElementRect for the actual area the button's bevel covers.

As a side effect, tests that use QPushButton and assume that it
responds to clicks at position 0,0 have to be fixed so that they
don't fail on mac.

Change-Id: I01b60a763bccf39090aee5b2369af300f922d226
Fixes: QTBUG-81452
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-28 22:26:26 +01:00
Simon Hausmann
a4ea0d9eac Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia5727ce68001bcaab467f5fae3a4933d1217015f
2020-01-28 18:27:28 +01:00
Qt Forward Merge Bot
6c3eb39832 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-28 16:02:04 +01:00
Qt Forward Merge Bot
ef442327b8 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-28 14:17:01 +00:00
Qt Forward Merge Bot
558fc903ac Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qvariant.cpp
	src/corelib/serialization/qjsoncbor.cpp
	src/corelib/serialization/qjsonvalue.cpp
	src/corelib/tools/tools.pri
	src/gui/image/qimage.cpp
	src/gui/kernel/qguivariant.cpp
	src/widgets/kernel/qshortcut.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json
	tests/auto/tools/moc/tst_moc.cpp
        src/opengl/qglframebufferobject.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Leander Beernaert <leander.beernaert@qt.io>
Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
2020-01-28 14:14:20 +00:00
Vitaly Fanaskov
07a576cc61 QProcess: remove deprecated signature of finished signal
Task-number: QTBUG-80906
Change-Id: Ic9852bc5031d357d23ff6c13a65d020a4b6ea3d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-01-28 12:34:06 +01:00
Liang Qi
54b1f1d199 Merge remote-tracking branch 'origin/5.14.1' into 5.14
Conflicts:
	mkspecs/features/create_cmake.prf

Done-With: Artem Pisarenko <artem.k.pisarenko@gmail.com>
Change-Id: I2ecb9fdca06fe687be8ab3457a58dd81e5e81c4c
2020-01-28 09:16:11 +01:00
Qt Forward Merge Bot
082faeff9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/image/qpnghandler.cpp

Change-Id: I8630f363457bb613d8fb88470a71d95d97cdb301
2020-01-28 08:09:51 +01:00
Christian Ehrlicher
b0c804f345 QComboBox: unify behavior of setModel() and modelReset
When a new model is set, a valid index is selected. When a model is
reset, this is not the case which is slightly inconsistent. Fix it by
using the same logic to find a valid index when the model is reset

Fixes: QTBUG-80998
Change-Id: I6c167511e199a6664343cf1dc3bcd27c65389bfd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-28 06:24:26 +01:00
Jarek Kobus
4bb897a384 Deprecate all methods that use QMatrix
Don't use QMatrix in implementation classes anymore.

Task-number: QTBUG-46653
Fixes: QTBUG-81627
Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-28 04:12:25 +01:00
Michal Klocek
a3ff42ade6 Relax rules about not having dbus session
Some desktops do not run dbus session and still want to build qt.

Change-Id: I898a3c25c9b47c1a953e426873280ab9e160c669
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-27 13:09:40 +00:00
Andy Shaw
bb42b7d8b2 Make sure the focus is passed on correctly when back-tabbing
When the tested widget has a focus proxy, then we should check if the
current focus widget is not the same as that focus proxy before setting
it to be the widget that gets focus. This ensures that when back-tabbing
from a widget like QDoubleSpinBox that it will not get stuck inside that
widget and will back-tab to the next correct one.

Fixes: QTBUG-81097
Change-Id: I3f689c7715da7f3ce8c3d2f616041528f5778a2f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-25 08:10:32 +01:00
Christian Ehrlicher
5c3b5efd40 QMenu: don't crash when another popup is closed when a popup is closed
When closing a popup (submenu) triggers closing another popup (the menu)
programatically it can happen that QApplicationPrivate::popupWidgets is
destroyed. Therefore we have to check if popupWidgets is still valid
after the focus change event was delivered.

Fixes: QTBUG-81222
Change-Id: Ide3a6897e43f389d396a80d8b158f7c8eb04e3aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-25 08:10:27 +01:00
Leander Beernaert
48c82e90af Post Merge Fixes
Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-24 12:29:18 +00:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Johan Klokkhammer Helsing
2344e5cc31 Move QOpenGLTexture and related classes from QtGui to QtOpenGL
Task-number: QTBUG-74409
Change-Id: Ied825dd7cb92365505a4aa43fd67488024160341
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-01-24 08:57:38 +01:00
Giuseppe D'Angelo
4d8a515a23 QXmlStreamReader: early return in case of malformed attributes
There's no point at keep raising errors after encountering the
first malformed attribute.

Change-Id: Idb37e577ea96c3bd850b3caf008fe3ecd57dd32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-23 19:44:09 +01:00
Fabian Kosmale
cb3152086c Introduce Q_PROPERTY attribute REQUIRED
This is meant to correspond to required properties in QML.

Change-Id: I2645981e13f7423bc86b48370c165b3cfe2aaa62
Task-number: QTBUG-81561
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-01-23 16:47:45 +01:00
Samuel Gaist
49f143e19c QSslCertificate: migrate to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

If support for regular expression is disabled, fixed string can
still be used.

[ChangeLog][QtCore][QSslCertificate] Add overload of fromPath that does
not make use of QRegExp and deprecate the QRegExp variant.

Task-number: QTBUG-72587
Change-Id: I507d8941cc7d70166da0948375dc421fe5e7d967
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-23 16:47:31 +01:00
Laszlo Agocs
eecd502ff3 Regenerate qsb files for auto and manual tests
They are now version 4, which is hopefully the final format,
relying on nothing but QDataStream.

Except for the qshader autotest which tests all the 1..4 versions
and so needs appropriate test data.

Also unifies the batch file naming.

Change-Id: Iec478be86d14dbec7ffb9d5f9b62c14fca5d7c9e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-01-22 22:47:04 +01:00
Tor Arne Vestbø
92918e567a Flatten version-specific blacklisting on macOS to all macOS versions
We don't know which versions these blacklistings actually apply on
unless we actually get macOS 10.14 and 10.15 into the CI and running
tests, so let's start with that, and then granularize the blacklists
after that.

Task-number: QTBUG-75786
Change-Id: Id79642afa50cb20efa2cd209286b6933918d3a4a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:58:31 +01:00
Tor Arne Vestbø
c31c5d08d8 Blacklist tstPauseAnimation::noTimerUpdates on macOS
Task-number: QTBUG-75786
Change-Id: I89d81a9d0f5f301f325044dee2395d441c0d5970
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:26:23 +01:00
Tor Arne Vestbø
f047c44e71 Extend blacklisting for a few tests to include all macOS versions
Task-number: QTBUG-75786
Change-Id: I06867de99a19f9e46ac0eeea10a7365a30c49c6d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:26:23 +01:00
Tor Arne Vestbø
14690e9cf1 Blacklist two tst_QScroller tests on macOS
Task-number: QTBUG-75786
Change-Id: I43e0a9a6e28a67f6aa1f2adaecd60ed0d65601d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:26:22 +01:00
Tor Arne Vestbø
751d0ace96 Blacklist tst_QAbstractItemView::task200665_itemEntered on macOS
Task-number: QTBUG-75786
Change-Id: I74720b4015e38c846dbc5c6a93f056f8deb3552a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:26:22 +01:00
Johan Klokkhammer Helsing
f3ecda32e0 Move QOpenGLPaintEngine and related classes from QtGui to QtOpenGL
Also moves the openglwindow test to the opengl folder, as it makes use of these
classes.

Task-number: QTBUG-74409
Change-Id: Id9f0013cedcc8bd1e87122c005641d7298525045
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-22 09:40:59 +01:00
Christian Ehrlicher
477dc11567 QTabBar: fix QStyleOptionTab::position
During 556712f511 a small regression was
introduced which set a wrong value for QStyleOptionTab::position.

Fixes: QTBUG-81393
Change-Id: Ie8c66186b1b79c97bf77c7b139e08840233b7b66
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-22 08:47:57 +01:00
Qt Forward Merge Bot
35a461d026 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I68702c9f9680772d332b5bb777ddd2663168abd5
2020-01-19 01:00:10 +01:00
Mårten Nordheim
cd5ce46dc5 QUdpSocket: Blacklist writeDatagramToNonExistingPeer for msvc2019
Same as other versions of MSVC

Fixes: QTBUG-80328
Change-Id: I05c5ffe6d36e0cdfb781080a736c90b6a6d4b2ba
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-17 22:16:23 +01:00
Qt Forward Merge Bot
c70208c2d0 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-17 08:52:14 +01:00
Vitaly Fanaskov
63b0b857f3 QPalette: fix function swap and move operator
Additional data should also be taken into account when using move
operator and function swap. This is already implemented for move
constructor.

Task-number: QTBUG-78544
Change-Id: I24ba34b0957a8fba7e15a934f2d08222dc95650f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-17 02:22:22 +01:00
Olivier Goffart
983432effd Introduce Q_MOC_INCLUDE
A new macro that can be added in the header file parsed by moc to tell moc
to include that file in the generated file

Change-Id: I03ad702c3fcd8380371015f226ee4b7456daf132
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-17 02:22:22 +01:00
Qt Forward Merge Bot
0a4e5bb265 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/widgets/kernel/qshortcut.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: If76c434beac2c0a393440aa365f89f77439774ce
2020-01-16 11:20:42 +01:00
Leander Beernaert
7c6f763d85 Regenerate Tests
Change-Id: I78f1efbec809610bcf6a8224392fa0dc8dbf3b3b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-16 08:16:17 +00:00
Thiago Macieira
bd828bacb9 QResource: Add API to get the decompressed content
[ChangeLog][QtCore][QResource] Added uncompressedSize() and
uncompressedData(), which will perform any required decompression on the
data, prior to returning (unlike data() and size()).

Change-Id: Ief874765cd7b43798de3fffd15aa053bc505dcb1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-15 12:36:59 -08:00
Kari Oikarinen
4f55c41816 Merge 5.14 into 5.14.1
Change-Id: Ie90edfd16f48e1907fd18288473ac403f62b9032
2020-01-15 19:08:18 +02:00
Johan Klokkhammer Helsing
4772a2da15 Move QOpenGLWindow from QtGui to QtOpenGL
Task-number: QTBUG-74409
Change-Id: If7d27cdfa2c6cd5b167887ad77b9cfe413cb106a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-15 15:38:59 +01:00
Qt Forward Merge Bot
d14fd32d40 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: I3196c5f7b34f2ffc9ef1e690d02d5b9bb3270a74
2020-01-15 10:14:05 +01:00
Fabian Kosmale
a4fb128b73 QSequentialIterableImpl: support append
Task-number: QTBUG-80916
Change-Id: I87e74da0ce454e56b5fe94d9db3693a587d35edf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-15 10:09:00 +01:00
Qt Forward Merge Bot
c3123c757a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
2020-01-15 01:00:39 +01:00
Leander Beernaert
3854b5892b Add QT_TEST_RUNNING_IN_CTEST environment variable for test
When running tests with CMake's CTest, set the environment
QT_TEST_RUNNING_IN_CTEST to 1. This can be useful to deal with tests
that do not properly work when running from CTest.

For instance, the qmake test in this patch has one test that only works
when not run from CTest.

Change-Id: I01eea9131de69c18118a9ed9f96e9296d5ea20f1
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-14 13:24:55 +00:00
Friedemann Kleint
21a14767b3 uic/Python: Fix missing QCursor import
Fixes: PYSIDE-1182
Change-Id: I1ccc524a152ea75508166f3d2c0c60f8d829cd8f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-14 14:17:52 +01:00
Leander Beernaert
ba96b0cbd9 Disable qaccessibilitylinux test
The qaccessibilitylinux does not work properly and is also disabled in
qmake.

Change-Id: I8d047c86c792751f28f296b00421babeb42db778
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-14 13:16:57 +00:00
Laszlo Agocs
052f3db7e6 qshader autotest: Avoid variable shadowing
Nicer this way.

Change-Id: Ia132b8e394f1080623abe4b1452a41c5ca31272c
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2020-01-14 11:37:10 +01:00
Edward Welbourne
e0be3ab28e Combine negativeYear() and printNegativeYear()
They overlapped and the latter had duplicated code, so make them into
a single data-driven test. At the same time, replace the '-' at the
start of the expected string with QLocale::negativeSign(), since the
test fails otherwise when LC_NUMERIC=nb_NO on Linux (Debian/testing).

Change-Id: I051c75abff16b2e6f8278fcb152b6bde14c71f9a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-14 10:47:19 +01:00
Cristián Maureira-Fredes
3f6275960c uic: add customwidget imports support for python
Fixes: QTBUG-81073
Change-Id: I29659481b14927ffcb8f2cb1829b577a67e4b937
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-14 08:11:53 +01:00
Tor Arne Vestbø
d8897e0b08 Clarify blacklisting of tst_QWidget::childEvents on macOS
The test expects a very explicit list of events during show, but on
macOS we also get an InputMethodQuery event as a result of the window
becoming active. The test needs to be written significantly to support
these kind of platform differences.

Change-Id: I395c1e9e4e9baf7d9f88f0d067586fc15afb9a16
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 00:50:04 +01:00
Tor Arne Vestbø
0617afb2d3 Extend blacklisting of tst_QWidget::showMinimizedKeepsFocus to all macOS versions
For some reason the firstChild gets the focus when clearing the focus.
This seems to be timing dependent, as removing the 30ms qWait 'fixes'
the issue. So does a processEvent call before minimzing. Both of these
require further investigation.

Change-Id: I62833a5541712f97dc24bc63384fa4c051096537
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 00:50:03 +01:00
Tor Arne Vestbø
6ae9cc7cb9 Blacklist tests on macOS that rely on moving the cursor
Task-number: QTBUG-76312
Change-Id: Ibb29231141017ed608beaa12255cdd083317433c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 00:50:01 +01:00
Tor Arne Vestbø
e1dbb73701 Blacklist tst_QTableView::mouseWheel on macOS
There's a timing issue that affects the position of the vertical
scrollbar when scrolling by pixels.

Change-Id: I29d73574785be539a5870b498a902b1aba887e9c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 00:50:00 +01:00
Tor Arne Vestbø
3be91a89af Blacklist tst_QStyleSheetStyle::widgetStylePropagation on macOS
It's not clear why this is failing, but we need to blacklist it so that
we can move over to testing macOS 10.14 and 10.15 in the CI.

Task-number: QTBUG-75786
Change-Id: I208d5af92406c5da8d0210e0188568466b78b2a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 00:49:58 +01:00
Tor Arne Vestbø
b7a56ea3ee Skip tst_QMenu::pushButtonPopulateOnAboutToShow on macOS
The combobox popup can overlap a little with the button, and that's the
expected behavior.

Change-Id: I245bfce85cb5ee661ceb51dbe0d844492878a2bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-14 00:15:16 +01:00
Tor Arne Vestbø
eb2a7738a4 Skip instead of fail tests when test server is not available
We were being inconsistent in how we handled this, some tests skipping
while others using QVERIFY. It makes more sense to skip the tests, since
the problem is a missing pre-condition of the test, not the test itself
being bad or exposing real failures in the implementation.

Change-Id: I20eacfe12dbce0b0d926e48cbe2d2772819fa4a5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-14 00:15:16 +01:00
David Faure
123cf74dd0 Update instructions for downloading the shared-mime-info release
s-m-i moved to gitlab.freedesktop.org

Change-Id: Ifc41eecfe27c4fba0132d54234b481ed301a66dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-13 17:44:49 +01:00
Christian Ehrlicher
ac95c8b686 QStandardItem/QStandardItemModel tests: cleanup
Cleanup QStandardItem/QStandardItemModel tests:
 - use nullptr
 - remove unused functions
 - use new signal/slot syntax
 - style

Change-Id: I2feb8550e7f740f9df4b9c1b803c2f250c1ec729
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-13 17:01:00 +01:00
Tor Arne Vestbø
0a93db4d82 Unify application palette handling between QGuiApplication and QApplication
The logic is now mostly handled in QGuiApplication, with QApplication
only dealing with the widget-specific palettes and interaction between
the style and the palette.

The application now picks up changes to the platform theme and will
re-resolve the current application palette appropriately. This also
works even if an explicit application palette has been set, in which
case any missing roles are filled in by the theme.

The palette can now also be reset back to the default application
palette that's fully based on the theme, by passing in the default
constructed palette (or any palette that doesn't have any roles set).
This is also correctly reflected in the Qt::AA_SetPalette attribute.

Conceptually this means QGuiApplication and QApplication follow the
same behavior as QWidget, where the palette falls back to a base or
inherited palette for roles that are not set, in this case the theme.

Behavior-wise this means that the default application palette of the
application does not have any roles set, but clients should not have
relied on this, nor does QWidget rely on that internally.

It also means that setting a palette on the application and then
getting it back again will not produce the same palette as set,
since the palette was resolved against the theme in the meantime.
This is the same behavior as for QWidget, and although it's a
behavior change it's one towards a more sane behavior, so we
accept it.

[ChangeLog] Application palettes are now resolved against the platform's
theme palette, the same way widget palettes are resolved against their
parents, and the application palette. This means the application palette
reflected through QGuiApplication::palette() may not be exactly the same
palette as set via QGuiApplication::setPalette().

Change-Id: I76b99fcd27285e564899548349aa2a5713e5965d
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-13 16:53:05 +01:00
Laszlo Agocs
7e2cef0f15 Move away from CBOR in QShaderDescription serialization
...but keep support for deserializing for all older versions in order to play
nice with existing .qsb files.

The usage of binary JSON and then CBOR is a historical artifact: relying
on the QJsonDocument (which we generate for purposes unrelated to binary
serialization) was a convenient shortcut. However, writing to and
reading from a QDataStream instead (which QShader already does) is trivial.
In order not to be limited by potential CBOR requirements in the future,
take it all into our own hands.

Extend the qshader autotest accordingly.

Task-number: QTBUG-81298
Change-Id: If0047b659bd6601ca47b5bbbce1b719630cde01e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-01-13 16:21:26 +01:00
Timur Pocheptsov
ccb2cb84f5 QNetworkReply: deprecate the 'error' getter
To disambiguate &QNetworkReply::error expression.

[ChangeLog][Deprecation Notice] QNetworkReply::error() (the getter) was deprecated; superseded by networkError().

Task-number: QTBUG-80369
Change-Id: I545f963788bce0800c9e0f0c94d5f1029946effe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-13 15:50:47 +01:00
Qt Forward Merge Bot
cccc9d0b95 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Change-Id: I4d3041fa291a918c774ffa5eb5c8792a0966451d
2020-01-13 10:13:01 +01:00
Rainer Keller
76fbe75abe Remove empty block at beginning of imported markdown
An empty QTextDocument already contains a block; so when the formatting
is fully determined, if the document is still empty, then instead of
inserting a new block, we can set formatting on the cursor, which
affects the pre-existing block, before inserting text.  This avoids
leaving a blank line (the default block) above the inserted content.

Fixes: QTBUG-81060
Change-Id: I14e45e300a602493aa59680417d74d4c2b25862d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-01-13 09:25:39 +01:00
Qt Forward Merge Bot
8d0715f106 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I50f70a789ab1438b40d4408be72c090fa00b801f
2020-01-13 01:00:45 +01:00
Giuseppe D'Angelo
577d698b8e QString::isLower/isUpper: redo the implementation
Use QStringIterator rather than indexed loops. This fixes handling of
non-BMP code points (which may be lower or uppercase, see the test).

Change also the semantics of the functions, adopting Unicode §3.13
definitions: a string is lowercase/uppercase if it's equal to its
own toLower/toUpper folding.

As a side effect, empty strings are now correctly reported to be
lowercase AND uppercase.

[ChangeLog][Important Behavior Changes] The semantics of
QString::isLower() and QString::isUpper() have been changed to match the
Unicode specification. Now lowercase (resp. uppercase) strings are
allowed to contain any character; a string is considered lowercase
(resp. uppercase) if it's equal to its own toLower() (resp. toUpper())
folding.  Previously, a non-letter character would make the string not
lowercase nor uppercase, and the mere presence of an uppercase (resp.
lowercase) letter would make isLower() (resp. isUpper()) return false,
even if the letter wouldn't change under case folding.  As a
consequence, now empty strings are lowercase and uppercase.

[ChangeLog][QtCore][QString] Fixed a number of bugs of
QString::isLower() and QString::isUpper(). Empty strings are now
correctly reported to be lowercase (resp. uppercase), and strings
containing code points outside the BMP are now correctly handled.
Note that the behavior of these functions has also been changed.

Change-Id: Iba1398279a072399a9f21295fe75f6e414f3f813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-11 19:28:50 +01:00
Leander Beernaert
a8929ac1fe Fix qclipboard test
Change-Id: I24ef0a8f73faa83d98d791a30f5777aef9d554cf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-10 14:59:54 +00:00
Leander Beernaert
5e44dc8864 Fix qnetworksession test
Change-Id: I8d549b571dea8c0b275a6c220dd58f1644ebc443
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-10 14:59:50 +00:00
Leander Beernaert
26600a069a Fix tst_qdbusmarshall
Change-Id: Ia7bb50a8c69a0083d0b8acdad0cb8eb6a71ca24e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-10 13:01:21 +00:00
Timur Pocheptsov
76c4c5d558 QSslSocket: deprecate sslErrors() getter
To disambiguate &QSslSocket::sslErrors() expression. Add a new
getter - sslHandshakeErrors().

[ChangeLog][Deprecation Notice] QSslSocket::sslErrors() (the getter) was deprecated and superseded by sslHandshakeErrors()

Task-number: QTBUG-80369
Change-Id: I9dcca3c8499800c122db230753dc19b07654f8a2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-10 13:41:59 +01:00
Timur Pocheptsov
0de6c26ac1 QLocalSocket - deprecate ambiguous 'error' overloads
QLocalSocket::error is overloaded as a signal and an accessor (for the
error reported by the signal). This means connecting to the signal using
a pointer to member function would require ambiguity resolution. We
deprecate the old accessor (to be removed in Qt 6) and introduce a new one -
'socketError'.

[ChangeLog][Deprecation Notice] QLocalSocket::error() (the getter) is deprecated; superseded by socketError().

Task-number: QTBUG-80369
Change-Id: Iab346f7b4cd1024dee9e5ef71b4b7e09f6d95b12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-10 12:54:53 +01:00
Timur Pocheptsov
94b3dd77f2 QAbstractSocket: deprecate 'error' member-function
The one that is a getter for the last error found. This is to disambiguate
the expression '&QAbstractSocket::error'. Introduce a new member-function
socketError as a replacement.

[ChangeLog][Deprecation Notice] QAbstractSocket::error() (the getter) is deprecated; superseded by socketError().

Task-number: QTBUG-80369
Change-Id: Ia2e3d108657aaa7929ab0810babe2ede309740ba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-10 12:54:53 +01:00
Leander Beernaert
f4a630588f Fix tst_qlogging
Pass in the QT_CMAKE_BUILD define to change the expected executable name
in the tests.

Add special cases for missing compile flags that cause the collection of
backtraces to fail otherwise.

Change-Id: I53c44f7e4c6d597f941e4dd8173b3a39a615339c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-10 10:20:31 +00:00
Christian Ehrlicher
efff8ff57a QFileSystemWatcher/win: watch also for attribute changes of directories
The windows filesystemwatcher did not watch for attribute changes for
directories (e.g. hidden flag) so it was not in sync with other
backends. Fix it by adding FILE_NOTIFY_CHANGE_ATTRIBUTES to the watch
flags when watching a directory.

[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that caused QFSW not
to watch for attribute changes on Windows. Now it will correctly report
when files and directories become hidden or unhidden, for example.

Fixes: QTBUG-80545
Change-Id: I31767a0da899963e3940b4f5b36d1d581e6aa57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-01-10 06:24:14 +01:00
Qt Forward Merge Bot
0dc5562fa4 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I784e23d7913294225686879c9bd77dafe3580bac
2020-01-10 01:01:15 +01:00
Liang Qi
a59c768489 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/kernel/qobject.cpp

Change-Id: I4780b25665672692b086ee92092e506c814642f2
2020-01-09 20:30:39 +01:00
Morten Johan Sørvig
5507d0f1b0 Make setReadOnly track ReadOnlyChange events only
The test was previously tracking all Change events,
which made it fragile.

Change-Id: I17872341237009a9a0a2ad2fd5482f917991d7b2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-09 13:52:25 +01:00
Edward Welbourne
70d484b5df Fix encoding expected by tst_qmessagehandler::qMessagePattern()
The actual logging code, qt_message_print(), uses toLocal8Bit(), so
testing by comaring with toUtf8() isn't robust.

Change-Id: I7d6614e4af8c679674dbbf4ff47a88b2b75fc2dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 10:58:25 +01:00
Edward Welbourne
bcc8cf5e3b Fix encoding inconsistency between tst_QNoDebug and QTestLog
Fix tst_QNoDebug::streaming() to use toLocal8Bit(), to match
QTestLog::ignoreMessage(), which uses fromLocal8Bit().

Change-Id: I65f7b995a582aeab7b7ba61781a229fecd1ed3c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2020-01-09 10:57:49 +01:00
Andre Hartmann
1edf8bc465 QObject: Replace more 0 and NULL with nullptr
... in docs, comments, and warnings. Also adopt
some occurrences around there and in the snippets.

Change-Id: Icc0aa0868cadd8ec2270dda794bf83cd7ab84160
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-01-09 02:33:08 +01:00
Qt Forward Merge Bot
6074ebf728 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I7be168303fc4fec5892f20f8dcbdf1bdfcd4986f
2020-01-09 01:00:26 +01:00
Qt Forward Merge Bot
06b2d54e4b Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-09 01:00:21 +01:00
Qt Forward Merge Bot
9bb9de461f Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I9b4816b4aa6f0c51a446742db58b9d0dcf69aa09
2020-01-09 01:00:08 +01:00
Giuseppe D'Angelo
50f3ccd782 QStringView: add a test for overload resolution versus QString
In the presence of multiple overloads of a function taking either
QString or QStringView, QStringView should always be preferred.

The rationale is that the QStringView overload may have been
added "later" (read: the function was written when QStringView
was not available yet, so it took QString), and the fact that
a function with the _same name_ offers a QStringView overload
implies the function never needed to store/own the string in
the first place.

Add a (compile-time) test for this preference. This is in
preparation for a future QString(char16_t*) constructor
(in Qt 5.15 / Qt 6).

Change-Id: I60a435e494b653548f8f8d52c5d7e7cac2cc875a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 00:01:55 +01:00
Jean-Michaël Celerier
ea81b69cde Implement qtbase fixes for superbuilds
Change-Id: I0d3445cf0740e3925fa9342dac4d07892518afe5
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-08 10:42:21 +00:00
Friedemann Kleint
c72322804d uic: Extend the baseline test for Python
Previously, there was only a Python compile test which triggers
only when PySide2 is found. Rename it to pythonCompile().

Extend the TestEntry structure by adding the base line file
and flags, which represent all special cases found in the code.
Check for the presence of a Python base line file in addition
to the C++ one.

Prototypically add one form. Further forms can be added
on the go.

Task-number: PYSIDE-797
Change-Id: Ic2983fa3cab2399a6809e244f93c663e0212f675
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-01-07 13:33:14 +01:00
Friedemann Kleint
75391511ff Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia2ce994c42adc010c453edaeea57f672556958f6
2020-01-07 08:34:53 +01:00
Qt Forward Merge Bot
c75e8a6618 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I6c81e3cb6272adc5c3de2513792bd48604ff4dd0
2020-01-07 01:01:16 +01:00
Qt Forward Merge Bot
68c30e372b Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-06 20:13:31 +00:00
Sona Kurazyan
82d02b7b95 Deprecate SAX classes in Qt XML
Deprecated the SAX classes and disabled or replaced their uses in
tests if applicable.

Removed the saxbookmarks example, no point in keeping examples for
the deprecated code.

[ChangeLog][QtXml] SAX classes are now deprecated. Use QXmlStreamReader,
QXmlStreamWriter in QtCore instead.

Task-number: QTBUG-76177
Change-Id: Ic171d62fa0527b0f36f94cf09a69586092269957
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-01-06 18:13:01 +01:00
Paul Olav Tvete
844ef184e8 RHI: Remove old native texture API
Task-number: QTBUG-78570
Change-Id: I8c4850828ac03319ac923a26c2e985883956c286
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-06 18:13:01 +01:00
Andy Shaw
6b835d5e51 QTextDocument: Set the font family to be after the families set
This amends a1f4321bbb as the font
families should take precedence over the font family set. If the font
family is already included in the families then it should keep its
placement. Otherwise it should be appended.

Task-number: QTBUG-80475
Change-Id: I0049189c88b6879e57619815ec780960e9c0a300
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-01-06 12:01:08 +01:00
Qt Forward Merge Bot
3a010f72b8 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/kernel/qvariant.h

Change-Id: I8f3873e74b9795ac889e7c7ec5de2619bca92160
2020-01-06 07:20:18 +00:00
Liang Qi
a503bf5470 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qvector.h
		Make QVector(DataPointer dd) public to be able to properly merge
		5b4b437b30 from 5.15 into dev.
	src/widgets/kernel/qapplication.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
2020-01-04 15:32:34 +01:00
Friedemann Kleint
3a9251e869 Fix parameter of QJsonObject::const_iterator operator-(const_iterator)
It used to be "iterator", causing a qdoc warning:

src/corelib/serialization/qjsonobject.cpp:1405: (qdoc) warning: clang found diagnostics parsing \fn int QJsonObject::const_iterator::operator-(const_iterator other) const
    error: out-of-line definition of 'operator-' does not match any declaration in 'QJsonObject::const_iterator'

Add a small test.

Change-Id: Id65effffa720ed1e0fb0ee6937dcc4298f3ef363
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-03 14:59:20 +01:00
Christian Ehrlicher
21987679de QTime: fix tests with Qt6
In Qt6 there is a behavior change with extra stuff after the seconds -
it's no longer allowed and will result in an invalid QTime.
This was introduced with bf65c27789 but
the autotests were not adjusted for it.

Change-Id: Ia78f4f2a8019e46d9d0e8e8b8918a3ab2d4638e2
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-01-03 14:55:48 +01:00
Fabian Kosmale
8669b8e60f QVariant: Prefer direct conversion to QVariant{List,Map,Hash}
If a type has both a converter to QVariantList and to
QSequentialIterableImpl registered, we would have chosen the
QSequentialIterableImpl version. In the case of types like QJSValue,
this is more costly. With this change  we therefore uses the direct
conversion if it has been registered.

The same applies to QAssociativeIterableImpl and
QVariantHash/QVariantMap.

Change-Id: I9c0b5068efe4bfbc5e0598a200e6db59201e9974
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-01-03 10:59:37 +01:00
Giuseppe D'Angelo
2ced01cbdd QIdentityProxyModel: implement moveRows / moveColumns
It makes sense for it (instead of triggering the QAbstractItemModel
base class implementation, which doesn't do anything). Safe to override
virtuals in this case -- code calling the old version could not do
anything useful, so at least new code gets those functions properly
implemented for free.

Change-Id: Iefe1ff25e15d877435e93ab28289ad2579616f72
Task-number: QTBUG-48076
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2020-01-02 17:48:07 +01:00
Vitaly Fanaskov
045250ed42 Fix QPalette::isBrushSet
The previous implementation did not take into account different color
groups in resolve mask. It led to some issues when resolving a
palette or checking whether a brush is set or not.

Task-number: QTBUG-78544
Change-Id: I9b67b2c444eb62c022643022a874dc400005e6ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-01-02 15:46:38 +01:00
Joerg Bornemann
deddafe0a6 Long live QFlatMap!
Add a light-weight associative container, API-wise very similar to QMap,
that's based on two sorted continuous containers (QVector by default).

The class is internal for now.

Change-Id: Ife12576c4abb39a3ea2acb0a1ba0faca91b3a4c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-02 15:28:20 +01:00
Christian Ehrlicher
cf033b32b5 QDateTime: fix tests with Qt6
In Qt6 there is a behavior change with extra stuff after the seconds -
it's no longer allowed and will result in an invalid QDateTime.
This was introduced with bf65c27789 but
the autotests were not adjusted for it.

Change-Id: Iee6a9a7ac6cbb2754a68e082bb7074d17fac9d9c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-02 13:07:05 +01:00
Ulf Hermann
a1f4321bbb QTextDocument: Give fontFamily() precedence over fontFamilies()
If the singular fontFamily() is given, then this is obviously the one to
be preferred over any plural fontFamilies(). Make sure it always ends up
first in the list of emitted font families.

Change-Id: I1e3b1ba29721c8298b1a0d4a1e1da49ba5b4e7ac
Fixes: QTBUG-80475
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-02 10:30:13 +01:00
Qt Forward Merge Bot
51df9bd251 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I7b6e6c687d8d60b4a54e6b9dada025ef66c53d96
2020-01-02 01:00:07 +01:00
Tuomas Heimonen
27d1391280 QLocale: Support Indian number formatting
When QLocale::Country is set to QLocale::India numbers are written so that
after first three from the right and then after every second will be comma.
E.g. 10000000 is written as 1,00,00,000

Task-number: QTBUG-24301
Change-Id: Ic06241c127b0af1824104f94f7e2ce6e2058a070
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
2019-12-30 13:04:23 +02:00
Qt Forward Merge Bot
4054c0d6ed Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	src/plugins/platforms/xcb/qxcbscreen.cpp
	src/widgets/accessible/qaccessiblewidget.cpp

Change-Id: Ib3138e61ba7981610940509a7ff02ba2dd281bf0
2019-12-27 09:29:30 +01:00