Commit Graph

9692 Commits

Author SHA1 Message Date
Edward Welbourne
f3de22b211 Add assorted tests to exercise more QTest functions
Coverage analysis reveals some unexercised code.

Task-number: QTPM-1385
Change-Id: Ib3fdbcf778e7af14ca6dfa1a11bcb4943276de69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-24 15:51:04 +00:00
Ryan Chu
4b1b9ad7b0 Enable path conversion from Windows-style to Unix-style on Windows
COMPOSE_CONVERT_WINDOWS_PATHS is supported by Docker and available
for you to configure the docker-compose command-line behavior. It
enables path conversion from Windows-style to Unix-style in volume
definitions. Users of Docker Machine and Docker Toolbox on Windows
should always set this to true.

Change-Id: Ib59756ad68482fdd889ce39ab1ab0118b5fc9071
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-24 15:42:47 +00:00
Mårten Nordheim
fe1907435d tst_qsslsocket: Make an ALPN test available to other backends
Currently only available for the OpenSSL backend to use but doesn't
actually rely on anything OpenSSL specific.

Move it so it can be used by the Schannel backend in an upcoming patch

Change-Id: Ia29b153bf3f29cff0d62a41ec5dd7d4671a18095
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-24 15:24:23 +00:00
Mårten Nordheim
58c9c4b609 Ssl: Add support for IP-address in alternate subject name
While it's not common it still occurs, perhaps especially with 127.0.0.1

Can be tested by attempting to connect to https://1.1.1.1/ using Qt.

Change-Id: Idad56476597ab570b8347236ff700fa66ab5b1f4
Fixes: QTBUG-71828
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-24 15:24:14 +00:00
Andy Shaw
461ef575bc Always escape the table names when creating the SQL statement
Since some databases are case sensitive if part of the query is quoted,
then we should ensure that all instances of the table name are escaped
unless the test is delibrately testing the non-escaped case.

As a result, this commit also removes some expected failures pertaining
to PostgreSQL and also adds an entry to the list of tables being dropped
when a test is finished.

[ChangeLog][Sql][PostgreSQL] QSqlDatabase is now stricter about table
names when used with record() and primaryIndex(). If the tablename was
not quoted when it was created, then the table name passed to record()
and primaryIndex() needs to be in lower case so that PostgreSQL is
able to find it.

Fixes: QTBUG-65788
Change-Id: Id1f54cb66b761c39edf858501b730ede7eec1fd3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-23 20:07:09 +00:00
Christian Ehrlicher
7c69f6171d QFile/QFileInfo: mark readLink() as deprecated
QFile/QFileInfo::readLink() functions are obsolete but were not marked
as deprecated.
Explicit mark them as deprecated so they can be removed with Qt6.

Change-Id: I52424dc5441e1f5b01015713df990bbec5186caa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-23 18:49:15 +00:00
Christian Ehrlicher
5eab68bbee QProcess: mark obsolete functions as deprecated
QProcess::finished(int)/readChannelMode()/setReadChannelMode() are
obsolete but were not marked as deprecated.
Explicit mark them as deprecated so they can be removed with Qt6.

Change-Id: Iedbfd80a3c987f35caf93181e9277913a18961d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-01-23 18:49:12 +00:00
Friedemann Kleint
07580a8d7b uic: Fix broken icon code generation
Change b86d0b6215 rearranged the
sequence of function calls when generating code adding QTabWidget
and QToolBox pages, not taking into account that the iconCall()
has a side effect (writing out icon definition) Revert that part
and add a comment.

Fixes: QTBUG-72980
Task-number: PYSIDE-797
Change-Id: Ie8fbaa36f21cd4408fb1f491195da5c260708e6c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-01-23 17:06:59 +00:00
Tor Arne Vestbø
237c3972fd Allow more fine grained control over QFlags debug output
Useful in contexts such as other QDebug operators, where the class
is already known, and the full scope of the flags is not needed.

Change-Id: I546381b1722c9c846e2412e56763563b8f625212
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-23 16:12:52 +00:00
Tor Arne Vestbø
25fc90e48b Allow more fine grained control over QMetaEnum debug output
Useful in contexts such as other QDebug operators, where the class
is already known, and the full scope of the enum is not needed.

Change-Id: Ibd04b1fd4f0f914c7224a007fc248d4ebabcde3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-23 16:12:50 +00:00
Ryan Chu
4e55d8b50b Remove useless fall-back network interface of Dante-server
Setting the fall-back network interface of danted's environment to eth0
by docker-compose file is redundant because the value of danted's
configuration (danted.conf) has been set to eth0 by default.

Change-Id: If2dea8daaf851577a573e201e9c50684916e5206
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-23 15:29:05 +00:00
Ryan Chu
ae2a0344a3 Fix QNetworkReply ServiceUnavailableError in macOS
For macOS and Windows, the test-server containers are deployed in the
VirtualBox (Boot2Docker). Because Boot2Docker is a lightweight Linux
distribution made specifically to run Docker containers, it doesn't
install avahi-daemon and support mDNS discovery.

To resolve this problem, Docker compose file supports "extra_hosts" to
add hostname mappings inside containers.

BFAIL items:
tst_QNetworkReply::headFromHttp(...+proxy...) (ten cases)
tst_QNetworkReply::ioGetWithManyProxies(http-on-http)
tst_QNetworkReply::ioGetWithManyProxies(http-on-http2)
tst_QNetworkReply::ioGetWithManyProxies(http-on-multiple-http)
tst_QNetworkReply::ioGetWithManyProxies(http-on-http+socks)
tst_QNetworkReply::ioGetWithManyProxies(http-on-ftp+http+socks)
tst_QNetworkReply::ioPostToHttpFromSocket(...+proxy) (twelve cases)
tst_QNetworkReply::ioPostToHttpFromSocket(...+proxyauth) (ten cases)

Change-Id: Iec55966a9b5f191b7446985a15b49a8b09dcf407
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-23 15:28:59 +00:00
Ryan Chu
bcaf67258f Use environment variables to replace the hard-code value of domain name
Docker compose file supports variable substitution. When running
docker-compose up, Compose looks for the environment variables from
shell and substitutes the values at runtime.

Change-Id: I5255ead82276fac7db24ee74af453f83ca20bbe6
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-23 15:28:51 +00:00
Ryan Chu
beab266977 Docker-based test servers for network-related Qt autotests on Windows
There is no docker bridge on Windows. Docker document recommends using
port mapping to connect to a container. The problem is that it causes a
port conflict if the user is running a service that binds the same port
on the host. This change applies the same solution of macOS to deploy
the docker environment into VirtualBox and use the host network option.

Task-number: QTQAINFRA-2294
Change-Id: Iedcb8daa39373f02adb59f02eae2775f02870c54
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-23 15:28:45 +00:00
Ryan Chu
4552eddabf Extend the default retry times of QtNetworkSettings::verifyConnection
Apparently, it is not enough to just retry 10 times (10 seconds) in the
CI network. It happens from time to time that a test fails due to server
port is unreachable. Especially, the docker containers are running in a
virtual machine on Windows and macOS platforms. In such cases, it needs
more time to warm up the service depending on the system loading.

Change-Id: Ia0234bff2a82988b62f451e20b50671708784008
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-23 15:28:33 +00:00
Qt Forward Merge Bot
e3da05f39a Merge remote-tracking branch 'origin/5.12.1' into 5.12
Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
2019-01-23 10:13:29 +01:00
Allan Sandfeld Jensen
e823c351c6 Fix resolve() on fonts returned from QWidget::font()
Set the inherited properties as resolved on the font, so non-default
values are passed on in contexts that does resolve logic like QPainter.

One test is updated as it actually tests what it is supposed to on
more configurations.

Fixes: QTBUG-39560
Change-Id: Ief668e992ccdc091337a259a4c1306a00e67c73f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-22 18:43:18 +00:00
Mårten Nordheim
7cc6f78dd4 Schannel support
Adds support for Schannel, an SSL backend for Windows, as an
alternative to OpenSSL.

[ChangeLog][QtNetwork][Ssl] Added support for Schannel on Desktop
Windows. To build Qt with Schannel support use '-schannel' during
configure.

Task-number: QTBUG-62637
Change-Id: Ic4fb8ed3657dab994f9f4a4ac5cbddc7001a0a46
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-01-22 15:19:48 +00:00
Albert Astals Cid
e0567d137d Add QStringList::indexOf/lastIndexOf for QStringView and QLatin1String
Change-Id: I42eac69c1f7ab88441d464b9d325139defe32b03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-22 15:07:29 +00:00
Friedemann Kleint
9822d57d85 Stabilize tst_QItemDelegate::dateTimeEditor()
Add qWaitForWindowExposed() for the toplevel and use QTRY_VERIFY()
for finding the delegates consistently.

Change-Id: I430088a91b5cc1a8f856d0a58aba066b1baf179b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-01-22 12:33:01 +00:00
Mårten Nordheim
503ff495aa Update manual qsslsocket test to use HTTP/2 instead of spdy
Some of the spdy/3 tests don't pass anymore because those services
no longer support spdy/3. Solve this by updating it to HTTP/2 (h2).

Change-Id: Ib3ef6109b75f4298fed15c1c7922deca35459df9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-22 09:45:41 +00:00
Christian Ehrlicher
9f8589befe tst_QString: fix localeAwareCompare() when using ICU
tst_QString::localeAwareCompare() is failing since
ab448f731e because the 'C' locale no
longer initializes ICU and falls back to simple QString comparison.
Fix it by explicitly setting the locale for the testdata to en_US so the
QCollator is properly initialized.

Task-number: QTBUG-73116
Change-Id: I9d4d55e666c5c52f93298dedb7e22da01a25318d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9d2923c1b0)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2019-01-21 16:47:32 +00:00
Christian Ehrlicher
024daeb08c tst_QGraphicsItem: stabilize cursor() test
The cursor test sometimes fails due to the fact that the topLevel widget
has not yet reached it's fullscreen geometry. This means the
QGraphicsView is to small and the test will fail.
Avoid it by simply removing the topLevel widget since it's not used at
all.

Change-Id: Ia7b34f283a917a35b6665e6333a01378575a5a04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-01-22 17:00:34 +00:00
Edward Welbourne
76dfda1ad1 Use RAII to handle setting of default locale in tst_QString
Various tests were setting the default locale and relying on cleanup()
to "restore" the C locale; which needn't actually be the locale we
started out in and, in any case, was the wrong locale for some tests.
So handle this via an RAII class that records the actual prior locale
and restores it on destruction.

Fixes: QTBUG-73116
Change-Id: If44f7cb8c6e0ce81be396ac1ea8bab7038a86729
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-22 16:42:29 +00:00
Qt Forward Merge Bot
f94ca82e0f Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf

Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
2019-01-21 13:03:09 +01:00
Christian Ehrlicher
b1092a7d42 tst_QPrinter: stabilize qprinter test
The CreationDate entry in the two PDF files can potentially
be different depending on when the test is run.
97b4c5a574 already accounts for it but
the current tag for creation date is '/CreationDate'. Therefore check
if the line contains 'CreationDate' instead.

Change-Id: I1fc069cf935bba07084ac4a0743ff05312374d10
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-20 13:39:54 +00:00
Christian Ehrlicher
9d2923c1b0 tst_QString: fix localeAwareCompare() when using ICU
tst_QString::localeAwareCompare() is failing since
ab448f731e because the 'C' locale no
longer initializes ICU and falls back to simple QString comparison.
Fix it by explicitly setting the locale for the testdata to en_US so the
QCollator is properly initialized.

Task-number: QTBUG-73116
Change-Id: I9d4d55e666c5c52f93298dedb7e22da01a25318d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-20 13:39:45 +00:00
Edward Welbourne
a53500f5bf Eliminate some stray misleading paths from expected output files
The output files for the tuplediagnostics selftest of testlib had a
stray non-canoical path fragment in them; so replaced with its
canonical form.

Change-Id: Ib421380036c3fb1b91447eb8c87be4ad0dfe5c96
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-16 18:47:41 +00:00
Ryan Chu
fe29a6a6eb Fix the timing issue of vsftpd during boot (probably invalid config)
This appears to be a timing issue of vsftpd's initial script
(/etc/init.d/vsftpd). When starting the vsftpd service, the script uses
a while loop to make sure that the vsftpd process has been created with
the expected PID. The problem is that it should sleep if it can't grep
the same PID via ps command.

while [ ${n} -le 5 ]
do
    _PID="$(if [ -e ...vsftpd.pid ]; then cat ...vsftpd.pid; fi)"
    if ! ps -C vsftpd | grep -qs "${_PID}"
        then
            break
    fi
    sleep 1
    n=$(( $n + 1 ))
done

if ! ps -C vsftpd | grep -qs "${_PID}"
then
    log_warning_msg "vsftpd failed - probably invalid config."
    exit 1
fi

However, synchronization based on time is not working in general. This
change will rewrite the while loop to an infinite loop and remove the
exclamation symbol (!) from the if condition.

Upgrading the version of vsftpd is not helpful here because
vsftpd_3.0.3-11 (Ubuntu 18.10) didn't resolve it yet.

Change-Id: I07382709c33bd9bab61fcea76ab7deca5f630084
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-16 18:24:01 +00:00
Mårten Nordheim
8e500e15fa tst_qsyntaxhighlighter: fix no-op QTRY_VERIFY check
The bool is assigned on the previous line: QTRY_VERIFY will not do
anything because the statement is already true.

Change-Id: I067290e19ffd100819b2b631af431c6013623a00
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-16 14:23:42 +00:00
Mårten Nordheim
f8f0f3eef1 QSyntaxHighlighter: cancel delayed highlight if done manually
It was an implicit effect before which stopped working after
dec7961709. Reintroduce it as some
projects used this side-effect as a way to abort the initial
highlighting.

Change-Id: I5340ee9882a242bc8b5f7f843f1cfe793a65d357
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-16 14:23:37 +00:00
Ryan Chu
2c875efa99 Support debug_and_release option (which is the default under Windows)
When debug_and_release option is in use, qmake will generate one
mata-Makefile and two additional leaf Makefile (Makefile.Debug and
Makefile.Release). In such case, testserver.pri will be included in all
three passes. The problem is that the mata-Mafile is used to invoke leaf
Mafile recursively. The docker test server should only be integrated in
the leaf Makefile.

To resolve this problem, this change uses "!build_pass" condition to
determine whether this is a pass of meta-Makefile, and then skip it.

Change-Id: Ibc48d657680e089ebaa1bc356b87eb4cfd9f4580
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-15 23:40:13 +00:00
Oswald Buddenhagen
c365fa49d8 fix out-of-bounds access on trailing percent sign in tr() argument
tr() recognizes %n and %Ln. it offers no way to escape lone percent
signs, which implies that they must be interpreted verbatim, which is
what the code actually does. except that it would run off the end if the
% appeared at the end of the string.

Fixes: QTBUG-57171
Done-with: Mateusz Starzycki <mstarzycki@gmail.com>
Change-Id: Icf81925c482be1ea66ec8daafb3e92ad17ea7fab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-01-14 08:52:15 +00:00
Edward Welbourne
dd5e7f1a52 Use a more robust test for absolute paths in QDir
Its filePath() and absoluteFilePath() don't trust its own
isAbsolute(), due to some infelicities on MS-Win; and kludged round a
consequent problem with resource paths; but other virtual file systems
weren't catered for.  Replace the convoluted test there with a static
bool function (so that future kludges in this area shall only need to
edit one place; and can document why they're needed) and use a more
robust test that handles all virtual file systems (by asking
QFileInfo) but falls back to QFileSystemEntry to work round the known
infelicities on MS-Win.  Add regression test for asset library paths
issue on iOS.  Ammends 27f1f84c1c.

Moved a couple of local variables to after the early return, since it
doesn't need them, in the process.

Task-number: QTBUG-70237
Change-Id: Ib3954826df40ccf816beebe5c3751497e3bf6433
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-01-13 18:18:10 +00:00
Tor Arne Vestbø
68511d41d5 qWaitFor: Prevent being stuck in QCoreApplication::processEvents
When using the overload of QCoreApplication::processEvents that takes a
maxtime argument, the function will keep processing events until there
are no more events, or until it times out.

The problem is that the function doesn't distinguish between events that
were on the event queue when the function was called, and events generated
by processing events as part of its own execution. If for example a widget
calls update() in its paintEvent, the function will spin for the entire
duration of maxtime.

That doesn't work for qWaitFor, where we need to check the predicate
between each pass, so we use the overload of processEvents that doesn't
take a maxtime. That's fine, as we have our own timeout logic.

Change-Id: I9738d7d0187c36d4a5ddfcd3fd075b0bd84583c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-09 18:10:54 +00:00
Timur Pocheptsov
0cc9c30479 disabledProtocol() - use the right address when connecting
... as we normally do in other tests, using localhost.

Change-Id: I7969d7bfd50b545adae7e23476d17b6224e9a8fc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-01-09 05:36:45 +00:00
Ryan Chu
574ac8734d Skip smb-path test of tst_QNetworkReply when using Docker test servers
The tests of smb protocol only work in the CI network. Therefore,
the docker-based test server for Windows can't pass all the tests of
QNetworkReply.

These two tests should be reworked when adding Samba server to the
docker-based test servers later on.

Task-number: QTBUG-72861
Change-Id: I54e639b5414760ee929d0d28fe10f9e021aff7dc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-08 22:28:34 +00:00
Andy Shaw
e70230405d Don't treat the ampersand in a titlebar as a mnemonic
As the mnemonic has no meaning when it is in a dockwidget title, we
should just treat it as a literal ampersand instead and display it
as such.

Fixes: QTBUG-54485
Change-Id: I96c856ce2771a68d226f48f8f47affc24f1c53cd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-01-08 21:37:04 +00:00
Allan Sandfeld Jensen
c961d1a6d2 Make convert_generic_to_rgb64 more generic
This makes it possible to get rid of specialized functions for
converting to RGBA64PM, while at the same time making the conversion
faster as the painter routines are better optimized.

Change-Id: I3e73856b2c1411977450e72af1741aab0ecf537e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-08 15:00:06 +00:00
Tony Sarajärvi
8b1a23ed32 Blacklist a flaky qtableview function in WinRT
Task-number: QTBUG-72853
Change-Id: Iaf2b25712b571a3ce73387cb3d2e70d427808364
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-01-08 11:58:41 +00:00
Liang Qi
0e96b5fe48 Merge remote-tracking branch 'origin/5.12' into 5.12.1
Conflicts:
	src/widgets/kernel/qtooltip.cpp

Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
2019-01-08 09:34:24 +01:00
Jean-Michaël Celerier
e6a7b61d27 Add clear, reserve and capacity methods to QPainterPath
This allows anticipating and reusing internal allocations of
QPainterPathElements instead of using the common `m_myPath = QPainterPath{}` pattern.

[ChangeLog][QtGui][QPainterPath] Added clear(), reserve(), capacity().
clear() removes allocated QPainterPath elements but preserves allocated memory, which can be
useful for application with complex paths that are often recreated. reserve() and capacity()
follow QVector semantics.

Change-Id: I763461e2a421feda9053d3eb512af2fcf07ade2b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-01-08 08:25:02 +00:00
Christian Ehrlicher
52e0d9e23c Drag'n'Drop: fix dnd when dragMoveEvent() is not implemented
The refactoring of dnd with f8944a7f07
added a regression which results in a need to reimplement
dragMoveEvent() on the drop side. Before this change it was possible to
accept the dnd in dragEnterEvent() without again accepting it in
dragMoveEvent().
Fix it in a similar way it's done in
QGuiApplicationPrivate::processDrag() by prefilling the first simulated
QDragMoveEvent with the values from the previous QDragEnterEvent before
it is sent to the drop receiver.

Fixes: QTBUG-72844
Change-Id: I1300dd02b7f1d9dcd44ecefa8335f92ad6c6cafa
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-01-07 10:50:18 +00:00
Qt Forward Merge Bot
c497f79ad4 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ieb57137ee2b7d0c505e3531d5aa1bcb66978847e
2019-01-07 01:00:08 +01:00
Jędrzej Nowacki
ecdccce8e4 Fix warnings about uninitialized variables
qtbase/src/corelib/kernel/qmetatype.cpp: In static member function ‘static void QMetaType::destroy(int, void*)’:
qtbase/src/corelib/kernel/qmetatype.cpp:2599:27: error: ‘info.QMetaType::m_destructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (m_typedDestructor && !m_destructor)
         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_destructor’ was declared here
     QMetaType info(type);
               ^~~~
qtbase/src/corelib/kernel/qmetatype.cpp:2600:26: error: ‘info.QMetaType::m_typedDestructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         m_typedDestructor(m_typeId, data);
         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_typedDestructor’ was declared here
     QMetaType info(type);
               ^~~~

The extended (not inlined) function may be called on a half
initialized invalid instance.

Change-Id: I26d677a8ad2bd0c5846233f06393e774d377936d
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-06 10:14:36 +00:00
Oswald Buddenhagen
f89ac0101a qmake: add $$read_registry() function
Change-Id: I7f9f17e0f44c273e4754d1decc92a8594cad8658
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-01-05 20:33:07 +00:00
Tony Sarajärvi
8c2ca29045 Revert "Blacklist tst_QTimer::basic_chrono on macOS"
Incorrectly blacklisted.

This reverts commit 40a7c57ba9.

Task-number: QTBUG-61013
Change-Id: I7d9dc4a4b1c8d7ff77ab75c61027b908ffb74552
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-01-04 09:45:41 +00:00
Vitaly Fanaskov
f7dc6042cb Remove dead code
Task-number: QTBUG-44131
Change-Id: Ic092f2be5855840d6467560159c12f3c5aa36344
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-01-04 09:42:14 +00:00
Liang Qi
03039979b5 Merge remote-tracking branch 'origin/5.12' into dev
Also blacklist tst_QRawFont::unsupportedWritingSystem() and
tst_QGlyphRun::mixedScripts() on windows for now.

 Conflicts:
	qmake/generators/makefile.cpp
	src/corelib/itemmodels/qstringlistmodel.cpp
	src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
	tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
	tests/auto/gui/text/qglyphrun/BLACKLIST
	tests/auto/gui/text/qrawfont/BLACKLIST

Task-number: QTBUG-72836
Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
2019-01-04 07:33:14 +01:00
Vitaly Fanaskov
d8bbb5ee0e Respect roles of buttons added to QMessageBox
When a button added to QMessageBox has AcceptRole or YesRole, the signal
accepted() will be emitted upon click on the button. If the button has
RejectRole or NoRole, the signal rejected() will be emitted upon click
on the button. If a button has a different role, neither accepted() nor
rejected() will be emitted. This works for both standard and custom
buttons.
The signal finished() with result code will be sent regardless of a
clicked button role.
Also added documentation strings for some methods of private classes in
order to have better tooltips in IDE(s).

Task-number: QTBUG-44131
Change-Id: I521a4e5112eb4cf168f6fbb4c002dbe119aeeb09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-03 18:38:12 +00:00
Ryan Chu
451ebdff82 Revert "Disable Docker-based test servers on macOS temporarily"
This reverts commit c1fc47b06a.

CI is now running on 18.04 hosts and vmx is enabled on that level.
As the update in QTQAINFRA-2288, the macOS 10.13, openSUSE 42.3
and Ubuntu 18.04 had vmx enabled inside the VM.

Change-Id: I6ec4094ca826418f46f417b3cab89678bb089417
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-01-03 03:27:32 +00:00
Alejandro Exojo
7f34e8b58c Fix and unit test QPalette::resolve
The function is setting the brushes correctly in the return value, but
without updating the resolve_mask, making it return wrong results in
functions like isBrushSet or the debug operator.

Added a unit test for the member function, since the class is still
mostly untested, and clarified the reference documentation of what the
function is supposed to do.

Change-Id: Iaa820dc44f095e125f9375cb00da5569986803c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-12-31 14:30:26 +00:00
Christian Ehrlicher
4c1313197b QbstractItemView: Allow Key_Space for keyboardSearch()
The keyboard search in QAbstractItemView did not handled Key_Space
because this is also an edit trigger. It was also consumed if no edit
was started.
This patch changes this behavior and triggers the keybaord search when
the editing was not started.

Fixes: QTBUG-48505
Change-Id: I58e0d283f863c9b12ac5d2f6171f15522bd7c30a
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-25 10:15:32 +00:00
Christian Ehrlicher
f568bfce64 QTreeView: fix keyboard navigation when first or last item is disabled
The keyboard navigation did not consider the disabled state when trying
to find the new index under all circumstances. This lead to a
non-working PageUp/Down/Home/End navigation when the first or last item
was disabled or hidden.
Fix it by explicitly checking if the calculated item is hidden/enabled
and skip it in this case.

Fixes: QTBUG-44746
Fixes: QTBUG-34832
Change-Id: Ifa3b64a405e67b792db5db9d186d426fcfe183fb
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-25 10:15:29 +00:00
Luca Beldi
ff835a5030 Fix QStringListModel::setData to check for actual changes
QStringListModel::setData documentation states that
"The dataChanged() signal is emitted if the item is changed."
This patch actually respects the doc. setData will check that the data
actually changed before sending the dataChanged signal.

[ChangeLog][QtCore][QStringListModel] setData will now emit the
dataChanged() signal only if the string set is different from
the one already contained in the model

Change-Id: I4308a6f3b4851203fb899c5e29a36076e0c32f2f
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-24 08:07:36 +00:00
Tor Arne Vestbø
3306b16239 macOS: Only do gamma-corrected blending for subpixel-antialiased text
The grayscale font-smoothing doesn't expect to be linearly blended,
as first assumed.

Amended nativetext manual test to better diagnose the native Core
Text behavior. Non-linear blending will result in the magenta
text having a dark outline against the green background.

Change-Id: I24a5f04eb1bd66fb98d621078d80ee9b80800827
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-12-23 12:00:07 +00:00
Andy Shaw
f03941e411 Add overload of QSqlDatabase::cloneDatabase to allow cloning cross threads
Since QSqlDatabase::database() cannot be used to access another database
from another thread, then the overload is provided to make it possible
to clone with just the connection name. This will handle the cloning
internally safely then.

Fixes: QTBUG-72545
Change-Id: I861cc5aa2c38c1e3797f6f086594a1228f05bada
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-23 11:41:36 +00:00
Milla Pohjanheimo
4a0ed282cf Add binary compatibility files for 5.12 for QtBase
Binary compatibility files added.

Change-Id: I2543902fb7ac97270db7fb79ae09641898cc8ba4
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-21 19:42:57 +00:00
Eskil Abrahamsen Blomfeldt
e6880e7cd1 Fix text shifting vertically when elided
When eliding text we would check for the existence of the ellipsis
character and fall back to using the dot if it was not available.
However, when font merging was in use, we would also use ellipsis
from a fallback font if available. This could cause the metrics
of the text to increase if the fallback font had larger metrics,
and the result was that text could shift when elided.

It is better to prefer the dot from the current font than to use
the ellipsis from a fallback, so we only use the ellipsis if
it is in the main font.

[ChangeLog][QtGui][Text] Fixed a bug where eliding text could
change the height of its bounding rectangle for certain fonts.

Fixes: QTBUG-72553
Change-Id: Ib27fc65302465ddce661801bcc5ae32e55f1aeb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-21 10:27:12 +00:00
Timur Pocheptsov
3e1758e35d QSsl: do not wait for 'connected'/'encrypted' if a protocol is disabled
since we'll refuse to continue with a handshake, failing in initSslContext()
on a disabled protocol versions. Then, functions like waitForEncrypted,
connectToHostEncrypted, startServerEncryption and startClientEncryption
should either bail out early (who needs a TCP connection which we'll
abort anyway?) or bail out whenever we can, as soon as a disabled protocol
was found in a configuration. This change also makes the behavior
of different back-ends consistent, since it's a general code-path
that reports the same SslInvalidUserData error. Update auto-test to
... actually test what it claims it tests.

Task-number: QTBUG-72196
Task-number: QTBUG-72179
Change-Id: I548468993410f10c07ce5773b78f38132be8e3e0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-21 03:28:47 +00:00
David Faure
50d53533e5 QCommandLineParser: show application name in error messages
Change-Id: I2c39759294ca0a11a59b9a38207bf1aef941b070
Fixes: QTBUG-58490
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-20 14:16:00 +00:00
Christian Ehrlicher
7863be3115 QTableView: Fix keyboard navigation with disabled rows
The keyboard navigation with MovePageUp/Down and MoveEnd did not honor
disabled cells in all cases which lead to inconsistencies in the
navigation (esp. since MoveHome does honor them correctly).
Therefore make sure that all four move operations work consistent by
refactoring the code to use common functions.

Fixes: QTBUG-72400
Change-Id: I63fa3b626510d21c66f4f9b2b1bfb3261728ecaf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-18 05:33:52 +00:00
Tor Arne Vestbø
1f30434356 nativewindow: Add additional test for 8pt font size
Change-Id: I5012eb6ffee8f81da61a6fe611352ee5900a5eee
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-16 15:02:19 +00:00
Samuel Gaist
a5eabac96d moc: add support for C++11 enum struct
C++11 added the new enum class key as well as enum struct. While the
former is likely the most known and used, the later can be used in the
same contexts and with the same effects.

Currently moc doesn't parse enum struct while it does for enum class.
This patch fixes this.

[ChangeLog][moc] moc now parses enum struct the same way as enum class
therefore that keyword can be used with the Q_ENUM macro as well as
Q_FLAG and Q_DECLARE_FLAGS.

Change-Id: Iaac3814ad63a15ee4d91b281d451e786b510449c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-15 13:24:29 +00:00
Samuel Gaist
649ee12aba QRegularExpression: anchor wildcard pattern
The current implementation of wildcardToRegularExpression doesn't
anchor the pattern which makes it not narrow enough for globbing
patterns. This patch fixes that by applying anchoredPattern before
returning the wildcard pattern.

[ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression
method now returns a properly anchored pattern.

Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5
Fixes: QTBUG-72539
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-15 13:24:16 +00:00
Qt Forward Merge Bot
4b04e47be9 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Iad06d8c07dfc288c9d1a9f7ee3520285cea60546
2018-12-15 01:00:31 +01:00
Giuseppe D'Angelo
455951f590 OpenSSL: drop support for SSLv2 and SSLv3
As per RFC 6176 (2011) and RFC 7568 (2015).

Code-wise, we're left with the decision of what to do with a few
enumerators in QSsl::Protocol; I've made TlsV1SslV3 act as TlsV1,
and adjusted the description of AnyProtocol.
A new test was introduced - deprecatedProtocol() - to test that
we, indeed, do not allow use of SSL v2 and v3. protocol() and
protocolServerSide() were reduced to exclude the (now) no-op
and meaningless tests - neither client nor server side can
start a handshake now, since we bail out early in initSslContext().

[ChangeLog][QtNetwork][SSL] Support for SSLv2 and SSLv3
sockets has been dropped, as per RFC 6176 (2011)
and RFC 7568 (2015).

Change-Id: I2fe4e8c3e82adf7aa10d4bdc9e3f7b8c299f77b6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-13 15:59:37 +00:00
Mitch Curtis
32fd79a20f QAbstractSlider: fix invertedControls having no effect for left/right keys
There was a comment in the code that said:

// It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.

It's not clear what that was referring to, but in its current state,
a slider with invertedControls set to true will not behave as expected:
pressing the left arrow key will decrease its value instead of increasing it,
and vice versa for the right arrow key.

As stated in the documentation (and by its name), invertedAppearance only
controls the appearance of the slider, and not the effect of key events.

Remove the comment and use invertedControls instead.

Change-Id: I13296cbda9244413978ef0d7f0856065f74fd0bf
Fixes: QTBUG-25988
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-13 10:46:22 +00:00
Mitch Curtis
35602d75d3 Refactor tst_QAbstractSlider::keyPressed()
Don't do several tests at once in the test function. Instead, move
the extra tests to the data function. This makes it possible to easily
add a self-contained test (i.e row) for an upcoming fix.

Task-number: QTBUG-25988
Change-Id: I65c8d7620f01107f8f59c96896b1a641d97f5fdc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-13 10:46:18 +00:00
Friedemann Kleint
ac7265e950 uic: No longer generate static_cast for enum values in legacy forms
Add a lookup for the affected enum values and use the names instead.

Task-number: PYSIDE-797
Change-Id: I6be166409000aff83d9465c9a3b2f37b44c5c085
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-13 07:11:12 +00:00
Joni Poikelin
eaf4438b35 Make url normalization closer to common browser behavior
Firefox, Chrome and various http libraries normalize /./ and /../ from
urls, but retain multiple adjacent slashes as is. Qt removes
duplicated slashes which makes it impossible to access some web
resources that rely on those.

Fixes: QTBUG-71973
Change-Id: Ie18ae6ad3264acb252fcd87a754726a8c546e5ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-13 05:23:12 +00:00
Qt Forward Merge Bot
4e2e7078b8 Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-13 02:30:54 +00:00
Qt Forward Merge Bot
ad4f359f80 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I0fe623517af28e408b642c879efd59f633ab63ac
2018-12-13 01:00:11 +01:00
Allan Sandfeld Jensen
fc2ec95587 Add Grayscale16 Image Format
[ChangeLog][QtGui][QImage] Added support for 16-bit grayscale format.

Together-with: Aaron Linville<aaron@linville.org>
Task-number: QTBUG-41176
Change-Id: I5fe4f54a55ebe1413aa71b882c19627fe22362ac
Reviewed-by: Nick D'Ademo <nickdademo@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-12 22:26:49 +00:00
Thiago Macieira
d20c980576 Resources: reject compressed content we can't decompress
This solution is composed of two features:

1) C++ code generated by RCC uses two symbols exported from QtCore that
are only present if the feature was compiled in. If the feature was not
compiled in, this will cause a linker error either at build time or at
load time (if they were functions, the error could be at runtime).

2) Binary files generated by RCC have a new header field containing
flags. We're currently using two flags, one for Zlib and one for
Zstandard.

This means we now have binary RCC format version 3.

Change-Id: I42a48bd64ccc41aebf84fffd156545fb6a4f72d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-12 16:36:09 +00:00
Friedemann Kleint
d1cafa3eba qt_imageFromWinHBITMAP(): Fix memory corruption when converting from bitmaps with low depths
Insufficient memory was allocated when asking GetDIBits() to convert to 32bit.
Fix allocation size and use a QScopedArrayPointer.

Fixes: QTBUG-72343
Change-Id: I45f79c913a243316e01bc6efed08e50ccc7d25f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-12-12 16:08:10 +00:00
Vitaly Fanaskov
ceebad9bd2 tst_QMessageBox: Modernize and simplify code
Changed 0 to nullptr, used more C++-style casts, simplified some
code for searching a button, and changed foreach to range-based for
loop.

Task-number: QTBUG-44131
Change-Id: I211b12751b0e2591d1d14294c31b51d52bb4e3f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2018-12-12 13:58:16 +00:00
Ryan Chu
c820e0b117 Revert "Disable Docker-based test servers on Linux temporarily"
This reverts commit 4b1ce72c23.

The required SHA-1 updates were integrated as:
qt/qt5    ce3791a214f69b6f0310bfe1d5bcc12ac6927c49
qt/qtbase 75ee55e22a

Change-Id: Ic389128ea9b507c506b18a47090930329a4ff6a2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-12 09:12:16 +00:00
Tor Arne Vestbø
f10b980840 nativetext: Fix baseline positioning for CoreText
The Qt and CoreText positioning is now in sync.

Change-Id: I0cbb5b150d1bef732674b8d42c64a040773a62ab
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-11 23:41:47 +00:00
Edward Welbourne
ab448f731e Handle QCollator with locale C by delegating to QString
Previously, the C locale was treated as English because each back-end
takes the locale's bcp47Name(), which maps C to en. However, the C
locale has its own rules; which QString helpfully implements; so we
can delegate to it in this case. Extended this to sort keys, where
possible. Clean up existing implementations in the process.

Extended tst_QCollator::compare() with some cases to check this. That
required wrapping the test's calls to collator.compare() in a sign
canonicalizer, since it can return any -ve for < or +ve for >, not
just -1 and +1 for these cases (and it'd be rash to hard-code specific
negative and positive values, as they may vary between backends).

[ChangeLog][QtCore][QCollator] Added support for collation in the C
locale, albeit this is only well-defined for ASCII. Collation sort
keys remain unsupported on Darwin.

Fixes: QTBUG-58621
Change-Id: I327010d90f09bd1b1816f5590cb124e3d423e61d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-11 19:05:07 +00:00
Allan Sandfeld Jensen
9fbce8d5cb Avoid crash in blitting or fast draw when QPointF is too big
Change-Id: I88182d5d95fda15d33836f16dee78167685b3765
Fixes: QTBUG-72392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-12-11 18:32:53 +00:00
Christian Ehrlicher
e56c79dc9d QTreeWidget: mark is/setFirstItemColumnSpanned() as deprecated
Deprecate the QTreeWidget functions is/setFirstItemColumnSpanned() to
stay in sync with the other deprecated functions
(selected/expanded/hidden) so they can get removed in Qt6.
Also add a small unit test for them.

Change-Id: Ie1cb5d7163c2d56d653c21e841ccaf7d38569787
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-11 06:46:42 +00:00
Ryan Chu
75ee55e22a Docker Provisioning: Update the SHA-1 tag of server images
This update is used to free the dependencies of the specific Ubuntu
packages. It ensures that test server is using the latest version of the
Ubuntu packages to test network changes.

Change-Id: I3257f435e6da02e3c6d5a141ece9c5d025e13065
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-10 22:41:20 +00:00
Jesus Fernandez
b3008f8e25 Use QScopedPointer instead of new/delete
Change-Id: I0651ad0244c1b4d3126a1dd3304f247f92240ffa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-12-10 22:14:56 +00:00
Lars Knoll
fc85a6b6b9 QTypeInfo: use C++11 type traits to deduce if a type is static or complex
All types that can be trivially copied and destructed are by definition
relocatable, and we should apply those semantics when moving them in
memory.

Types that are trivial, are by definition not complex and should be
treated as such.

[ChangeLog][QtCore] Qt Containers and meta type system now use C++11
type traits (std::is_trivial, std::is_trivially_copyable and
std::is_trivially_destructible) to detect the class of a type not
explicitly set by Q_DECLARE_TYPEINFO. (Q_DECLARE_TYPEINFO is still
needed for QList.)

Done-with: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Change-Id: Iebb87ece425ea919e86169d06cd509c54a074282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-10 08:13:58 +00:00
Samuel Gaist
b2297e595c QUrlQuery: Implement initializer list constructor
[ChangeLog][QtCore][QUrlQuery] QUrlQuery now provides an
initializer list constructor. It can be created using a list of
key/value pairs.

Fixes: QTBUG-68645
Change-Id: Ief5939aa477718f6dd3580f2c60f95ff3aa892ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-09 11:35:27 +00:00
Qt Forward Merge Bot
fc11604964 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I10ae61ec6867b38601d85d6fc34e1f6a6ba0cc11
2018-12-09 01:00:43 +01:00
Tor Arne Vestbø
e12aad05f0 Add manual test case for verifying our text rendering
Allows comparing Qt's text rendering to the native rendering.

Change-Id: I56f015fb64df3f70c33db58891876c325cbbc55d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-08 15:27:06 +00:00
Shawn Rutledge
c4ee125891 Set QScroller's parent to its widget, for memory management
If the widget to which the scroller was assigned is deleted, the
QScroller ought to be deleted too, to avoid filtering events and then
following a dangling pointer while trying to react.

Fixes: QTBUG-71232
Change-Id: I62680df8d84fb630df1bd8c482df099989457542
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
2018-12-08 07:18:15 +00:00
Qt Forward Merge Bot
f8c5c13564 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ied1194730e75a6f30839bbf5429aa2699230288e
2018-12-08 01:01:00 +01:00
Thiago Macieira
962bded90f Fix QSettings parsing of spaces after comment lines
[ChangeLog][QtCore][QSettings] Fixed QSettings parsing of blank spaces
after comment lines in INI-style configuration files.

Fixes: QTBUG-72007
Change-Id: Idd0c85a4e7b64f9c9c7dfffd156c5b219f3b5c0a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-12-07 18:53:34 +00:00
Edward Welbourne
4ee59cf96d Remove one out-of-date comment, refine another that was imprecise
The former is a follow-up to c17563eca8.

Change-Id: I3cd41e6e38f740de67605f785a804ffd879b9e67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-07 15:59:38 +00:00
Edward Welbourne
7c7e007794 Add a testlib selftest for the watchdog
Verify that it does cut in after the specified time has elapsed.

Task-number: QTPM-1385
Change-Id: Ib18e8d6af28339f79cca4d62b869287ce07b8cc1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-06 18:29:47 +00:00
Edward Welbourne
c3e6551d4d generate_expected_output.py: refine environment used for subtests
Match the environment tst_selftests.cpp uses for subtests more
faithfully.  Extends b22e50acda.  In the process, tweak how crashers
are handling, in preparation for the watchdog test.

Change-Id: I09a046460f6f3bff0b12069fad6c1437d89572ce
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-06 18:29:35 +00:00
Edward Welbourne
dfcb7fce35 Test that mismatches of datatype in test data columns are rejected
One test for bad data for the column, another for a bad QFETCH.
Incidentally extend blacklist testing by blacklisting them.
Reorganise a QEMU condition that needed extended as part of this.

Task-number: QTPM-1385
Change-Id: Iac72ada19760321c5c9264ddfff7740d1fdd0700
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-06 18:29:22 +00:00
Nick D'Ademo
1986392255 QMdiArea: Do not move active subwindow after tile rearrange
Currently, a tile rearrange will move the active subwindow (if any)
to position zero (top-left). This ignores any tiling order set via
setActivationOrder(). This change removes this move so that the set
tiling order is respected when a tile operation is performed.

Fixes: QTBUG-43356
Change-Id: I2c481f0ffe45e42e811c6b6d476eb4cb65aa5d1f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-06 09:06:18 +00:00
Timur Pocheptsov
6a28f67677 Add tst_QOcsp auto-test
This patch introduces a private 'API' to enable server-side OCSP responses
and implements a simple OCSP responder, tests OCSP status on a client
side (the test is pretty basic, but for now should suffice).

Change-Id: I4c6cacd4a1b949dd0ef5e6b59322fb0967d02120
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-06 05:14:45 +00:00
Christian Ehrlicher
e2f473f4d4 QListWidget: mark (is|set)Item(Selected|Hidden) as deprecated
QListWidget::(is|set)Item(Selected|Hidden)() are deprecated for a long
time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.

Change-Id: I4567e740f1ebb5841b2e5b50c601fb83a782950c
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-04 21:01:18 +00:00
Liang Qi
009a5538eb Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-04 19:41:52 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Nick D'Ademo
4c58569085 QMdiArea: Take scroll bars into account when tiling subwindows
QMdiAreaPrivate::resizeToMinimumTileSize() does not take into account
scroll bars when calculating the minimum size for the QMdiArea widget.
As a result, if scroll bars are enabled or showing during a tiling
operation, the top-level widget incorrectly expands in size (instead of
utilizing the scroll bars). Therefore, we should only resize the
top-level widget if scroll bars are disabled.

Fixes: QTBUG-40821
Change-Id: I3a8b7582d23fdf12d2b09f3740eea6b60bb395c3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-04 07:39:16 +00:00
Friedemann Kleint
f213e818f0 uic: Generate correctly qualified invocation of QCoreApplication::translate()
Change QApplication::translate() to QCoreApplication::translate()
in generator and tests.

Task-number: PYSIDE-797
Change-Id: I0bbaf1f280b74b3b2a701a39203c059ab82fce1f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-03 19:05:03 +00:00
Ryan Chu
4b1ce72c23 Disable Docker-based test servers on Linux temporarily
To unlock dev branch, we need to disable the Docker-based test server on
Linux for short-term. With this change, we can force update the SHA-1 of
docker images in both qt5 and qtbase. During this transitional period,
the Linux platform should keep using the remote test server.

Change-Id: I4c07abf36154382e5d667ca733901b6d7fda9677
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-03 16:53:49 +00:00
Friedemann Kleint
6fbf50248d Brush up tst_QUrl
Fix clang-tidy warnings:
- Use range-based for and streamline some code
- Use nullptr

Change-Id: Iad43490d0e968baa76d54d3bf81558a48b19cdbd
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2019-06-11 09:16:31 +02:00
Giuseppe D'Angelo
3e75c2965c Remove QLatin1Literal usages
That's an undocumented Qt 4/3/2 remnant, start remove usages.

Fix incorrect include header in qclass_lib_map.h as a drive-by.

Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 16:50:31 +00:00
Christian Ehrlicher
b16fab1b63 Fix deprecation warnings
Fix deprecation warnings - replace qFindChild/Children() with
QObject::findChild/Children() and replace some 0 with nullptr.

Change-Id: If2f01d12fa91d09d98a61f73b0449a6773ac93db
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-27 22:16:32 +02:00
Friedemann Kleint
deaf044b2e Fix deprecation warnings in tst_QUrl
Change-Id: I8b1877c57d0bd061908d83c0feacfb4a4d4c3868
Reviewed-by: David Faure <david.faure@kdab.com>
2019-05-29 08:24:52 +02:00
Edward Welbourne
548513a4bd Separate out the time, zone, date code from corelib/tools/
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.

Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-06 15:54:32 +02:00
Shawn Rutledge
29e3a4dfea Fix warnings & deprs in tst_qcoreapplication and tst_qguiapplication
It's perhaps best to ensure that functions we are deprecating shall no
longer be used in tests.  Also, fix the "0 as nullptr" warnings.

Change-Id: I2f22c9b9482e80fa120bcd728ec269198a36678f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-05 13:01:13 +02:00
Shawn Rutledge
b3cc9403c4 QTextMarkdownWriter: write fenced code blocks with language declaration
MD4C now makes it possible to detect indented and fenced code blocks:
https://github.com/mity/md4c/issues/81
Fenced code blocks have the advantages of being easier to write by hand,
and having an "info string" following the opening fence, which is commonly
used to declare the language.

Also, the HTML parser now recognizes tags of the form
<pre class="language-foo">
which is one convention for declaring the programming language
(as opposed to human language, for which the lang attribute would be used):
https://stackoverflow.com/questions/5134242/semantics-standards-and-using-the-lang-attribute-for-source-code-in-markup
So it's possible to read HTML and write markdown without losing this information.

It's also possible to read markdown with any type of code block:
fenced with ``` or ~~~, or indented, and rewrite it the same way.

Change-Id: I33c2bf7d7b66c8f3ba5bdd41ab32572f09349c47
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-06-04 08:01:34 +02:00
Anton Kudryavtsev
638f2749a0 QLatin1String, QStringView: add contains
[ChangeLog][QtCore][QLatin1String] Added contains().

[ChangeLog][QtCore][QStringView] Added contains().

Change-Id: I19fd2e155180edd8620c520f4e60a1f86f0603ac
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-04 10:07:26 +00:00
Shawn Rutledge
237fa21fee Markdown and HTML: support image alt text and title
It's a required CommonMark feature:
https://spec.commonmark.org/0.29/#images
and alt text is also required in HTML:
https://www.w3.org/wiki/Html/Elements/img#Requirements_for_providing_text_to_act_as_an_alternative_for_images
Now we are able to read these attributes from either html or markdown
and rewrite either an html or markdown document that preserves them.

This patch does not add viewing or editing support in QTextEdit etc.

Change-Id: I51307389f8f9fc00809808390e583a83111a7b33
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-06-01 21:13:58 +02:00
Shawn Rutledge
0eb26c1443 QTextBrowser: detect and load markdown rather than assuming HTML
So we add the QTextDocument::ResourceType::MarkdownResource enum value to indicate
the type.  QMimeDatabase is generally unable to detect markdown by "magic", so we
need to use the common file extensions to detect it (the same extensions as declared
in the mime database XML).

Change-Id: Ib71f03abd535c17e5a8c99bd92d0a6062e972837
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-30 16:37:23 +00:00
Shawn Rutledge
a5b373e0db tst_qtextbrowser: add markdown test data to TESTDATA
It's necessary to make the test pass on certain platforms.

Change-Id: I717d492df437c0ffb75b21d9ef23ce602160fad1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-01 17:11:42 +02:00
David Faure
341c8b9cd0 QCommandLineParser: add --help-all, to show Qt options as well
Sample output at http://www.kdab.com/~dfaure/2019/help-all-example.txt

Fixes: QTBUG-41802
Change-Id: I7a3350200761d41481fcb10ec4328e96e548d246
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-15 15:28:18 +02:00
Marc Mutz
4469e36d72 qhashfunctions.h: add specializations of std::hash for some Qt types
We have a problem. Our types don't play well with the std unordered
containers, because they do not specialize std::hash. We therefore
force our users to come up with an implementation, hindering
interoperability, since any two developers are unlikely to come up
with compatible implementations. So combining libraries written by
different developers will result in ODR violations.

Now that we depend on C++11, and thus the presence of std::hash, we
still face the problem that the standard does not provide us with a
means to compose new hash functions out of old ones. In particular, we
cannot, yet, depend on C++17's std::hash<std::string_view> to
implement std::hash<QByteArray>, say. There's also no std::hash for
std::tuple, which would allow easy composition by using std::tie().

So piggy-back on the work we have done over the years on qHash()
functions, and implement the std::hash specializations for Qt types
using the existing qHash() functions, with a twist: The standard
allows implementations to provide means against predictable hash
values. Qt has this, too, but the seed is managed by the container and
passed to the qHash() function as a separate argument. The standard
does not have this explicit seed, so any protection must be implicit
in the normal use of std::hash.

To reap whatever protection that std library has on offer, if any, we
calculate a seed value by hashing int(0). This will be subject to
constant folding if there's no actual seed, but will produce a value
dependent on the seed if there is one.

Add some tests.

A question that remains is how to document the specialization. Can we
have a \stdhashable QDoc macro that does everything for us?

Task-number: QTBUG-33428
Change-Id: Idfe775f1661f8489587353c4b148d76611ac76f3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-05-29 11:22:20 +02:00
Shawn Rutledge
280d679c55 QTextMarkdownWriter: fix some bad cases with word wrap
If any non-breakable content (such as a link) already went past
80 columns, or if a word ended on column 80, it didn't wrap the rest of
the paragraph following.

Change-Id: I27dc0474f18892c34ee2514ea6d5070dae29424f
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-24 15:37:05 +02:00
Shawn Rutledge
7224d0e427 QTextMarkdownImporter: don't keep heading level on following list item
When reading a document like

 # heading
 - list item

and then re-writing it, it turned into

 # heading
 - # list item

because QTextCursor::insertList() simply calls QTextCursor::insertBlock(), thus
inheriting block format from the previous block, without an opportunity to
explicitly define the block format.  So be more consistent: use
QTextMarkdownImporter::insertBlock() for blocks inside list items too.  Now it
fully defines blockFormat first, then inserts the block, and then adds it to
the current list only when the "paragraph" is actually the list item's text
(but not when it's a continuation paragraph).  Also, be prepared for applying
and removing block markers to arbitrary blocks, just in case (they might be
useful for block quotes, for example).

Change-Id: I391820af9b65e75abce12abab45d2477c49c86ac
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-24 15:37:05 +02:00
Ryan Chu
c1fc47b06a Disable Docker-based test servers on macOS temporarily
The tests of QNetworkReply keep failing due to VT-x is not available in
Coin environment. The VT-x/AMD-v feature is necessary when starting the
virtual machines. Before VT-X is added back to the CPU features, the
macOS platform should keep using the remote test server.

Task-number: QTQAINFRA-2288
Change-Id: Ib37d0e7a5fb1fb4ed5484f925f5023b19467e672
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-12-03 09:24:25 +00:00
Lars Knoll
c4daa2b527 Fix compilation
::link() is defined in unistd.h, so include it.

Change-Id: I58e99dbcdd64da6388f85d98e73e7d1bd56f4e37
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-12-03 07:53:00 +00:00
Lars Knoll
86aabb500c Add lancelot tests to verify vertical alignment of inline images
Adds a test case for 199f9c5448.

Task-number: QTBUG-59310
Change-Id: Iee26f8bc21884da36471935f64524b62c3f79ff4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-12-03 07:52:55 +00:00
Mårten Nordheim
17ced070fd Read font selection flags and use them when querying for metrics
Certain fonts with multiple styles have the same family name. When
loading these as application fonts we were not specific enough when
querying for the text metrics. This meant that e.g. the bold version in
a font family would get the metrics of the regular one.

Fixes: QTBUG-67273
Change-Id: Ic988d62cddde0a1f77ddcaf2891cadc21c9b31e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-30 16:15:03 +00:00
Ville Voutilainen
c0dd445564 Fix a nullptr compile error with gcc 4.8
template argument deduction/substitution failed:
qtbase/tests/auto/corelib/kernel/qobject/tst_qobject.cpp:6756:71: note:   mismatched types ‘const typename QtPrivate::FunctionPointer<Func2>::Object*’ and ‘std::nullptr_t’

Change-Id: I8e7872457d1fc30c4b29e96c16091915264f9bce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-30 14:50:00 +00:00
Ulf Hermann
042707a633 Avoid invalid qmake code in macOS-specific pluginloader test
You cannot manipulate variables in custom target dependencies, so the
following code was invalid:

i386_d.depends = EXPORT_VALID_ARCHS=i386

In order to still build the fat binary, we split the project in four,
one for each architecture, plus one to create the final package.

Change-Id: If08cf54e2e4098a7e10df41b7ea8d2bf699f58be
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 14:47:29 +00:00
Richard Moe Gustavsen
f1812aad89 QFocusFrame: protect it from being moved around by accident
If a focus frame is set around a widget that exist inside a
QAbstractItemView, both the focus frame and the widget will
be scrolled when the table is scrolled (since the focus frame
is a child of the view). The result is that after the widget
has been scrolled (which will move the focus frame to the
correct position as well), the focus frame will be scrolled
next, and therefore away from the widget.

This patch will catch this case by always adjusting the
focus frame position when someone tries to move it. Trying
to move the focus frame away from the widget it tracks
will anyway be flaky.

Fixes: QTBUG-63877
Change-Id: Ic2aacc4fafc219280e32092c258a7539d0db9cd0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-27 14:59:52 +00:00
Shawn Rutledge
a5e32f9375 Re-enable the QScroller tests on macOS
Maybe they aren't flaky anymore... let's find out.

Task-number: QTBUG-29950
Task-number: QTBUG-30133
Change-Id: I1a2a3ef7facac5b6e59588d7c6b1b28b40a788ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-27 14:57:35 +00:00
Allan Sandfeld Jensen
d1f924bbce Fix tst_QStyleSheetStyle crash on uncommon multi-screen setup
It would crash if there is no screen at 0,0.

Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-27 14:46:08 +00:00
Qt Forward Merge Bot
ec5e692c1c Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I04afffdce6b78856d0301eb583f21d334c7466b0
2018-11-27 01:00:36 +01:00
Qt Forward Merge Bot
1b5bbacdb0 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
2018-11-27 01:00:09 +01:00
Vitaly Fanaskov
ba13c6c08f Fix calculation of text margin if line edit contains side widgets
The previous implementation leads to infinite chain of showing/hidden
line edit under circumstances described in QTBUG-54676. We basically got
the situation when size hint were calculated differently depending on
the line edit visibility state. In this case toolbar layout have to
show/hide extension button and line edit a lot of times and can never
leave this "loop" (please note, that the chain is much more complicated
in reality):
Resize toolbar -> Set layout geometry -> Size is OK to display line edit
-> Set layout geometry -> Hide extension button -> Set layout geometry
(wrong size is calculated here, so "run out of space") -> Hide line edit
-> Set layout geometry -> Show extension button -> Set layout geometry -
> Size is OK to display line edit ... And we're in the "loop"

Clear button is hidden if there is no text in a line edit.
In the previous implementation, the button was always visible, only
opacity was changing in order to "hide" the button. It resulted to
incorrect size hints (regular and minimum).
In the current implementation the button is really hidden/shown, and
size hints calculated correctly.
Also updated unit test for line edit.

Remove code duplication in functions for calculation text margin

Fixes: QTBUG-54676
Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-26 16:03:33 +00:00
Sami Nurmenniemi
71bd06d516 Make developer build tests pass for boot2qt
Some tests were fixed and others were skipped/blacklisted.

Task-number: QTBUG-63152
Change-Id: Ica7df555f8d152ee589865911130525101d4b941
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-11-26 07:06:59 +00:00
Lars Knoll
b98c43ea60 Compile with QT_STRICT_ITERATORS defined
This will be the only options for Qt 6, so make sure the code compiles now.

Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-26 07:04:24 +00:00
Lars Schmertmann
079df681ec Amend 7f77dc84fb to simplify the parameters of createPlainTestRows
Change-Id: I61370a46722f729ea53cb365eab556a97ec5ee7b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-24 07:15:16 +00:00
Lars Schmertmann
de83447830 Add support for Diffie-Hellman keys to QSslKey
This is necessary to provide details for the key too,
when the server is using DHE-RSA-AESxxx-SHAxxx.
Amends 7f77dc84fb.

Change-Id: I8ab15b6987c17c857f54bc368df3c6c1818f428c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-23 22:58:05 +00:00
Christian Ehrlicher
1414407970 tst_QTreeView: set keyboardInputInterval to a smaller value
keyboardInputInterval() is 400ms by default which slows down the
testcase without a good reason.
Set it to 100ms which speeds up the testcase from 20s to 10s on my
system.

Change-Id: Ib883c5d3f09f8e896ae56a8fc8df2233be63de01
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-23 15:44:29 +00:00
Edward Welbourne
d8b401959f Recognize E along with e as exponent character in asciiToDouble
Fixed a misguided condition in the check for bogus texts in the sscanf
branch of the decoder; it checked for 'e' but neglected 'E', which is
just as valid.

Change-Id: I9236c76faea000c92df641930e401bce445e06c8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:33 +00:00
Edward Welbourne
ce159d1a3e Fix toFloat()s between float and double ranges and document
Revised some toFloat()s to be consistent with the matching
toDouble()s; previously, they would return infinity if toDouble() did
but return 0 if toDouble() got a finite value outside float's range.
That also applied to values that underflowed float's range, succeeding
and returning 0 as long as they were within double's range but failing
if toDouble() underflowed.  Now float-underflow also fails.  Amended
their documentation to reflect this more consistent reality.
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toFloat] QString, QByteArray and QLocale returned
an infinity on double-overflow (since 5.7) but returned 0 on a finite
double outside float's range, while setting ok to false; this was at
odds with their documented behavior of returning 0 on any failure.
They also succeeded, returning zero, on underflow of float's range,
unless double underflowed, where they failed.  Changed the handling of
values outside float's range to match that of values outside double's
range: fail, returning an infinity on overflow or zero on underflow.
The documentation now reflects the revised behavior, which matches
toDouble().

Change-Id: Ia168bcacf7def0df924840d45d8edc5f850449d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:24 +00:00
Edward Welbourne
a992367403 Change documentation of some toDouble()s to reflect reality
They actually return infinity if conversion overflows, while still
setting ok to false; they were documented to return 0 on failure, with
no mention of this special handling of overflow.  Documented reality
rather than changing the behavior.  Gave underflow as an example of
failure other than overflow (toDouble()s do indeed fail on it).
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toDouble] QString, QByteArray and QLocale return
an infinity on overflow (since 5.7), while setting ok to false; this
was at odds with their documented behavior of returning 0 on failure.
The documentation now reflects the actual behavior.

Fixes: QTBUG-71256
Change-Id: I8d7e80ba1f06091cf0f1480c341553381103703b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:06 +00:00
Edward Welbourne
704137f8de tst_QLocale: Add tests for toFloat()
Mirror those for toDouble().

Change-Id: Ide0ef3cd99528d575f6a578ef19547f3b1119c5d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:04:56 +00:00
Edward Welbourne
108c9015b9 Implement transient locale as instantiating a class
A couple of QLocale tests were using setlocale twice to provide a
transient locale tweak in tests; however, if the test in between
fails, that can leave the program running in the "transient" locale
after.  So implement a proper class whose destructor ensures the
transient is tidied away.  Also change the locale in use by one of
these transient changes: it purported to be checking things didn't
depend on locale, but was using the same local as most of the
test-cases for its test.

Change-Id: I0d954edcc96019a8c2eb12b7a7c568e8b87a41d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:04:46 +00:00
Christian Ehrlicher
794140fb86 QGraphicsProxyWidget: Don't crash within setWidget() when a child proxy has no assigned widget
QGraphicsProxyWidget::setWidget() is checking if the newly assigned
widget is already assigned to a child proxy widget without checking if
the child has a widget assigned at all which lead to a nullptr reference
if it is not the case.
Therefore check if the assigned widget is a valid pointer.

Fixes: QTBUG-15442
Change-Id: I006877f99895ca01975bdcad071cfcf90bea22ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-22 16:43:38 +00:00
Joerg Bornemann
eef9b4f0d5 Use msvc qmake scope where appropriate
Use 'msvc' instead of 'win32-msvc' or even 'win32-mscv*'.

Change-Id: I21dc7748a4019119066aea0a88a29a61827f9429
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-22 14:16:52 +00:00
Joerg Bornemann
c02d579c56 Remove usage of win32-msvc2012 qmake scope
We don't support MSVC 2012 anymore.

Change-Id: I454ba0f8e893f5910a17e473ab7cf70a1c581e81
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-22 10:16:08 +00:00
Liang Qi
bf58c70546 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/io/qdir.cpp
	src/corelib/kernel/qtimer.cpp
	src/corelib/kernel/qtimer.h

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
2018-11-22 01:53:29 +01:00
Liang Qi
41cba737a9 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I909c9cfa0ce80f512de4b4986e626eae66b63afa
2018-11-21 19:34:18 +01:00
Liang Qi
46076f7333 tst_QNetworkReply: Blacklist getFromHttp:success-external
Task-number: QTBUG-71953
Change-Id: I449ee3be8fa748046895386c9cbff90b30ed80c4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-21 16:02:52 +00:00
Allan Sandfeld Jensen
37f617c405 Add qfloat16 support to QCOMPARE
Change-Id: Ide06f215a888328308a06e7e48edd666f790a5f0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-20 21:34:13 +00:00
Frederik Gladhorn
e00c73911a Reduce run time of tst_QRegularExpression::threadSafety
This test was taking so much time that it regularly timed out on WinRT
and when running in qemu. Reduce it from around 40 to 7 seconds on a
powerful desktop.
Now it either runs for two full seconds for each test function or until
it has done 50 iterations.

Fixes: QTBUG-71405
Change-Id: If752c1e65d3b19009b883f64edc96d020df479d1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-19 11:45:38 +00:00
Liang Qi
4d180586cd Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm

Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
2018-11-19 12:42:10 +01:00
Thiago Macieira
6b088b7a1d QResourceFileEngine: fix use of mapped files after close()
QFile::map() is documented to continue working after the QFile is
closed, so this should work for the resource file engine too.

Change-Id: I343f2beed55440a7ac0bfffd1563243a3966441f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-19 09:09:36 +00:00
Thiago Macieira
6a792d6f0b QResourceFileEngine: fix map() for compressed files
We were returning a pointer to the compressed data and comparing to the
compressed data size.

Change-Id: I343f2beed55440a7ac0bfffd1563232d557c9427
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 09:09:31 +00:00
Thiago Macieira
460866ee47 tst_QResourceEngine: use QTest::addRow instead of QString concatenation
Change-Id: I343f2beed55440a7ac0bfffd156322c95aebb847
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-11-19 09:09:26 +00:00
Thiago Macieira
6125fce799 tst_QResourceEngine: store the actual byte contents that we expect
Instead of using a QString with only the prefix, let's do a full
comparison to make sure there's no junk at the end of the file.

Take the opportunity to remove the nonsense of a space at the end of
most of these files (I didn't remove from all).

Change-Id: I343f2beed55440a7ac0bfffd15632228c1bfe78f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-19 09:09:20 +00:00
Liang Qi
7a4f41bad9 tests: Distinguish tst_qeventdispatcher and tst_qguieventdispatcher
Both use same source, but link without and with Qt Gui library.

Task-number: QTBUG-71751
Change-Id: I5643a07a8067f5fc10fc66f717f19bc3e16a33ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-16 14:16:09 +00:00
Liang Qi
37d3bc9ad7 Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
2018-11-16 08:10:15 +01:00
Liang Qi
527406cbd9 Modernize the "settings" feature
Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-15 17:20:15 +00:00
Ulf Hermann
900b57ea90 Re-blacklist tst_QEventDispatcher::registerTimer() on macOS
The test has been failing over and over since it was removed from the
blacklist. Obviously it is not stable.

This is a partial revert of commit
b10ee45546.

Task-number: QTBUG-71773
Change-Id: Ie2588538ee704652c2f09ce6ad947da3011e7dad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-15 12:08:20 +00:00
Ulf Hermann
16830c827b Make sure QEventDispatcher::registerTimer() cleans up after itself
The test needs to also unregister its timers when it fails. Therefore,
wrap the registering and unregistering in an RAII class.

Task-number: QTBUG-71773
Change-Id: I6ef44e580880deecb32763b5b0cd71e1c26929be
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-15 12:08:11 +00:00
Oliver Wolff
6bdf1e337d tst_qguieventdispatcher: Sync blacklist with tst_qeventdispatcher
Windows and WinRT only have on event dispatcher class so that failing
test cases in one test will most likely also happen in the other.

Change-Id: Ib047c6870e6e02f3cf8deaaa6e438ed0ac7e2d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-14 18:36:05 +00:00
Friedemann Kleint
79af4ec056 Manual dialogs test: Fix shortcut
Fix:
QAction::event: Ambiguous shortcut overload: Ctrl+Q

when pressing CTRL+Q

Amends b5eb850e0d .

Change-Id: Ie31d5830ea357cd34cdd422e667ceca507c7b53f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-14 18:35:51 +00:00
Friedemann Kleint
d1e3a21631 tst_uic: Brush up the uic autotest
- Fix some clang nags (QFileInfo::exists(), raw string literals).
- Update the version numbers in the baseline to be 5.12 consistently
  to make future modifications easier.
- Introduce another environment variable to redirect the diff
  output to stderr. This can be used to generate a diff for applying
  when making larger changes to uic.

Task-number: PYSIDE-797
Change-Id: I3f6716f0fe8e5939f6bef3965d90b2bb2c37f4c4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-11-13 18:55:30 +00:00
Friedemann Kleint
24d1565789 uic: Use the Qt configure system when generating code
Replace the generation of #ifdef's for the macros by QT_CONFIG
checks. Implement it using streamable classes to make it easier
to switch the output language later.

Task-number: PYSIDE-797
Change-Id: I28b5ed3ec80cd525a3df0cd54d9be4f09149cde4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-11-13 18:53:12 +00:00
Albert Astals Cid
2569a5136e QMimeDatabase: update freedesktop.org.xml to shared-mime-info 1.10
Including 4f7ad5ec44
to make appimage not ambiguous

Change-Id: I8db13fc785b267c09667ef38430bf98135c7f0d6
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-13 11:16:11 +00:00
Qt Forward Merge Bot
0441d959ff Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
2018-11-13 01:00:13 +01:00
Allan Sandfeld Jensen
2393551665 Fix precision in parsing hex format QColors
We document being able to parse more than 8-bit per color, but were
ignoring everything after the first 8 bits.

Change-Id: Ic85ab04b0836e6979a623e294eebd5084c1a9478
Fixes: QTBUG-71373
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-11-12 22:18:43 +00:00
Friedemann Kleint
79ed504f10 Manual dialogs test: Add option to turn off the printer panel
On Linux, the printer panel impacts the application startup time,which
can be annoying when testing other dialogs.

Change-Id: Id13446047cf50765951a6bb5182ee50cae983457
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-12 13:01:05 +00:00
Tor Arne Vestbø
27fb51fa52 macOS: Remove blacklist entries for no longer supported OS versions
Change-Id: Iae6552f1fdcf1dea07a03d3788d378af9140d1a7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-12 07:16:30 +00:00
Liang Qi
58437fb125 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/serialization/qcborcommon.h
	src/corelib/tools/qlocale_data_p.h
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
2018-11-10 11:38:40 +01:00
Allan Sandfeld Jensen
60f5329854 Fix test for multiscreen
QTBUG_7714_fullUpdateDiscardingOpacityUpdate2() would fail when
it moved to another screen if there is one to the left.

Change-Id: I3f8edc04c31dffc5a3bd005d9e5170dd68151df7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-09 21:42:57 +00:00
Christian Ehrlicher
76bb804405 QTreeWidget: mark (is|set)Item(Selected|Hidden|Expanded) as deprecated
QTreeWidget::(is|set)Item(Selected|Hidden|Expanded)() are deprecated
for a long time but not marked as such. Therefore explicitly mark them
as deprecated so they can get removed with Qt6.

Change-Id: Ie4971350de61326811e0788df0d359ed3c442869
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-09 19:07:51 +00:00
Liang Qi
bc07958f92 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	.qmake.conf
	qmake/Makefile.unix
	src/gui/text/qtextdocument.cpp
	src/gui/text/qtextdocument.h

Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
2018-11-09 10:34:33 +01:00
Tor Arne Vestbø
d0e66df1a5 macOS: Skip tst_QGLThreads::renderInThread
It crashes in the render thread:

thread #7, name = 'SceneRenderingThread'
   frame #0: libsystem_kernel.dylib`__wait4_nocancel + 10
   frame #1: libsystem_c.dylib`system + 452
   frame #2: QtTest`stackTrace() + 325
   frame #3: QtTest`QTest::FatalSignalHandler::signal(int) + 207
   frame #4: libsystem_platform.dylib`_sigtramp + 26
   frame #5: libsystem_platform.dylib`_platform_bzero$VARIANT$Base + 23
   frame #6: GLRendererFloat`gldSetZero + 63
   frame #7: GLRendererFloat`gldClearDrawBuffer + 3792
   frame #8: GLRendererFloat`gldClearFramebufferData + 49
   frame #9: GLEngine`glClear_Exec + 541
   frame #10: tst_qglthreads`SceneRenderingThread::run() + 227

Task-number: QTBUG-68524
Change-Id: I6bc67cb342f77dc1a590a25af535f9bb7f0d325a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-09 08:10:36 +00:00
Tobias Hunger
757d4b85a9 Benchmark: Add _bench_ into the name of the qmap benchmark
Change-Id: I6a1790981eb56d56bc190634e796bc3736ddd475
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-08 21:34:27 +00:00
Tobias Hunger
c99544a474 benchmarks: Fix copy and paste error in .pro-file
Change-Id: I30e4c640b9299559063b0337b6639d7c5a19e1db
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-08 21:34:08 +00:00
Christian Ehrlicher
8713f22372 QHeaderView: Fix updating hidden sections during initializeSections()
QHeaderView::initializeSections() was calling updateHiddenSections()
with wrong parameters which lead to an inconsistency in the hidden
section handling.
updateHiddenSections() needs the first and last index which got removed.
Therefore we must pass the new section count for logicalFirst.

Fixes: QTBUG-55461
Change-Id: Ica06125cf19bdd500f55fd9cd59ace1795f3703f
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-08 16:54:12 +00:00
Mårten Nordheim
dec7961709 QSyntaxHighlighter: Delay all highlights until first rehighlight
When calling setDocument (directly or through the constructor) a delayed
rehighlight is initiated. Previously, if any text was changed before
this rehighlight could run it would cancel the rehighlight, even if the
changed text only caused a new block of text to be highlighted.

Fixes: QTBUG-71307
Change-Id: Ib09b664d90906f5b4427105f0e45469806f3a779
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-08 16:38:27 +00:00
Andy Shaw
97f73e9577 Handle fonts that have commas/quotes in the family name
Since the comma character was originally used as a separator, we
need to extend QFont to have setFamilies() so that we can avoid
joining the family strings together. This enables us to see the
family name as a single string and for multiple family names,
we have families().

Subsequently, this has added functions to QTextCharFormat to
account for multiple font families too. So it is now possible to
set a single one directly with setFontFamily() and multiple ones
with setFontFamilies().

This also bumps up the datastream version to 19 as QFont now
streams the families list as well.

[ChangeLog][QtGui][QFont] Add setFamilies()/families() to aid using of font families with commas and quotes in their name.
[ChangeLog][Important Behavior Changes] QDataStream version bumped up to 19 to account for changes in the serialization of QFont.

Fixes: QTBUG-46322
Change-Id: Iee9f715e47544a7a705c7f36401aba216a7d42b0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-11-08 16:08:25 +00:00
Edward Welbourne
3e36fb641e Test and document QTest::toHexRepresentation()
It's not actually exercised by anything in our source tree, but is
potentially useful and has been part of the documented public API for
some time.  So mention that the caller is responsible for delete[]ing
its return and add a test that exercises it.

Task-number: QTPM-1385
Change-Id: Ifc5284b9eb1b678cf3c9708c681311e874838fc6
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-08 15:22:21 +00:00
Thiago Macieira
e7998dc187 QCborStreamReader: make sure setDevice() clears the last error
The unit tests weren't running into this problem because the every
setDevice() was preceded by the object being initialized with the exact
same data, so there was never a previous error state. I've only changed
a couple of tests, left the other setDevice() unchanged so we test both
behaviors.

Fixes: QTBUG-71426
Change-Id: I1bd327aeaf73421a8ec5fffd1561a590e3933376
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-08 15:19:45 +00:00
Timur Pocheptsov
d786c55b9e Make tst_qsslsocket::protocolServerSide() less flaky
By accident, when we erroneously tried testing TlsV1_3 on macOS with
SecureTransport (which does not support TLS 1.3) we hit this quite
subtle problem: it can happen that a server-side socket is never
created but a client (after TCP connection was established) fails
in TLS initialization and ... stops the loop preventing
SslServer::incomingConnection() from creating its socket. Then we
dereference nullptr.

Task-number: QTBUG-71638
Change-Id: I8dc5a4c53022a25aafe2c80a6931087517a48441
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-07 12:25:12 +00:00
Friedemann Kleint
47dc810724 Manual test foreignwindows: Add option to recover lost windows
Add an option that moves windows back to the top left corner,
which is useful when some window (of some application saving its
position) is lost after changing the monitor setup.

Change-Id: If358b1ed7f481f2bb98e375e88f11049f97a4a91
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-07 11:46:50 +00:00
Timur Pocheptsov
b3ae87fe76 Add missing protocol enumerators, report TLS 1.3 if negotiated
1. Remove the conditional inclusion of DTLS versions, they made difficult
and unnecessary ugly adding new protocols (something like TlsV1_2OrLater + 4).

2. OpenSSL 1.1.1 first introduced TLS 1.3 support. OpenSSL 1.1 back-end is
compatible with OpenSSL 1.1.1, but would fail to extract/report protocol
versions and set versions like 'TLS 1.3 only' or 'TLS 1.3 or better' on a
new context.  Given 1.1.1 is deployed/adapted fast by different distros,
and 5.12 is LTS, we fix this issue by introducing QSsl::Tls1_3 and
QSsl::Tls1_3OrLater.

SecureTransport, WinRT and OpenSSL below 1.1.1 will report an error in case
the application requests this protocol (SecureTransport in future will
probably enable TLS 1.3).

Saying all that, TLS 1.3 support is experimental in QSslSocket.

Done-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Done-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: I4a97cc789b62763763cf41c44157ef0a9fd6cbec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-07 10:32:35 +00:00
David Edmundson
d761c62783 QDBusServiceWatcher namespace prefix support
This allows a user to efficiently watch for services with a common
domain prefix.

This is exposed in the API via a wildcard character in the service name.

For example creating a watcher on "org.mpris*" will match
"org.mpris.foo" "org.mpris.bar" and "org.mpris" itself. It will not
match org.mprisasdf.

Internally the argument match rules have been expanded from a single
QStringList to a struct containing args and arg0namespace. This was done
so that we can easily use argpath in match rules in the future.

Change-Id: I55882ab603cc6ba478e8c0ea9a6800f6e483a50c
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-06 09:52:09 +00:00
David Faure
fc88dd52a4 QByteArrayList: add indexOf(const char*) overload
This avoids memory allocation and data copying in e.g.
QObject::property().

Detected by heaptrack's "Temporary allocations" counter in an
application using the breeze widget style (many animations).

Change-Id: Iabdb58a3e504cb121cce906ef707b0722de89df6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-06 09:49:10 +00:00
Qt Forward Merge Bot
79c5c68dca Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-11-06 00:01:16 +00:00
Qt Forward Merge Bot
290aac23a7 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Id1e4664d3c942226b76e2c3b338df3116ff89297
2018-11-06 01:00:56 +01:00
Luca Beldi
6963efb396 New proxy model: QTransposeProxyModel
Implemented a new proxy model to transpose the source model.
Rows will become columns and vice-versa.
Both flat and tree models supported.

[ChangeLog][QtCore] New class QTransposeProxyModel to
swap rows and columns of the source model.

Change-Id: I902963c6b81aa0f63b5ad2bddca538f28b565084
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-05 23:53:01 +00:00
Christian Ehrlicher
e9bebc1281 Fix use of deprecated ItemDataRoles Background/TextColorRole
Replace BackgroundColorRole/TextColorRole with
BackgroundRole/ForegroundRole and explicit deprecate them for 5.13

Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-05 21:58:37 +00:00
Christian Ehrlicher
f06e0f62fa Fix usage of QGuiApplication::set/resetOverrideCursor
Replace all occurrences of QApplication::set/resetOverrideCursor with
the QGuiApplication::set/resetOverrideCursor since it's a static
function of QGuiApplication.

Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-05 21:57:43 +00:00
Liang Qi
eedb3a06cb Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: I12f26470e01a8582d0f02f51e20d5b742bd95d6f
2018-11-05 19:06:47 +01:00
Frederik Gladhorn
daf9ba91ae Stabilize tst_QAccessibilityLinux::testFocus
The tests would rely on the window manager giving it focus a bit too much.

Change-Id: I1b28def2c95a4f0a9665a7cf6e0c14db03df98d5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-02 13:45:49 +00:00
Edward Welbourne
3fbf8fbc85 Update to CLDR v34
This only updates data on languages already present in 5.12; once it
has merged up to dev, the scripts need to be run again to pick up a
few more languages and possibly add any more new languages present in
v34.  Change some tests to match changes in en_AU's abbreviated day
and month names.

[ChangeLog][ThirdParty][CLDR] Update locale data to CLDR v34.

Task-number: QTBUG-71144
Change-Id: I68402b5e7e9d3dba669b8ba31b9a8abd86675c6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-02 12:40:46 +00:00
Christian Ehrlicher
2b682972c2 QSqlQuery: add another testcase for bindBool()
tst_QSqlQuery::bindBool() did not check if the bool is correctly bound
as part of the WHERE statement. Add a new test to query for the bool
column and check if there is exactly one row returned.

Fixes: QTBUG-38891
Change-Id: I0bd1ceb1b30e50f67f44f5b06d68683195b78b29
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-11-02 08:27:12 +00:00
Gary Wang
e3c84b6da1 QMimeType: Use default key as fallback for comment() property
When QMimeProvider parses the shared mime database xml files,
it will read the <comment> element for mime comment and treat the
`xml:lang` attribute as locale language string. When no `xml:lang`
attr is provided, QMimeProvider will read the value and treat it as
a en_US locale string as the default key.

When we call QMimeType::comment(), it will try to get the locale
comment string with the default language (QLocale().name()), once
it can't find a matched result, it should return the default key
(which QMimeProvider set it as en_US locale before) as fallback.

Task-number: QTBUG-71314
Change-Id: I444f8159d6f19dfef6338cd79312f608d8f13394
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-02 08:27:10 +00:00
Christian Ehrlicher
a5a1f338aa QTableWidget: mark isItemSelected/setItemSelected() as deprecated
QTableWidget::isItemSelected/setItemSelected() are deprecated for a
long time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.

Change-Id: I77fffe2786751306115c3f5da0ef98ff84e35b1a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-02 05:57:03 +00:00
Christian Ehrlicher
d0f909f8db QTreeView/TableView: explicitly mark sortByColumn(int) as deprecated
QTreeView/TableView::sortByColumn(int) was deprecated a long time ago
but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13)
so we can remove it with Qt6.
Also sync the handling of the sort order changes in QTableView with the
one from QTreeView.

Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-02 05:56:58 +00:00
Christian Ehrlicher
d84a7a8128 QTreeView: add expandRecursively() to expand all items below an index
QTreeView only had functions to either expand all items or until a given
depth. What was missing is to expand all subitems for an index
programmatically which is added with this patch.

[ChangeLog][QtWidgets][QTreeView] Added expandRecursively() to expand
all items below a given index

Fixes: QTBUG-10482
Change-Id: I8fc4d50b0b7e90245840c99a0188f13c0670253a
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-02 05:56:26 +00:00
Allan Sandfeld Jensen
00674a1643 Treat shorts as int in QVariant::canConvert()
Follow the pattern of char and float, and treat shorts as a more generic
type in QVariant::canConvert()

Task-number: QTBUG-60914
Change-Id: Ib1cc7941ee47cb0fc0098f22f98a03cd6f6b63fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-01 17:31:13 +00:00
Edward Welbourne
33d7f76f0e Tweak a selftest blacklist to exercise more of the blacklisting code
In the process, corrected an inaccurate XFAIL message (an XPASS is
normally an error, unless blacklisting ignores it so turns it into a
BPASS). Added the missing .tap file to its expected output.
Documented the similarity to the silent/ selftest.

Task-number: QTPM-1385
Change-Id: Id74a1353d54af2f3bfe2c764e33c1f051958ab21
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-01 15:06:43 +00:00
Edward Welbourne
b22e50acda generate_expected_output.py: match tst_selftest's test environments
The testlib selftest sets various things in the environment for
crashing tests; the generator for its expected output should set the
same things, as they affect what output is produced.

Change-Id: Iec2ed59982ea1043582573530c33619d8e8ed08e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-01 15:06:08 +00:00
Edward Welbourne
30101884a6 Simplify tst_Selftests::compareLine by handling the trivial case first
If the two lines have identical texts, the comparison returns true.
So don't complicate various other conditions on the way there with
filtering out that case; deal with it first so they don't need to.

Change-Id: Iebd230704ce5f53d12d5afa64aab30f83bb9d407
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-01 15:05:59 +00:00
Edward Welbourne
779a73762d Fully support operator[] on QCborValue and QCborValueRef
Added operator[] to QCborValueRef and mutating operator[] both there
and in QCborValue.  If the value (referenced) is not a container, it
is replaced with a map and a reference into the result is returned.
If the value is an array and the key is a string, negative, or more
than 0xffff, the array is first converted to a map.

Change-Id: Ibbc9e480fb25eb3d05547c8a1b99e762b2a68b68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-01 15:02:46 +00:00
Heikki Halmet
b1ef104866 Blacklist tst_QWindow::exposeEventOnShrink_QTBUG54040
Change-Id: Ib87d2820c4dbdf93778997b6df11cc7d8e63cf04
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-11-01 10:27:07 +00:00
Qt Forward Merge Bot
f09fc1f352 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I6f8d3abd3247dc980dc7834801a017a89c8f4286
2018-11-01 01:01:28 +01:00
Kari Oikarinen
a952fd7d5b QObject: Fix isSignalConnected() when signals have been disconnected
The bitmap cache for the first 64 signals being connected was only set when the
connection is added. It was never unset when the connection was removed.

Internal use of the connectedSignals bitmap is not hurt by it occasionally
saying a signal is connected even though it is not, since the purpose of those
checks is avoiding expensive operations that are not necessary if nothing is
connected to the signal.

However, the public API using this cache meant that it also never spotted
signals being disconnected. This was not documented. Fix the behavior by only
using the cache if it is up to date. If it is not, use a slower path that gives
the correct answer.

To avoid making disconnections and QObject destructions slower, the cache is
only updated to unset disconnected signals when new signal connections are
added. No extra work is done in the common case where signals are only
removed in the end of the QObject's lifetime.

Fixes: QTBUG-32340
Change-Id: Ieb6e498060157153cec60d9c8f1c33056993fda1
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-10-31 10:32:41 +00:00
Jüri Valdmann
497f43c90f tst_QCborValue: Disable support for spaceship operator
Spaceship operator was disabled for QCborValue, but not the test.

Change-Id: Icb91da689f62ef6de9f4fa926346505c5e50e9eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-31 09:46:11 +00:00
Oliver Wolff
7e7514482f winrt: Skip a test row of tst_QRegularExpression::threadSafety
PCRE2 does not support JIT on winrt. This test row takes a long time
(30 seconds here) without JIT and thus might cause test timeouts in
COIN when run on winrt.

Change-Id: I79d9f6be16dbe16594ae2bf51f353acd06b3d2fe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-31 09:35:29 +00:00
Olivier Goffart
0330b967f2 Simplify the Q_FOREACH macro when using C++17
This way there is only one for loop, which is more optimizer friendly

Change-Id: Iaa02026627d5259c3eea1ff5664e8f22664eef73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-31 09:07:49 +00:00
Ivan Komissarov
95476bfcf6 qendian: Fix float conversions
Since Qt 5.10, qTo/FromBig/LittleEndian<float/double> stopped working.
It may be confusing, but big endian floats do exist, so not to break old
code, we should support them.

Change-Id: I21cdbc7f48ec030ce3d82f1cd1aad212f0fe5dd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-28 22:26:56 +00:00
Timur Pocheptsov
b10ee45546 tst_qeventdispatcher: remove macOS from the BLACKLIST
the test is stable in Qt 5.12.

Task-number: QTBUG-60993
Change-Id: I0c366567121688d9518e90b5e8f9ec1b4006b7b9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-25 11:51:53 +00:00
Timur Pocheptsov
321f11db53 tst_QLocalSocket::processConnections: remove QSKIP
on macOS, the test seems to be stable nowadays.

Task-number: QTBUG-39986
Change-Id: I18430c3feb27a5bee5474e1eb95f7d89b25f00a9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-10-25 11:51:48 +00:00
Timur Pocheptsov
95ba049f87 Remove QSKIP and bring the test back to business
on macOS, where it was skipped but where it now seems to be stable/work.

Task-number: QTBUG-39983
Change-Id: I100a57f23b43074ebacc012be247d92acc6ae336
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-25 11:51:42 +00:00
Oliver Wolff
e524724f9d tst_qfilesystemmodel: Do not use nested calls of auto test functions
Calling rowCount inside another auto test function yields unexpected
results, if rowCount fails. Without a check for QTest::currentTestFailed
the failure will not stop the calling function and other functions like
rowsInserted and rowsRemoved might happily continue even though their
requirements are not met. That caused a crash on winrt under certain
circumstances.

In addition to that TRY_WAIT now does not only wait for the given
amount of time, but also gives feedback about its result. Before
this change TRY_WAIT was basically useless, as it gave no indication
about its success/failure.

Fixes: QTBUG-71121
Change-Id: Ibd3f233a0b913db799814be97c4274d510643c74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-25 11:24:08 +00:00
Liang Qi
e28e91ae99 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/animation/qpropertyanimation.cpp
	src/gui/image/qicon.cpp
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp

Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
2018-10-25 07:21:53 +02:00
Ryan Chu
0107b695f0 Make sure docker machine is both created and running before test
Before reading the configuration of a docker machine, the machine shall
be created and started. Otherwise, the docker command will complain
about "cannot connect to the Docker daemon".

If the docker machine has not been created, the make check will be
immediately terminated, and then print the error message. If its status
is not running, the machine will be turned on by a start command.

Change-Id: I7f4c322e7bdf29e4e4203e0e1bbc2e5c8cf677be
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-10-23 05:26:31 +00:00
Frederik Gladhorn
a87f85dbf9 Linux Accessibility: Fix expandable state
The state was forgotten from the translation layer, this is important for tree views.

Fixes: QTBUG-71223
Change-Id: Ief4004fe455889f9d5a7eb018bf34d37c36a6bd9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-10-22 10:27:06 +00:00
Frederik Gladhorn
1c614d07fb tst_QAccessibilityLinux make state checking more convenient
Change-Id: I96274ab0a0f5d942746de0166df47936e2390c65
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-10-22 10:27:01 +00:00
Edward Welbourne
6c543879a3 Avoid races on TZ in environment via tzset() calls
POSIX specifies that tzset() consults environment variable TZ and
modifies some globals; it also specifies mktime(), localtime() and
strftime() to behave as if they called tzset().  Fortunately, we only
call strftime() from a test and only call localtime() when not
threaded.  Provide wrappers for tzset() and mktime() that share the
lock used by our environment-access code, to prevent races on the
environment (and tzset()'s globals) when we call them.

In the process, re-use tst_QDateTime's TimeZoneRollback in its older
test systemTimeZoneChange() and presume that this can now be tested
cross-platform, since TimeZoneRollback is used in another test where
this works.

Fixes: QTBUG-71030
Change-Id: I79f559b8857ea2803e73501008bf0d7158c6731f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-22 10:07:01 +00:00
Jüri Valdmann
cea2b5510c Fix building tests with -no-gui
Change-Id: I37307080e5adc334fcfcdd2fee650d675228a746
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-20 20:38:59 +00:00
Christian Ehrlicher
c18a91b0dc QTableWidget: fix cellChanged signal emitted by takeItem()
QTableWidget::takeItem() emitted cellChanged with row and column set to
-1. The internal functions searched for item after it was reset to
nullptr and therefore it was not found.
Since the modified cell is known because it's passed to the takeItem
function, the correct row/column can be retrieved from there.

Task-number: QTBUG-70478
Change-Id: I5ff5991c49f3200efe95fde4c7d0d28e19be7ebf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-19 12:19:20 +00:00
Frederik Gladhorn
f5962d05d3 Remove skip from tst_QWidget::updateWhileMinimized
This test works for me with KWin and is blacklisted on most linux platforms.
Let's try to remove the blacklisting next.
Using qWait right in front of the QTRY_VERIFY does not add any value.

Task-number: QTBUG-26424
Change-Id: I2dcd5fb3f3cbb64e190c777231b791d1ad9dd704
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-19 08:11:11 +00:00
Ryan Chu
c99b8a3f41 Docker-based test servers for network-related Qt autotests on macOS
There is no docker bridge on macOS. Docker document recommends using
port mapping to connect to a container; but it causes a port conflict
if the user is running a service that binds the same port on the host.
An alternative solution is to deploy the docker environment into
VirtualBox and use the host network option.

Task-number: QTQAINFRA-2293
Change-Id: I05dc65c5f8b4be7a1b1874a4ec7c034cc68679ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-10-18 19:22:46 +00:00
Ryan Chu
0d4d06647a Use environment variable to configure the interfaces of a Dante server
The internal and external keywords in the server configuration are used
to specify the network interface (IP address) that the Dante server
should bind to. Because docker-compose allows a container to join more
than one network (by adding multiple entries under the top level
networks key to a docker-compose file), the default server
configuration (danted.conf) shall be updated in accordance with the
settings in the docker-compose file.

The user can pass the setting of a docker-compose file to containers by
adding environment variables in the docker-compose file. After the
container gets created, the danted.sh script uses the input environment
variables to overwrite the default value of internal and external
interfaces before starting the Dante server.

environment:
    - danted_internal=eth1
    - danted_external=eth1
    - danted_auth_internal=eth1
    - danted_auth_external=eth1

Change-Id: I7c65cdd136ba5dac387bee5e22e1f4335e960101
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-10-18 13:18:29 +00:00
Christian Ehrlicher
aaae027435 Qt Style Sheets: fix range of hue in hsl/hsv functions
The hue parameter in hsl/hsv was treated the same way as a the other
parameters although it's range is from 0-359 and not from 0-255.
Fix it by extending the maximum range for the first parameter when
parsing a color value given in hsv or hsl.

[ChangeLog][QtGui][CSS] Fix the range of the hue parameter when parsing
a color given in hsl or hsv

Fixes: QTBUG-70897
Change-Id: I9ffa65a89c0abcca62bae35777ca1cbde3375180
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-10-18 06:36:28 +00:00
Christian Ehrlicher
d65631daa4 Qt Style Sheets: add support for hsl(a) colors
The Qt stylesheets color property did not support hsl or hsla although
CSS 2.1 does support it. Since QColor natively supports this color model
only the color parsing needed to be adjusted.
This also adds some stricter checks for a valid css color definition and
prints a warning about the issue.

[ChangeLog][QtGui][CSS] Added support for hsl/hsla colors

Fixes: QTBUG-58804
Change-Id: Ief65a36a7e0ed0d705dc1fe5a8658e8d07fe9a13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-10-18 06:36:23 +00:00
Frederik Gladhorn
4afd9234c2 Let QApplication emit paletteChanged
Only QGuiApplication would emit the signal. Untangling the duplicate
code is rather non-trivial, so left alone for now.

Fixes: QTBUG-71186
Change-Id: I4021e3b9ff39718562f4fa3a03c092436b559e9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-17 14:47:16 +00:00
Frederik Gladhorn
ccb396b401 tst_QStyleSheetStyle: use QString() instead of ""
Change-Id: I3bb375108b57059c4fb4f10342f532e20e78c152
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-17 14:47:14 +00:00
Allan Sandfeld Jensen
16ebc78ef3 Fix odd test in tst_qflags
This test triggered a compiler warning for good reason, it made no
sense, trying to change it to what it was probably meant to be.

Change-Id: I01a848272b42dae2aaa58a4f5bed998644d864da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-17 09:15:22 +00:00
Anton Kudryavtsev
aa633ff276 QMetaEnum: fix UB
Check ptr before usage.

Change-Id: Iac757a2e260b237d837318932cc0b5896c6e04c2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-17 08:48:13 +00:00
Liang Qi
ccf26f6a88 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/plugins/platformthemes/platformthemes.pro
	src/printsupport/kernel/qplatformprintdevice.cpp

Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
2018-10-17 10:35:28 +02:00
Mårten Nordheim
1859a76090 tst_QSslSocket: deduplicate datatags and don't cast to int
Some of the enums were cast to int on comparison. That just makes it
harder to know what the values were.

And verifyClientCertificate had 4 cases which were named the same as 4
others.

Change-Id: I09e8e346a6f416236a92073cf9a8f349938d37ef
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-16 10:45:41 +00:00
Ulf Hermann
402efef57b Don't drop update requests when closing and reopening windows
Before commit 4d15f393a7 update requests
were handled by a timer on QWindow. Therefore they survived the closing
and re-opening of platform windows. Now, as the timer was moved to
QPlatformWindow, it gets reset when you close the QWindow, and any
pending update requests are lost. However, we do set the
updateRequestPending variable on QWindow when requesting an update.
Therefore, we can also restore the update timer on the platform window
when creating it.

Change-Id: I23b00f24a46706beac7d1455edd8a5623db46b22
Fixes: QTBUG-70957
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-16 07:09:36 +00:00
Johan Klokkhammer Helsing
02a2144427 QToolTip: Don't crash if a tool tip is shown outside screen geometry
In some cases, a tool tip may be shown outside screen geometry, i.e. if:

- QToolTip::showText is invoked manually with a position outside.
- In tst_QToolTip::setPalette if there is no screen at (0, 0). This might
  happen in a multi-monitor setups where one screen is taller than the other.
- On Wayland windows are (by design) not allowed to know their position on
  the screen. This means that global positions can't be trusted.

This started crashing when QDesktopWidget::screenGeometry(pos) was replaced
with QGuiApplication::screenAt(pos)->geometry() because screenAt will return
null if no screen is found, while screenGeometry defaulted to the primary
screen.

This reverts to the old behavior of falling back to the primary screen.

This won't solve the issue completely for the Wayland case, but at least we
will stop crashing.

Change-Id: I42dd07cc21c2f9f0ea0d69f0c25bd46d8a2615a0
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-15 07:44:04 +00:00
Eirik Aavitsland
f2f040ae1c Improve support for QImages in QDataStream read transactions
QImage's operator>>(QDataStream&) did not set an error mode on the
stream on read failures. That would break QDataStream transactions.
Since the current QImage serialization cannot differentiate between
truncated and corrupted data, we set the ReadPastEnd error as expected
by the transaction system.

Also specify the expected file format on decoding QImage from stream,
to avoid all the format handlers' canRead() being invoked. This is
necessary since some of them may call ungetChar(), which fails when
the stream is in a transaction.

Also add testing of this feature to the QDataStram transaction
autotest. That required a slight rewrite of the fake sequential
QIODevice subclass. The previous implementation had incorrect
behavior of peek(), which is required by QImage decoders.

Task-number: QTBUG-70875
Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-15 07:18:57 +00:00
Alexandra Cherdantseva
1192c463db QImageWriter/QPNGHandler: Quality option should be CompressionRatio
Wrong option was used to set zlib compression level for png
setCompression with negative value uses default compression
setCompression with value between 0-100 converts to zlib compression level 0-9
setCompression with positive value overrides Quality option

Change-Id: Ic4b048a1e30d6940019c2a00a6c24d0c11e3f821
Reviewed-by: Alexandra Cherdantseva <neluhus.vagus@gmail.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-10-14 19:36:33 +00:00
Miguel Costa
0a7aebadfb Update ANGLE to chromium/3280
Change-Id: I0802c0d7486f772d361f87a544d6c5af937f4ca1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-13 21:36:35 +00:00
Qt Forward Merge Bot
fedcaf0256 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I2715ee7c694e5579bcedc7bab0ae68e79d5fd0b6
2018-10-13 00:07:20 +02:00
Christian Ehrlicher
bbe08d6b68 QCss: properly parse functions which contains additional spaces
When there were additional spaces between the function definition and
the first parameter, the parser failed to parse it when it contained
another function (e.g. 'qlineargradient(... rgb() ...)').
The reason for this was that ::until() needs the function at index-1 so
it can correctly count the opening parenthesis.

Fixes: QTBUG-61795
Change-Id: I992f556e7f8cd45550f83bc90aa8de2b4e905574
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-12 22:01:14 +00:00
Liang Qi
c593492d16 Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:26:15 +00:00
Eskil Abrahamsen Blomfeldt
d7944c2921 Remove QEXPECT_FAIL from test on macOS
The flakiness was reported for macOS 10.8 a long time ago and I
am not able to reproduce it, so lets remove the workaround for
it.

Task-number: QTBUG-32690
Change-Id: I92e64065c7480b8f4c5d1d1e6cb5fdd218a70313
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-10 08:24:01 +00:00
Allan Sandfeld Jensen
25830cf912 Fix builds without DTLS
Change-Id: Ic7215c7aa0bf6f7b37ae34649d809f2e1e1ee95b
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-10-09 13:14:42 +00:00
Qt Forward Merge Bot
69b6845edb Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I5cbfd39cf728036bbdfdeec8e8739568e0a3025b
2018-10-09 01:00:48 +02:00
Edward Welbourne
bc099f33dd Support QCborMap::operator[] taking a string literal
Use a template on the size of the char[], as suggested by Ville
Voutilainen.  This resolves ambiguity about whether such look-ups
should be done via QString or QCborValue (not that it would have made
any difference).

When we come to add mutating indexing of QCborValue, chained
dereferences like map[i][j][k] need to stay in operator[] const
throughout, to avoid detaching intermediates to create references into
them due to using the mutating operator[] on the earlier dereference's
return.  So const-qualify the QCborValue operator[] const variants at
the same time, to match those of QCborValue itself.

Change-Id: Ib1652ae9440fe3767a653afa2856b74040210e07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-08 14:11:23 +00:00
Samuel Gaist
5271b36672 Implement QRegularExpression overload for QPlainTextEdit::find
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QPlainTextEdit.

[ChangeLog][QtWidgets][QPlainTextEdit] Added QRegularExpression find()
method overload.

Change-Id: Id156971d3fa0372712bfa8b72a55550942a767e0
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-10-08 13:53:42 +00:00
Samuel Gaist
d348363673 Implement QRegularExpression overload for QTextEdit::find
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QTextEdit.

[ChangeLog][QtWidgets][QTextEdit] Added QRegularExpression find() method
overload.

Change-Id: Ic7be224dcc59fc8d832daddd1999a713b7f04253
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-10-08 13:53:39 +00:00
Jesus Fernandez
0c82994623 Use the stack for storing objects
Theoretically, it could improve the speed. Some of the modified lines
also make the style homogeneous.

Change-Id: Iaed7b16fa75e485be0f825220c366903525448ce
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-08 13:26:41 +00:00
Liang Qi
7344987c20 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/widgets/styles/qstylesheetstyle.cpp

Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
2018-10-08 10:56:25 +02:00
Qt Forward Merge Bot
b4da5c6b93 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/corelib/tools/qtimezoneprivate.cpp

Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
2018-10-08 10:00:49 +02:00
Jarek Kobus
9f710b15f0 uic: Write the float and double properties in 'f' format
Make the code consistent with the DomProperty::write() method.

Task-number: QTBUG-70613
Change-Id: I622b4a019a4473823584de97304f8324f2cf0c6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-05 20:06:03 +00:00
Christian Ehrlicher
559c94ea43 Unblacklist tst_QSplitter::replaceWidget(visible, not collapsed) for Linux
52f1692b84 introduced a possible fix for
this flaky test. Therefore unblacklist them to see if the change really
fixed the issue.

Task-number: QTBUG-64639
Change-Id: I759d66aac7641505487e88254d16750e87c97350
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-04 09:48:54 +00:00