Commit Graph

7980 Commits

Author SHA1 Message Date
Albert Astals Cid
f1b0ce40d6 Fix tst_QAbstractPrintDialog::setMinMax
Task-number: QTBUG-22637
Change-Id: I954988909f3ecaaf510653bf061096dd61d14fdf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-19 10:21:14 +00:00
Thiago Macieira
639ce9e55e Add nullptr comparison to Q{Explicitly,}SharedDataPointer
[ChangeLog][QtCore][QSharedDataPointer] Added operator== for nullptr.

[ChangeLog][QtCore][QExplicitlySharedDataPointer] Added operator== for
nullptr.

Task-number: QTBUG-66635
Task-number: QTBUG-66946
Change-Id: I72f5230ad59948f784eafffd151a18e34384d844
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-18 17:28:26 +00:00
Christian Ehrlicher
2cd4123661 QImage/Jpeg: decode/encode comment attributes as utf-8
Although not defined, the jpeg comment field 'content' is treated as
utf-8 nowadys. At least exiftool and exiv2 (tested via gwenview) are
expecting utf-8 here. So we should do the same.

Task-number: QTBUG-44709
Change-Id: If84dafac3e337c7993f09cd59792e721977c9adb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-18 09:29:06 +00:00
Christian Ehrlicher
633a0f5172 Fix tst_QTreeView - setSortingEnabledChild
QTreeView is stretching the last section by default which was not
considered in this test. It worked by accident on linux because
there the default section size is 100 and the default window width
is also 100. On windows this was not the case and therefore the
test failed.

Task-number: QTBUG-51149
Change-Id: I9be1c1e942fc19817713773fe29d4afa93d73232
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-03-18 09:29:03 +00:00
Qt Forward Merge Bot
d58f3c4878 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Icf3b9346117ce7149d8687e4cfa182e7586713f3
2018-03-18 01:00:11 +01:00
Friedemann Kleint
ff1630ab0e Stabilize tst_QSignalSpy::waitFunctionPointer_signalEmittedTooLate()
Replace qWait()/QCOMPARE() by QTRY_COMPARE().

Change-Id: Ic5233e2f26e6663a3fbcbb2edb09a517feef4564
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-03-17 12:10:05 +00:00
David Faure
8b6838347d QNetworkReply: fix isFinished() for disabled replies
When network access is disabled, every QNAM request returns a
QDisabledNetworkReply instance, which emits error and finished
immediately. However isFinished() was still false, which could confuse
application code.

Change-Id: Ifd43c86364b11a9583a38fde536e6c09c109b55f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-17 08:38:29 +00:00
Qt Forward Merge Bot
533b415819 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Id3e318f276fc56b5105561a1904cc242b663e9e4
2018-03-17 01:00:24 +01:00
Thiago Macieira
2fb706f9a8 QIpAddress: reject IPv6 addresses with more than 4 hex digits
Matches glibc commit 9a0cc8c1bd7645bf3c988890ffb59639c07a5812.

[ChangeLog][QtCore][QUrl] Fixed a bug in parsing IPv6 addresses with
more than 4 hex digits in a component.

[ChangeLog][QtNetwork][QHostAddress] Fixed a bug in parsing IPv6
addresses with more than 4 hex digits in a component.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=9a0cc8c1bd7645bf3c988890ffb59639c07a5812

Change-Id: I2701038131d91eb108aebb3bec16278e4efe3de2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-16 00:01:53 +00:00
Liang Qi
8edc08ef78 Revert "Blacklist tst_QWindow::testInputEvents on Windows"
This reverts commit fdddb3a481.

After b85b272c26810e54a4ceb0707cf4569f87517b67, Windows 10
(msvc2017-x86) is tested on Windows 10 (msvc2017-x86_64). The
failure is gone.

Task-number: QTBUG-66798
Task-number: QTBUG-66216
Change-Id: Iba353b18b0be1346007fde674a9f768c4b9bf384
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-15 06:13:27 +00:00
Liang Qi
f7630bcc51 Revert "Blacklist tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109 on windows ci"
This reverts commit a0db55040d.

After b85b272c26810e54a4ceb0707cf4569f87517b67, Windows 10
(msvc2017-x86) is tested on Windows 10 (msvc2017-x86_64). The
failure is gone.

Task-number: QTBUG-66756
Change-Id: I4a8e8c62b4a021d144d570c38c4f4c10e8b1317c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-15 06:13:22 +00:00
Qt Forward Merge Bot
8264e495fa Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
2018-03-15 01:00:11 +01:00
Tor Arne Vestbø
3b42e098ef testlib: Add Test Anything Protocol (TAP) reporter
The Test Anything Protocol (TAP), was originally Perl's simple text-based
interface between testing modules and test harnesses, but has since been
adopted by a large number of producers and consumers in many different
languages, which allows colorizing and summarizing test results.

The format is very simple:

TAP version 13
ok 1 - test description
not ok 2 - test description
  ---
  message: 'Failure message'
  severity: fail
  expected: 123
  actual: 456
  ...
ok 3 - test description # SKIP
1..3

The specification [1] is very brief, so the implementation has been
based on how typical consumers behave, especially when it comes to
the undefined diagnostics block.

[1] http://testanything.org/tap-version-13-specification.html

Change-Id: I616e802ea380165c678510e940ddc6607d39c92d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-14 14:28:36 +00:00
Tor Arne Vestbø
8864aca9e5 Make testlib selftests pass for shadow-builds
Using QFileInfo to check if the file exists based on the filename
alone ignores the fact that all the expected files are embedded
as QRC resources.

The expectedResult() function already does a similar check, so we
can use that directly instead of checking twice if the file exists.

Task-number: QTBUG-66981
Change-Id: I0beb8d3503ed49682ae7d7e2a5172922fab5420d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-14 14:28:34 +00:00
Laszlo Agocs
00304eac7b Revert "Set sharedPainter correctly for QGraphicsEffect"
This reverts commit 7257862fb2.

It has been reported that this patch causes widgets with certain effects
become invisible.

Task-number: QTBUG-60231
Task-number: QTBUG-66803
Task-number: QTBUG-66387
Change-Id: I9c3c4cf2f17ac639d1aee5489b665aa1e165af16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-14 12:37:53 +00:00
Friedemann Kleint
39d2a11a86 Item views: Fix 5.11 API review findings
Rename getter QHeaderView::firstSectionMovable()
to QHeaderView::isFirstSectionMovable(), turn into a property
and fix \since.

Change-Id: Ica2ca43d22f3fd78ff63178ba75014807fc9b823
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-14 12:23:27 +00:00
Edward Welbourne
c0272f98df Expand Config to Configuration in method names
Commit f55c73ede2 added various backendConfig methods;
API review for 5.11 pointed out that Config should not be abbreviated.

Change-Id: I3b294b44a030b2a6e4cdd034fa27583c228dfe42
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-03-13 14:10:50 +00:00
Tim Angus
5c7f6ee51f QSFPM: Faster row removes
When the source model of a QSortFilterProxyModel has rows removed, a
mapping is performed in order to figure out which corresponding rows in
the sorted and filtered view of the model are affected. In doing so it
constructs a vector of removal intervals which are subsequently used to
emit rowsRemoved signals. In the case where many rows are removed (e.g.
all of them), many removal intervals are identified that are often
adjacent and could be simplified, which is what this patch does. i.e.
instead of emitting 3 rowsRemoved for 0-3, 4-6, 7-12, now a single
rowsRemoved is emitted for 0-12.

Change-Id: Ia503091cc4928378c88257cd8b431582e9ff454e
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-13 09:42:36 +00:00
Johan Klokkhammer Helsing
0e37558b6e Don't skip tests in tst_QTouchEvent on Wayland
They seem to be running just fine

Task-number: QTBUG-66849
Change-Id: Ia48d47c0fff173eb1d6eba38bdba752a91bd2b56
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-13 07:48:05 +00:00
Edward Welbourne
54190595ef Make sure QDir::absoluteFilePath("/dir") includes a drive on MS
QDir::isAbsolutePath(name) thinks any path starting with a slash is
absolute; however, to return a valid absolute path, we need to put a
drive prefix onto such a name. So use QFileSystemEntry::isAbsolute()
for that check (it believes in the need for a drive, or UNC prefix)
and handle the absolute-but-for-drive case when it arises.

Add a regression test and make related changes to existing tests.

Task-number: QTBUG-50839
Change-Id: Id5d2b2586bb1423fa2d9375a298a4bb5241cffe0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-12 18:11:33 +00:00
Tor Arne Vestbø
3ae03c3585 testlib: Silence all Qt logging in selftests
Otherwise random debug messages from Qt might mess up the expected vs
actual results.

The setting of QT_LOGGING_RULES in initTestcase has been removed, as
the selftest overrides that for each invocation of a subtests, via
the processEnvironment() function.

Task-number: QTQAINFRA-1631
Change-Id: I855d31274f8261f8b125df23409353f7101be0e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-12 12:09:51 +00:00
Johan Klokkhammer Helsing
951e204b29 Skip failing tests in tst_QPixmap on Wayland
Task-number: QTBUG-66846
Change-Id: I61bd3e59e51fd1d988a30b6454a6a90650a3069b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-12 10:51:52 +00:00
Johan Klokkhammer Helsing
17b65edad1 tst_QInputMethod check WindowActivation capability instead of platform
Task-number: QTBUG-66849
Change-Id: I72a8751f1fc0df7ff5a371c854cb975b3cee8fd2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-12 10:51:32 +00:00
Johan Klokkhammer Helsing
d0349e17ac tst_QGuiApplication check WindowActivate capability instead of platform
Task-number: QTBUG-66849
Change-Id: I31dfe6d38435b043eb21d2de02d44551649444c9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-12 10:51:20 +00:00
Qt Forward Merge Bot
6dc1a52b4a Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ic193ccc3e9e3a86e15a002d599c13f35940e1eab
2018-03-12 01:00:09 +01:00
Friedemann Kleint
88a48192aa Fix 5.11 API review findings in QtNetwork
Rename
QNetworkInterface::maxTransmissionUnit()
to
QNetworkInterface::maximumTransmissionUnit()

Change-Id: I24a80b1317363e8d5da5f251ec908da9a51a6b0a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-10 20:35:16 +00:00
Qt Forward Merge Bot
ffdacff6b0 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia2441257c23169f8ca6a3933b2371255e1ba64e6
2018-03-10 09:22:39 +01:00
Eric Lemanissier
1e27219968 add missing tests of rvalue overloads for QVarLengthArray and QVector
they were missing in dd58ddd5d9

Change-Id: I52a2f855ead7716f8fe887524b27d4bd258f43d3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-10 06:15:31 +00:00
Nils Jeisecke
fee8944cbe Allow use of template class instances inheriting from a Q_GADGET in Qml
The Q_GADGET macro cannot be used in templates. It can however be useful
to derive a template class from a Q_GADGET enabled base class to benefit
from type safety features in C++ (e.g. the class could represent an id
or handle for some C++ type).

For proper wrapping of a QVariant with a gadget value in a QJSValue, the
QMetaType::IsGadget flag must be set for the registered template
instance type - which does not happen prior to the fix because
IsGadgetHelper requires qt_check_for_QGADGET_macro to be defined in the
registered class but not in an ancestor class - in other words: The
class must declare Q_GADGET.

To overcome this, IsGadgetHelper/IsPointerToGadgetHelper can now
differentiate between a Q_GADGET flagged class (allowing
automatic registration) and a derived class, e.g. a template class
(forcing Q_DECLARE_METATYPE to be used explicitly).

[ChangeLog][QtCore][QMetaObject] It is now possible to use template
class instances inheriting from a Q_GADGET in Qml

Task-number: QTBUG-66744
Change-Id: I7632ad45cff79fa422b3f852ca0b963f35fab155
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-10 06:12:24 +00:00
Tor Arne Vestbø
b1945604a7 testlib selftest: Resolve expected files at qmake time
Instead of keeping a static list in a qrc file.

Change-Id: I7783db5cad5929cc3f449889e1cbcbb87f7f2637
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-09 16:36:08 +00:00
Edward Welbourne
bc008afb0e Adjust tst_QTimeZone's Q_OS_WIN #if-ery now that ICU is the default
Various tests were adapted to Q_OS_WIN to take account of the
deficiencies in its TZ APIs; which are now bypassed when ICU is
configured, as we use it instead.  Replace some #if-ery on a local
define with QT_CONFIG(icu) and QMAKE_USE_PRIVATE += icu here, to match
in corelib/tools/tools.pri

Task-number: QTBUG-66367
Change-Id: Ia93abdeb7d12046310f0bb4a78c2669f8eecbbc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-09 10:34:00 +00:00
Alexander Shevchenko
4d20485474 set attribute specifier before namespace name
That is correct C++. GCC (and apparently Clang) accept it after the name
for compatibility with the old __attribute__ syntax.

Change-Id: Ie7f3adaaed83198ca1c61bc0efdf51634e457b07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-09 05:23:26 +00:00
Sergio Martins
c082d84d5d Fix QLabel crash if buddy's lifetime is too short
If buddy is deleted then QLabel will still try to deliver the
shortcut event to it, in QLabel::event(), and cras.

Besides connecting to destroyed() which alone fixes the crash,
also hardened it and guarded against dereferencing null buddy,
in the unlikely event of someone adding features to QLabel.

The second part is suitable for backporting to the LTS branches.

Task-Id: QTBUG-66841
Change-Id: Ib6a36a9f99cee31afe1f88eb77f5b6cafb8b1086
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-08 22:36:49 +00:00
Qt Forward Merge Bot
332ce6734d Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
2018-03-08 09:27:38 +01:00
Morten Johan Sørvig
2056bc6bc5 Remove tests from BLACKLIST for macOS
Whitelist tests that pass locally and that have been
blacklisted since the BLACKLIST was introduced in
2015 (in commit a8dda3b8).

Change-Id: I777b490313ebaa6c8c8daee168487d350179a5e6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-03-08 01:11:08 +00:00
Kari Oikarinen
caa5a20479 Make a benchmark out of tst_QObjectPerformance::emitToManyReceivers
The test has been flaky on top of QEMU. The test is clearly a sort of manually
rolled benchmark, not a regular autotest. Remove the test and replace it with a
benchmark in QObjectBenchmark.

Task-number: QTBUG-66823
Task-number: QTBUG-66216
Change-Id: I7a48293023f32141eed6fea50fbb63af18933a8f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-07 19:43:52 +00:00
Christian Ehrlicher
80693f171c QStandardItem: add more sanity checks on insertRow(s)/Column(s)
When QStandardItem::insertRows/Columns is called with an empty list
or an insert count of 0, do not assert but return false.

Task-number: QTBUG-66491
Change-Id: I328598e08584fb9b0a35075458bfeb31c57ebfee
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-07 18:36:15 +00:00
Christian Ehrlicher
b64f3f6ca9 QTabWidget: Do not add tabbar size during sizeHint() when it is hidden
Since Qt 5.4 the QTabBar can be automatically hidden when it has less
then 2 tabs. Therefore the sizeHint should not consider the tabbars
size when the tabbar is hidden.

Task-number: QTBUG-64715
Change-Id: I2f248f88d9070de5354f7344c7628a78442ab499
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-07 18:36:06 +00:00
Christian Ehrlicher
3185b40d5d SQL/Postgres: Fix support for nan, inf and -inf
Postgresql needs a special value for nan and +/- inf. This was
considered during insert but not during select.
Also remove some pre-c++11 inf/nan - handling and replace it with
Qt equivalents.

Change-Id: I044ca58e9cf673f4b100b05a0d8e25c8a9c29ec5
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-07 18:35:57 +00:00
Tor Arne Vestbø
4020829ac8 tst_qstorageinfo: Don't add extra newlines when printing volumes
The printVolumes function already adds line endings.

Change-Id: Id2553f881ccc0ab3c8b8fc77d3096dd5d968abda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-07 14:26:00 +00:00
Tor Arne Vestbø
dafe20c948 tst_qsettings: Check case sensitivity of actual settings file
Instead of the current working directory, which doesn't necessarily match
the location of the settings file.

Change-Id: Idffe2e87190cc9b6027fbba3b84e9dbf72ccf2f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-07 14:25:22 +00:00
Kari Oikarinen
3d53cf976d Blacklist tst_QWindow::modalWithChildWindow on openSUSE
Task-number: QTBUG-66851
Task-number: QTBUG-66216
Change-Id: Iea3d7823ccef718b52d097298250efddc981f3bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-07 07:19:38 +00:00
David Faure
4a04eea4f4 QHeaderView: fix inconsistent saved state, ignored during restore
The code that updates a section size must also update length,
otherwise saveState can end up saving inconsistent state, and
restoreState() goes to an early-return, not doing anything.

The actual bug was fixed meanwhile because _q_sectionsChanged is called
again, which recalculates length. I still see this only as a safety
measure, every other code path that changes section sizes updates length
right away.

Change-Id: I6cc16261692d93b3640afafef600a5bdff8dca0c
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-03-07 05:29:16 +00:00
Qt Forward Merge Bot
d7c1c9dd92 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-03-07 00:14:51 +00:00
Qt Forward Merge Bot
cf00c01f68 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I110feec4750bd304975bab4f3f33d3a61a4e08bd
2018-03-07 01:00:10 +01:00
Eric Lemanissier
2869bf9f1e implement non-member operator+ for iterators
all of these iterator classes already have a member operator+, which allows iter+int.
This commits addes non-member operator+, which allows int+iter, and forwards to the member
QList and QArrayData iterators now satisfy RandomAccessIterator concept

Change-Id: I25c1dd8cea299e735d5a5e288dbe23dc1d7a1933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-06 22:04:37 +00:00
Johan Klokkhammer Helsing
3eb42abab6 Check for WindowActivation capability instead of platform
Before running tests that depend on QWindow::requestActivate

Gets rid of several Wayland platform checks in tst_QWindow.

Change-Id: I7a5e029044a968dfcf87ecbb5105c01d52852d35
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-03-06 20:02:22 +00:00
Johan Klokkhammer Helsing
499b4991f4 Make platform checks for Wayland more readable
And make it easier to fix if platformName == wayland-egl etc.

Change-Id: Ia2d62ba003796e08f3e8a5bbfd0c3fd9d185e4e0
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-06 20:02:04 +00:00
Johan Klokkhammer Helsing
8fc6690748 Skip failing tests in tst_QWindow on Wayland
Task-number: QTBUG-66824
Change-Id: I33b826c2a373b264cc9b66444c52070eac1cdd5c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-06 20:01:52 +00:00
Jarek Kobus
4b24a61ecc uic: Add the include for QIcon conditionally
Task-number: QTBUG-66753
Change-Id: I31bd821396b59c8e83e19e02634cf1440a271215
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-06 06:49:00 +00:00