Commit Graph

8593 Commits

Author SHA1 Message Date
Christian Ehrlicher
3c4ea1b3c6 Benchmark: move widgets benchmarks still in gui subdirectory to widgets
Move all widget-dependent benchmarks which were still in gui
subdirectory to widgets

Task-number: QTBUG-23129
Change-Id: I1359f1ea4036cacdfdbe08ff9ecdf1e2c75a005b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-27 16:50:44 +00:00
Andy Shaw
7775eb248a sqlite: Support using execBatch() with duplicated named placeholders
Also expands the tst_qsqlquery::batchExec() test to account for this
case and generally test the functionality. In addition it is made to be
more robust to avoid any discrepencies with the testing data. The test
in general is also cleaned up to enable more of it being tested with
the different database drivers where possible.

An expected fail is added for MySQL due to the fact that it has a bug
where null timestamp entries are being converted to the current
datetime when adding it as a bind value.

Change-Id: I0061bd1c69ae35b4858afc49420f13ce59cf48ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-27 16:50:19 +00:00
Alex Trotsenko
cdbd68fc2f Allow QWinEventNotifier to coexist with waiting functions
Many subclasses of QIODevice have a functionality to block execution
until some asynchronous I/O operation completes. In case we are using
QWinEventNotifier, a typical reimplemented waitFor{ReadyRead
|BytesWritten}() function could look like:

  if (WaitForSingleObject(notifier.handle(),...) == WAIT_OBJECT_0) {
      notifier.setEnabled(false);
      ResetEvent(notifier.handle());

      bool res = GetOverlappedResult(...);
      ...
      return true;
  }

Despite the fact that the operation ends synchronously, it leaves the
notifier in a state that indicates it has received the event, so its
next call to setEnabled(true) will produce a fake notification.

So, we should reset a notifier's history before enabling it again.

Change-Id: I62a9dd809ce6a7a40e9d8038f2a49299b36f8142
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-27 15:08:46 +00:00
Eirik Aavitsland
c7c41fa1c6 Fix QPainter save/restore of clipping enabled state
Clipping enabled state would not always be correctly restored for the
raster engine (other engines work fine). The raster engine's QClipData
object is sometimes shared between painter state objects on the
save/restore stack. QClipData has its own enabled flag, and this could
then come out of sync. Fix by making sure we sync the enabled state on
restore.

Task-number: QTBUG-58789
Change-Id: I81e6254ebb93df6e153bbef58e32a885273e3224
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-26 16:00:43 +00:00
Svenn-Arne Dragly
50cfbd6112 Animation: Fix case where QEasingCurve::valueForProgress returns nan
Previously, we would divide by zero in BezierEase::findTForX if factorT3
was zero when solving the cubic equation.

This change fixes the problem by adding solutions for the special cases
where the cubic equation can be reduced to a quadratic or linear
equation.

This change also adds tests that cover cases where the equation becomes
quadratic, linear or invalid.

Task-number: QTBUG-67061
Change-Id: I2b59f7e0392eb807663c3c8927509fd8b226ebc7
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-03-26 15:53:10 +00:00
Eric Lemanissier
edf96b984d fixup oversight in rvalue overloads of operator+=() and operator<<()
ammends 4dee5446be

Change-Id: Ia0ca27644eb71815a93d6e76681b8a9e61a4e7ab
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-26 14:29:47 +00:00
Sergio Martins
a6d1456458 Add QTimer::connectTo(), a shorthand way of connecting to timeout()
There are a couple of Qt classes where you almost always use the
same signal, for example QTimer::timeout, QPushButton::clicked,
and QAction::triggered.

Simply doing timer.connectTo([]{}) is much more convenient, less
tedious and even fun.

Not overloading connect() as it would be confusing to see the
receiver as first argument.

And not naming it onTimeout, as that's a popular way of doing it in
other frameworks. People would assume you could use on* with any signal.
If we ever have on* it should be all or nothing.

[ChangeLog][QtCore] Added QTimer::connectTo(), a shorthand way of
connecting to the timeout() signal.

Change-Id: Ida57e5442b13d50972ed585c3ea7be07e3d8e8d2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-25 21:17:20 +00:00
Kevin Funk
02ed1b36da Remove CMake code for CMake < 3.1
This removes the following functions from Qt5CoreMacros:
- qt5_use_modules(...)

Task-number: QTBUG-63519
Change-Id: I59769060a3a93686bf319b558c0ede55755fdb70
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-24 22:31:18 +00:00
Alex Trotsenko
927db42882 tst_QWinEventNotifier: fix flakiness
disableNotifiersInActivatedSlot(disable_signaled2) fails, if a signaled
state of the event #2 is detected prior to the event #1. In this case,
we get a timeout on waiting for event #1 which was disabled by the
first notification.

So, accept a disabled state of the notifier in condition for successful
exit from the loop.

Change-Id: I8a2fe76f8ec9362556d1ca1fe0be39a93ed58977
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-23 18:09:24 +00:00
Christian Ehrlicher
89bf58b070 Benchmark/QImageReader: remove unused dependencies
QImagereader benchmark does neither depend on network nor widgets.
Therefore those two dependencies can be removed here.

Change-Id: Ic127b2668e22608774ce5878454f4a96ef591f6b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-23 17:42:52 +00:00
Kari Oikarinen
8e93988cce Blacklist tst_QProcess::softExitInSlots on Windows
Task-number: QTBUG-66903
Task-number: QTBUG-66216
Change-Id: I4a36d6f4b980f016e11fd7a8840dbc60a2964e83
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2018-03-23 07:11:04 +00:00
Harald Nordgren
97e40a5409 Allow adaptive decimal stepping for QSpinBox and QDoubleSpinBox
Adds the feature of adaptive decimal step sizes for the QSpinBox and
QDoubleSpinBox. By performing a calculation in
QAbstractSpinBox::stepBy() we continuously set the step size one power
of ten below the current value.

So when the value is 1100, the step is set to 100, so stepping up once
increases it to 1200. For 1200 stepping up takes it to 1300. For
negative values stepping down from -1100 goes to -1200.

It also works for all decimal values. 0.041 is increased to 0.042 by
stepping once, and so on.

The step direction is taken into account to handle edges cases, so that
stepping down from 100 takes the value to 99 instead of 90. Thus, a
step up followed by a step down -- or vice versa -- lands on the
starting value; 99 -> 100 -> 99.

Setting this property effectively disregards singleStep, but preserves
its value so that it takes effect again when adaptive decimal step is
disabled.

Adaptive decimal step allows values to be easily set to reasonable
levels. If the spin box value is 12000, changing to 13000 often makes
more sense than to 12001. The feature is turned off be default, when
single stepping is desired.

The accelerated property allows values to be changed quickly, as well,
but it is imprecise. Holding down the button makes it hard to land on
an even thousand, like 12000 or 13000. Often you end up somewhere
nearby and would need a second adjustment to get to an even hundred or
thousand.

[ChangeLog][QtWidgets] Add option of adaptive decimal step size for
QSpinBox and QDoubleSpinBox.

Change-Id: I9f286479b821e240c8ea05c238932fc128c582bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-22 21:37:45 +00:00
Kari Oikarinen
141582505f Stabilize tst_QGraphicsView::acceptMouseDoubleClickEvent
This test has been flaky on openSUSE in CI. The problem was that the window is
sometimes resized or removed while processing events after adding the rectangle
item to the QGraphicsScene. When the same mouse event is reused again, it uses
wrong screen coordinates. QGraphicsScene handling of mouse events then looks for
items under cursor at the wrong coordinates, does not find any items and thus
doesn't accept the mouse event.

Fix by using QTest API for simulating mouse events. Also wait for changed signal
rather than blindly running one iteration of event loop.

Task-number: QTBUG-67212
Task-number: QTBUG-66216
Change-Id: I968f9470c6f8803d01cebeda6f12ad76b4fd5293
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-03-22 13:35:51 +00:00
Edward Welbourne
58b373c9e3 Make sure $$relative_path() uses an absolute path as its first arg
Thanks to QTBUG-61373, this qmake function was called with
/usr/local/5.10.1 as baseDir, which isn't absolute, leading to an
assertion failure.  We could raise the error within qmake but it
proved easier to simply resolve any non-absolute baseDir using PWD,
before trying to use it as an absolute path.

Did the same for $$absolute_path().  Documented both.  Adjusted the
assert that caught this to report any non-absolute path that upsets
it.  Added simple tests, fixed an existing test.

Task-number: QTBUG-66156
Change-Id: Icfef2e2f5b236e071177c9beffa38d71bf404292
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-22 08:40:45 +00:00
Ulf Hermann
90ec3aba06 Clean up the moc "no-keywords" test
We can use the QT_LIB_FOO #defines instead of our own WITH_FOO ones to
determine if a library is available. Also, it doesn't currently make
sense to refer to libraries which are not part of qtbase here. We might
add that in the future, but QtScript (being deprecated) is probably not
the first one we should add.

Change-Id: I7f2397ca5499ba6003088478161182e960e815fb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-21 10:31:20 +00:00
Qt Forward Merge Bot
cc920b4cdd Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I35a6555e3885e489f88aa9b4b0142e1017f7a959
2018-03-21 08:59:26 +01:00
Allan Sandfeld Jensen
a65e383cac Switch lancelot from QRegExp to QRegularExpressions
They are faster, and using them makes it paint commands be the most
CPU intensive part of lancelot instead of regular-expression matching.

Change-Id: Ifabf1081c48a83ce089660049051428fd3a43042
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-20 09:00:14 +00:00
Ulf Hermann
5a4787dca0 Modernize the "regularexpression" feature
Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED,
switch it off in the bootstrap build, remove the #ifdefs from
qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression)
to the header.

qregularexpression.{h|cpp} are already correctly excluded in tools.pri
if !qtConfig(regularexpression).

Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-03-20 08:19:25 +00:00
Thiago Macieira
081c001deb QSemaphore: fix deadlock when the woken up thread wakes up another
When the thread that got woken up by release() is supposed to release()
to wake up another thread, we were deadlocking. This happened because we
cleared the bit indicating that there was contention when the first
release(). Instead of storing a single bit, we now store the number of
threads waiting.

Task-number: QTBUG-66875
Change-Id: I72f5230ad59948f784eafffd15193873502ecba4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-03-19 20:36:51 +00:00
Morten Johan Sørvig
2776d663aa Don’t show file dialog before calling selectFile()
selectFile() is a no-op if the dialog is visible and
its line edit has focus, which will happen at some
point after show() is called.

In other words this is a race, and the test will pass/fail
depending on the timing of the platform implementation.

Task-number: QTBUG-66536
Change-Id: I03957edb6496d17af7a8ed1d4ca86435375e0d40
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-19 14:39:33 +00:00
Morten Johan Sørvig
dd96a62fca Fix focusObjectDuringDestruction crash
Don’t assume that there is an active modal widget
on QApplication::focusChanged(). That signal can also
be emitted on focus clear during dialog destruction.

Task-number: QTBUG-66536
Change-Id: I20c64339c56a52b39c26a7683b62779deba576d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-19 14:39:08 +00:00
Morten Johan Sørvig
dae8133ded Stabilize tst_qgraphicsitem and tst_qgraphicsview
Add qWaitForWindowExposed() calls in addition to the
existing qWaitForWindowActive().

Depending on the platform, window activation events may
be synchronous, which means that a window can (and will)
become active before it becomes exposed.

This causes test failures for tests that count paint
event, and does not wait-for-exposed, when the expose/paint
event is delivered after waitForWindowActive() has returned.

We need to keep the waitForWindowActive() as well: the
test has several qWait() calls with he comment:
  “Increase the probability of window activation not
   causing another repaint of test items”.
These qWait() calls can possibly be removed in a future
commit.

Task-number: QTBUG-66536
Task-number: QTBUG-61967
Change-Id: Ie61bba058b583fdd1d80e600475aff3efccc32eb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-19 14:38:23 +00:00
Morten Johan Sørvig
b4650d9bcf Blacklist childEvents on macOS CI again
This test function was removed from the blacklist as
a part of the cleanup in 2056bc6b, but is still flaky
on CI.

Change-Id: I348ed167dff6fd618ede28456ada6da86ee341cd
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
2018-03-19 14:38:06 +00:00
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
Johan Klokkhammer Helsing
2417cade46 tst_QOpenGLWindow: Move resizing to separate test
Resizing is broken on Wayland EGL on Intel Mesa. Move resizing into a separate
test and skip it on Wayland it until it's fixed in Mesa.

Task-number: QTBUG-66848
Change-Id: I9450a5a588b0f5d8f0bd0210aae2dc72aa48d622
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-19 08:24:33 +00:00
Johan Klokkhammer Helsing
efa6e98912 QPixmap don't assume QPlatformScreen::format is opaque
QRasterPlatformPixmap::systemOpaqueFormat returned QPlatformScreen::format
without checking that the format was actually opaque.

This caused several QPixmap tests to fail on Wayland because Wayland
compositors don't communicate the native format of the screen, just a list of
supported pixel formats, so we just return ARGB32_premultiplied in
QWaylandScreen::format().

Rename the method systemOpaqueFormat to systemNativeFormat since that's how
it's used most of the time. And do a conversion when we actually care whether
the format is opaque or not.

Task-number: QTBUG-51748
Change-Id: I47dc1c3f185fb802016ca361206d47d02e8d3cf1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-03-19 08:23:54 +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
Andy Shaw
9b68dc19bf MySQL: Fix tests
This fixes the following:
  - tst_QSqlDatabase::recordMySQL() to account for performance
    improvements done for small integral types
  - tst_QSqlQuery::nextResult() so that NUMERIC results are seen
    as doubles
  - tst_QSqlQuery::timeStampParsing() so that MySQL accepts the
    CREATE TABLE statement

Change-Id: I68fb1d06dac12d500bb4596463f5bdd65cc9c226
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-17 23:14:34 +00:00
Andy Shaw
e4e87a2ece sqlite: Prevent a crash when sqlite does not detect any parameters
When using a virtual table inside a SQLite database it is possible that
it does not report the right number of parameters. Therefore we need
to account for this case to prevent it from crashing when trying to
bind parameters it thinks does not exist.

Task-number: QTBUG-66816
Change-Id: I3ff70bb1fe73091f43c3df53616f75858e451cfd
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-17 23:14:14 +00: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
Friedemann Kleint
ed245f3e70 Manual tablet test: Draw crosshairs when tablet pen is close
Crosshairs provide better visual feedback for coordinate
conversions.

Change-Id: I20f67733d7a5e6b1455507a39a8b9535202a92c4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-14 14:15:45 +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
Kari Oikarinen
45bace2ff9 QObjectBenchmark: Don't try to set read-only properties
Avoid lots of warnings about not being able to set "modal".

Change-Id: I396718f14a55203f9989c03e20efc647c64795a9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-07 07:19:21 +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
Qt Forward Merge Bot
954fe2c35d Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ifce6ddeb4dab8c672732ec6aa6c19a6c4bce447e
2018-03-05 13:15:31 +01:00
Johan Klokkhammer Helsing
681933c5b8 Make tst_QWindow::generatedMouseMove pass on Wayland
By using qWaitForWindowExposed instead of qWaitForWindowActivated.

Task-number: QTBUG-66824
Change-Id: Idf604157070731d9c92ccf64d8349c8571960b7c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-05 09:04:38 +00:00
Johan Klokkhammer Helsing
f25416cd08 Don't skip tst_QWindow::windowModality_QTBUG27039 on Wayland
The test actually passes, so there's no need to skip it.

Task-number: QTBUG-66824
Change-Id: Id091776ff7ca7637fdcf0e0ced833982b5788d92
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-05 09:04:29 +00:00
Liang Qi
a0db55040d Blacklist tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109 on windows ci
Task-number: QTBUG-66756
Change-Id: I5a00625b73085a9ac2471b03bcc21db4b9a98962
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-03-05 08:33:36 +00:00
Kari Oikarinen
b028877357 Blacklist tst_QGraphicsView::itemsInRect_cosmeticAdjust on Ubuntu
Has been flaky in CI.

Task-number: QTBUG-66815
Task-number: QTBUG-66216
Change-Id: I2c3eb42507eae618486aa402474b4b3f85ff310e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-03-05 07:27:17 +00:00
Andy Shaw
0da3ebd994 moc: Don't error our when parsing "using namespace __identifier(...)"
This follows on from a232251992 which
covered a similar instance of this. As with that change, we should not
abort the compilation, just ignore it.

Task-number: QTBUG-63772
Change-Id: Ide958080a90f43ed19edd8a320e7d45de1c96821
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-05 06:54:06 +00:00
Qt Forward Merge Bot
8c04a5e964 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I967eca8f34584fca3a1e5696978e70f620582a2a
2018-03-02 14:40:07 +01:00
Albert Astals Cid
78e92997ed QLocale: Update the system private on QLocale default constructor if needed
When first starting an Android app we have invocation order issue, to
load the platform plugin we create the default QLocale (needed by the
resource locator code to see if :/qt/etc/qt.conf exists) so when the
android platform plugin loads and creates its own QSystemLocale, the
QLocale defaultLocalePrivate is already created and pointing to
globalLocaleData which means that systemData won't be called and thus
the code that triggers the call to QLocalePrivate::updateSystemPrivate
won't be called when calling QLocale().

I thought of two ways of fixing this, one was calling
QLocalePrivate::updateSystemPrivatea() from the QAndroidSystemLocale
constructor, but giving the responsibility to not break things to the
plugin seems a little fragile, so making the check on QLocale()
seems better.

Without this patch an Android app doing
  QApplication app(argc, argv);
  qDebug() << QLocale().name();
  qDebug() << QLocale().name();
  qDebug() << QLocale::system().name();
  qDebug() << QLocale().name();
would print
  ""
  ""
  "ca_ES"
  "ca_ES"
now it correctly prints "ca_ES" the four times.

Task-number: QTBUG-41385
Change-Id: I2cf419f59aa008fa3aca11295fe7d42c40bcc32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-03-02 09:52:14 +00:00
Kari Oikarinen
fdddb3a481 Blacklist tst_QWindow::testInputEvents on Windows
Multiple recent failures on Windows 10.

Task-number: QTBUG-66798
Task-number: QTBUG-66216
Change-Id: I9d23d0381dbe62eb5469863f14e1a05548ce7dfa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-03-02 08:19:14 +00:00
Friedemann Kleint
dcc16166ef QTestlib/selftests: Fix failures due to logging system output
Silence debug output by setting QT_LOGGING_RULES
to turn off all debug output.

Task-number: QTQAINFRA-1631
Change-Id: I5c2366b4fe4bac341dcfd92f68b6da8071c5b089
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-03-02 08:16:21 +00:00
Friedemann Kleint
d8b143d4b7 qstringapisymmetry: Fix XML parsing failing on invalid encodings
Evaluating testlib's XML output in COIN would fail with:
"XML syntax error on line 7520: invalid UTF-8"
for the toLatin1() tests due to some Latin1/UTF8 mixup.

Add a helper function to convert the data to plain ASCII.

Task-number: QTQAINFRA-1797
Change-Id: I1c64878d4c2a67b8c2689905b5ffe6707b5963c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-02 07:59:12 +00:00
Kari Oikarinen
b03ee1262f Blacklist tst_QApplication::touchEventPropagation on openSUSE
Has been flaky in CI.

Task-number: QTBUG-66745
Task-number: QTBUG-66216
Change-Id: I985c67dc58704a43595a0657b06b6020fc08428a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-03-02 07:21:04 +00:00
Kari Oikarinen
d42a9d19ff Remove tst_QGLThreads::textureUploadInThread
The test has been crashing flakily recently.

   1) It is creating a QGLWidget
   2) It is stealing the QGLContext of that widget and moves it into a separate
      thread.
   3) In that secondary thread it makes the context current.
   4) Meanwhile the QGLWidget itself may receive for example a resizeEvent or
      other events and - since it assumes that it owns the context - attempts to
      make it current.
   5) Attempting to call makeCurrent() on a QGLContext that is in a different
      thread than the current thread (via QObject thread affinity) will result
      in a call to qFatal() and consequently the test aborts.

The conclusion from Simon Hausmann is that this test is testing a pattern from
Qt4 times that may or may not have worked back then. Nowadays with the Qt5
QOpenGL* API we do support this properly and there appears little sense testing
this.

Therefore remove the test altogether.

Task-number: QTBUG-66411
Task-number: QTBUG-66216
Change-Id: Ie2d66705bc7c3914ace6abcba9557c7c67ad4db3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-03-02 07:20:32 +00:00
Kari Oikarinen
810bc3fb19 tst_QLibrary: Ensure installation order of testdata libs
This test executable was not flaky in the normal sense that when run, it
sometimes passes and sometimes fails. Instead, in some builds it would fail
consistently and in some builds it would pass consistently.

The first test to fail was version(ok00, default to last version) which gives
"mylib" as the library name and -1 as the library version. The description
implies that QLibrary selects the biggest or last used version when given -1.
However, versions less than 0 are not used at all. Instead the loading uses only
the name to select the library. Change the description to match.

So why did the test sometimes pass, sometimes fail? The test uses two library
projects lib and lib2 which install two different major versions of libmylib.
That includes the symbolic links:

  libmylib.so -> libmylib.so.1.0.0*
  libmylib.so.1 -> libmylib.so.1.0.0*
  libmylib.so.1.0 -> libmylib.so.1.0.0*
  libmylib.so.1.0.0*
  libmylib.so -> libmylib.so.2.0.0*
  libmylib.so.2 -> libmylib.so.2.0.0*
  libmylib.so.2.0 -> libmylib.so.2.0.0*
  libmylib.so.2.0.0*

The key thing being that both set the libmylib.so symbolic link. In a
multithreaded installation it's undefined which happens to set the link last.
The test code expected libmylib.so to point to libmylib.so.2.0.0. Ensure that by
building and installing lib2 after lib.

Task-number: QTBUG-66722
Task-number: QTBUG-66216
Change-Id: Ic513c772902273049c28e43fc1d83d550aafcd23
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-03-02 07:20:04 +00:00
Thiago Macieira
4e02c8d5b8 JSON: remove braces from UUID text representations
[ChangeLog][QtCore][QJsonValue] fromVariant() conversion now converts
from QUrl and QUuid using special encoding forms to ensure best JSON
compatibility.

Change-Id: I56b444f9d6274221a3b7fffd150cdc5ca1f87ff1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-02 04:06:33 +00:00
Thiago Macieira
a2ffb35ac2 QJsonValue: use the fully-encoded form of a URL in fromVariant()
For compatibility with other parsers that may expect it to be so.

Change-Id: I56b444f9d6274221a3b7fffd150cd66390f98fd5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-02 04:06:24 +00:00
Qt Forward Merge Bot
6cf3428a43 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I42ec9e6aafc203465cbeb88af70c7af26b7df8ed
2018-03-02 01:00:10 +01:00
Gatis Paeglis
b3e91b66b9 qtestlib: fix support for pressing multiple mouse buttons
After a37785ec76 went in, it become
apparent that multi mouse button state handling in qtestlib is
non-existent, for details see QTBUG-64030 and QTBUG-63786. What
happened behind the scenes often was not what one would expect based
on the provided QTest::mouse* input sequence - events went missing,
incorrect events were generated, each subsequent test function
started with a state set from the function that run earlier. It is
easy to see how a minor change in one test could easily affect outcome
of other tests.

With a37785ec76, Qt platform plugins
are now responsible for sending explicit mouse button type and state
information; qtestlib should take full responsibility now as well.
But using the new API from a37785ec7 alone in qtestlib is not sufficient.
We need to reset mouse state between each new test function run (we do
this at function scope as that fits with the current qtestlib API user
expectations). This patch implements the necessary reseting logic.

Updated tst_qwindow.cpp::generatedMouseMove() to use QTest::mouse* APIs.
That test requires pressing multiple buttons, it was not possible with
QTest::mouse* APIs before this patch.

Added an auto test for multiple mouse button pressing/release in
tests/auto/testlib/selftests/mouse/. And few other tests which are
currently QSKIP-ed, but should be considered when re-designing qtestlib
APIs.

Task-number: QTBUG-64030
Change-Id: I39fdcbc73a467a7463ce2aed622bf22484095635
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-03-01 19:41:10 +00:00
Friedemann Kleint
daa39f8499 ToolTip/Windows: Fix wrong size when font is modified by widget stylesheet
Factor out a function to calculate the size and update the size when a
style sheet parent is set.

Task-number: QTBUG-64550
Change-Id: I3afe997085eae3cd48b7fe0a4c98582a8f572260
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-03-01 09:56:14 +00:00
Kari Oikarinen
233046d39c tst_QAbstractItemView: Wrap qWaitForWindowActive in QVERIFY
Return value of qWaitForWindowActive should be checked as it is marked
Q_REQUIRED_RESULT.

One of the calls was failing, so remove it and wait for the next condition
instead.

Amends d0dffdfc01.

Change-Id: I0c0b2bf11504730477158a5e1fb3018f359a6fb9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-03-01 09:38:19 +00:00
Kari Oikarinen
1875db1849 tst_QLocalSocket: Fix not showing error output in processConnection
The stdout of the processes used in the test was dumped if there was an error,
but the processes write their error messages to stderr.

Use MergedChannels process channel mode to dump both output streams.

Change-Id: I1645fd31c394da0871ee6ae36d37ca9a04d86052
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-03-01 09:37:58 +00:00
Thorbjørn Lund Martsum
e8425f9e52 QHeaderView: Fix crash in layout about to change
Before there was a risk looking up e.g index -1 if there
were no visible sections in layoutAboutToChange.

Change-Id: Ic911e4292e8e8c4892fef1c0f34cf7dccaad2bac
Task-number: QTBUG-65478
Reviewed-by: David Faure <david.faure@kdab.com>
2018-03-01 05:26:12 +00:00
David Faure
f2eb7b0204 QMimeDatabase: fix regression in alias resolving
The refactoring to support multiple providers broke alias resolving
(e.g. "text/directory" would be an invalid mimetype, instead of being
resolved to "text/vcard"). The unittest didn't catch it because most of
it was running with a single mime directory (and therefore a single provider,
in the new model). Fixed by re-running a number of test methods once we
have a second mime directory.

Change-Id: Ib5da89ba79c11ed41813b2aff4bc71c30afcde7d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-28 22:17:58 +00:00
Qt Forward Merge Bot
699a263b29 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ib21e6b9030b4d5363f440d082ce3df28098d1b95
2018-02-28 20:38:47 +01:00
Lars Knoll
7f504283ef Update the Unicode BiDi algorithm to be compliant with Unicode 10
The UBA in Qt was out of date, implementing the spec from pre
Unicode 6.3 days. It missed handling of directional isolates and
paired brackets.

This adds a completely new implementation of the UBA, that is
compliant with Unicode 10.

Added the test data from Unicode 10 to the qcomplextext auto
test and ensure that we pass the test suite.

Task-number: QTBUG-57743
Change-Id: Ie2d957bc9775d82f0a51d1c78dc6bd154f22847c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-28 17:11:43 +00:00
Qt Forward Merge Bot
96ffe48add Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I1ce43c8a214a869c5c4ac4245bb92c88c6bc6999
2018-02-28 10:32:56 +01:00
Kari Oikarinen
d5af78230d Blacklist tst_QWidget::saveRestoreGeometry on openSUSE
Has been flaky in CI.

Task-number: QTBUG-66708
Task-number: QTBUG-66216
Change-Id: I69878574a98139681100c1424d5bbf46cc4a87b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2018-02-28 07:07:58 +00:00
Kari Oikarinen
b55a32cd4b tst_QLocalSocket: Fix flakiness of processConnection
The test's client processes are prepared for the server not being ready when
they try to connect and handle QLocalSocket::ServerNotFoundError by waiting and
trying again.

However, on Ubuntu 16.04 and 17.10 and possibly other systems, sometimes the
error returned by qt_safe_connect inside QLocalSocket is ECONNREFUSED instead of
ENOENT. This has caused flaky failures in CI, so wait and try again in the case
of QLocalSocket::ConnectionRefusedError also.

Task-number: QTBUG-66679
Task-number: QTBUG-66216
Change-Id: I61e3d5b052d84c5ba9d1746f2c71db37cedbf925
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-28 07:06:43 +00:00
Sami Nurmenniemi
eba652a99f Blacklist tst_QNetworkReply::ioHttpRedirectPolicy
Has been failing a lot lately

Task-number: QTBUG-66247
Change-Id: Id940a573eb299379cacceb836890cbe0b3c896b7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-02-28 06:51:08 +00:00
Ville Voutilainen
00f89d61b9 Widen the blacklists for flaky udp tests
Task-number: QTBUG-66216
Change-Id: I52688bf41ef12b2ec67887b1a5d26f89d4556d5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2018-02-27 11:44:17 +00:00
Qt Forward Merge Bot
8a9f77ead1 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Icddf8720dae2cf594e16bcddab4d1cafc9d094c0
2018-02-24 21:29:47 +01:00
Samuli Piippo
bcd5532fcb Fix thread_local test
If _Thread_local is used on a block-scope declaration, it must be
combined with either static or extern to decide linkage.

Change-Id: I228b3520767197c6cdf5134ff5a666ab2aca33ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-23 13:23:01 +00:00
Qt Forward Merge Bot
efb46ea7cc Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I01dfc41e18333ac55954296cef8f01475adab27e
2018-02-23 09:27:52 +01:00
Gatis Paeglis
5d3f540fc6 tests: improve shortcut manual test
Change-Id: Id45bbe77a59917f25a031539f8414dc27d8fe19f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-22 21:37:58 +00:00
Sami Nurmenniemi
d266ac3a6b Blacklist tst_QNetworkReply::ioHttpRedirectMultipartPost
Task-number: QTBUG-66216
Change-Id: I5eaa2122ebeb8f003c961a156834a0c6360581b0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-02-22 19:08:30 +00:00
Christian Ehrlicher
a924b4d58f psql: do not try to get table name when PQftable returns InvalidOid
When the table for a selected column can't be determined (e.g. because
there is no table for it), PQftable returns InvalidOid. This was not
covered and a query to determine the table name was executed every
time which slowed down calls to QSqlQuery::value(QString).

Task-number: QTBUG-65226
Change-Id: Idd8fbaaef7b01ca4151439f46cad2cce6f1c93e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-02-22 19:00:08 +00:00
Thiago Macieira
988c3e4fc0 filetest: Make the "ls" command actually list the dirs
Change-Id: I940917d6763842499b18fffd15143af77c036d69
Reviewed-by: David Faure <david.faure@kdab.com>
2018-02-22 18:59:37 +00:00
Tor Arne Vestbø
8ef9a0ae89 windowflags: Make it easier to debug windows without a frame
Without any content it was hard to see the window. Put some lipstick on it.

Change-Id: I0fefffb0a4deba7ac91e67a6153a9a27308fe493
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-22 09:51:49 +00:00
Tor Arne Vestbø
8702e28628 windowflags: Lock fixed size to current size instead of 300x300
The latter would allow one final resize that would immediately
jump to 300x300.

Change-Id: I566e5e9dc1fb07f748f528f002166a8438344173
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-22 09:51:44 +00:00
Qt Forward Merge Bot
9f33b84b09 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Iec636692e8b7d1fe1bc0476e49c5054a5892d639
2018-02-22 09:19:56 +01:00
Thiago Macieira
bf87e1cfbd tst_QMimeDatabase: detect executables as shared libraries too
They can be, if compiled with -Wl,-pie. Example:

 $ file /usr/bin/ping
 /usr/bin/ping: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0

And you can't detect via the interpreter, since libraries can have
them too:

 $ file /lib64/libc-2.26.so libQt5Core.so.5.11.0
 /lib64/libc-2.26.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2
 libQt5Core.so.5.11.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.17.0

Change-Id: I940917d6763842499b18fffd15143bb80ce0e531
Reviewed-by: David Faure <david.faure@kdab.com>
2018-02-21 18:51:34 +00:00
Christian Ehrlicher
9395f35cb1 QHeaderView: Preserve settings on layoutChange with empty model
Do not clear the settings of QHeaderView during layoutChange when the
model is empty and the section count did not change. This will not work
when a section is moved or a section is replaced with a new one during
layoutChange. But since layoutChanged is also called on sorting, this
patch ensures that the settings are not cleared in this case.
This restores the behavior to the same as before 5.9.4.

Task-number: QTBUG-66444
Task-number: QTBUG-65478
Change-Id: I39989cfd45b42e58f49d18ec014d3a941cadb6c9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-21 16:23:25 +00:00
Christian Ehrlicher
c0e45ae851 QHeaderView: properly restore hidden section size on layoutChanged()
During (re)storing the sections within layoutChanged handling, the
hidden section size was not properly stored which lead to a section
size of 0 when the section was unhided afterwards.

Task-number: QTBUG-66413
Task-number: QTBUG-65478
Change-Id: I0b714c7e0530a1eae82b3bb0e0dc80ed576522d0
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-21 16:23:15 +00:00
Qt Forward Merge Bot
b949c44783 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9c90d71fde002544fd97df7e8a2690953cf9f817
2018-02-21 09:41:47 +01:00
Andy Shaw
8635ad1b59 psql: Add expected failures where the table name is case sensitive
Currently there is a bug in Qt regarding the PostgreSQL driver as it
does not correctly escape the table names when constructing queries
internally. Therefore, these tests are marked as expected failures until
the bug itself is fixed in Qt.

Change-Id: I74dadc187f8a08509128dfea27be99787e57ea51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-21 07:07:26 +00:00
Andy Shaw
a245c312b8 psql: Fix SQL tests
This also accounts for some quirks on the PostgreSQL side:
 - Null values for a related table are placed in a different
   order when sorted.
 - Functions (sum, count) return a different type than other databases
 - Using quotes to account for case sensitivity with tables

Task-number: QTBUG-63861
Change-Id: Ib1894fa8d0c77d7045941f7c57be0d0acd8d117e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-20 15:20:54 +00:00
Friedemann Kleint
ed3ed0b9db Fix touch point positions of non-transformable QGraphicsItems
TouchEvent::TouchPoint::pos was not updated in
QGraphicsScenePrivate::updateTouchPointsForItem().

To prevent the transformation being calculated repeatedly for each touch
point member, extract a function genericMapFromSceneTransform()
from genericMapFromScene() returning the transformation and use
that whereever multiple points are transformed.

Add a test, extracting helper functionality from
tst_QGraphicsItem::touchEventPropagation().
In addition, fold tst_QGraphicsScene::checkTouchPointsEllipseDiameters() from
c48f4bde00 into this test, so that
it is testing all transformations.

Task-number: QTBUG-66192
Change-Id: If71886d2c14c4e216f7781ea2f22f1adc444e6cf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-20 13:54:34 +00:00
Jake Petroules
ba871065e0 Clean up our Objective-C usage
- Move ivars into @implementation
- Use instancetype where applicable
- Use dot notation for property access
- Use subscript operator for dictionaries and arrays
- Format selectors consistently
- Use proper style for init methods
- Use generics instead of void pointers where possible
- Use "range for" loops instead of indexing
- Replace or replace IBAction/IBOutlet with void

Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-20 10:02:12 +00:00
Albert Astals Cid
d945e11837 Move duplex member from QPdfPrintEnginePrivate to QCupsPrintEnginePrivate
Duplex doesn't really make sense in the context of printing to pdf,
and the variable was only being used in QCupsPrintEnginePrivate anyway

Change-Id: I801634c56759572825b5c9549d7a1dc92e5697a0
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-02-20 07:56:19 +00:00
Tony Sarajärvi
3190edb077 Merge "Merge remote-tracking branch 'origin/5.10.1' into 5.11" into refs/staging/5.11 2018-02-20 04:18:00 +00:00
Liang Qi
48577b2e7f Merge remote-tracking branch 'origin/5.10.1' into 5.11
Conflicts:
	src/plugins/sqldrivers/psql/qsql_psql.cpp

Change-Id: I070b455078b41e75c46562fcea5676d6218cd00c
2018-02-19 16:02:52 +01:00
Kari Oikarinen
13e51ea487 QLineEdit: Clear input context commit string after test functions
Since the PlatformInputContext is shared between test cases, the set commit
string from inputMethod() was otherwise saved and could pollute other tests.

For example on Windows PlatformInputContext::commit() was called when the
QLineEdit was first clicked onto in tst_QLineEdit::testQuickSelectionWithMouse()
and inserted "text" in the middle of the text, rather than starting selection as
intended.

This led to tst_QLineEdit::testQuickSelectionWithMouse() failing on Windows at
first in CI, but then always passing the repeats when it was tested alone.

Task-number: QTBUG-66499
Task-number: QTBUG-66216
Change-Id: Id6bdd263d57fd6d08fb48f013542b55b132907ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
2018-02-19 14:24:09 +00:00
Andre Hartmann
ee55b37070 QByteArray: Add functions isUpper() and isLower() for Latin1 byte arrays
[ChangeLog][QtCore][QByteArray] Added QByteArray::isUpper() and
QByteArray::isLower() to check if a byte array contains only uppercase
or only lowercase Latin1 letters.

Change-Id: I7ab3c775bc714138d4be259ac6fa2cfc70467ed4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-17 12:23:24 +00:00
Friedemann Kleint
9760f881c5 QTestlib: Add formatting for QFlags<>
Add formatting for registered enumerations based on QMetaEnum
and unregistered enumerations as hex values.

[ChangeLog][QtTest] QtTest now prints values of QFlags that failed to
compare with QCOMPARE.

Task-number: QTBUG-65845
Change-Id: I3eae6d20d3c0d72441ca6c4037d9a8dafa4b6357
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-16 17:27:55 +00:00
Liang Qi
942ab49072 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/tools/tools.pri

Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9
2018-02-16 08:54:58 +01:00
Alexander Shevchenko
c7c20ce5e2 qmetatype: add '-bigobj' flag to Windows ICC builds
Fix 'Too many segments for object format' errors for (Debug) builds
using Windows ICC.

Change-Id: Ie48f43199948477c426d0a4e557f039eda129b22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-15 22:02:27 +00:00
Alexander Shevchenko
e8531501a7 qsettings: add Advapi32 lib to Windows ICC builds
Fix 'unresolved external symbol __imp_Reg*' errors for builds
using Windows ICC.

Change-Id: I99cb6d53c45cadb31b5675182753f168a7bf4ea3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-15 22:02:24 +00:00
Liang Qi
1ef03f69e8 Merge "Merge remote-tracking branch 'origin/5.10' into 5.11" into refs/staging/5.11 2018-02-15 21:19:50 +00:00
Allan Sandfeld Jensen
5e98873cd3 Fix of flaky qFutureAssignmentLeak test
Switch to QTRY_COMPARE since thread-local references might be held shortly
after finished is signalled.

Change-Id: Ia32f1f45f6cc461352558e0f2acf9612f8a4639e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-15 16:24:38 +00:00
Kari Oikarinen
b59181c42d Blacklist tst_QMdiSubWindow::setOpaqueResizeAndMove on macOS 10.12
Several recent failures.

Task-number: QTBUG-66433
Task-number: QTBUG-66216
Change-Id: I69e535579c886cc725f66d584af7f8821bee70da
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-15 13:17:48 +00:00
Liang Qi
bb0fec8057 Merge remote-tracking branch 'origin/5.10' into 5.11
Conflicts:
	src/corelib/corelib.pro
	src/corelib/global/qrandom.cpp
	src/network/access/qhttpnetworkrequest_p.h
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/cocoa/qcocoansmenu.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/offscreen/qoffscreenintegration.h
	src/widgets/kernel/qaction.cpp
	src/widgets/widgets.pro

Done-with: Andy Shaw <andy.shaw@qt.io>
Change-Id: Ib01547cf4184023f19858ccf0ce7fb824fed2a8d
2018-02-15 10:14:11 +01:00
Andy Shaw
d0dffdfc01 Make sure the parent view will have focus when activation is given back
When the focus is lost on an editor due to the application no longer
being the active one then we have to ensure the parent view is going to
get the focus when it is returned. Since the editor does not have focus
when this check is done we need to manually account for this case by
setting it on the parent view as if it would if the editor did have
focus.

Task-number: QTBUG-62253
Change-Id: I14ac347e9e3a2bfaa8715a45811b17c1c7cf15f8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-15 07:45:26 +00:00
Friedemann Kleint
a7600bf604 QTestlib/selftests: Refactor comparison
The "crashes" subtest has several "expected" reference files. The matching
one was previously determined by checking the line count of the output.

This however does not work when there are several reference files with
identical line count as is now the case with boot2qt.

Refactor the comparison code from the QTest/preliminary void return to
the bool f(QString* errorMessage) convention so that all files can be tried.

While doing so, streamline the code and remove numerous unneeded
allocations of strings and regular expressions per compared line.

Task-number: QTBUG-65845
Change-Id: I722159d1753f2a36f0e497e315ffd81cb58cac0b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-14 16:07:10 +00:00
Liang Qi
7bc1d6effa Merge "Merge remote-tracking branch 'origin/5.9' into 5.11" into refs/staging/5.11 2018-02-14 15:49:08 +00:00
Kari Oikarinen
2aeb2bcef4 Blacklist tst_QGraphicsView::update2 on openSUSE 42.3
Has been failing on it, but not on any other platform.

Task-number: QTBUG-66396
Task-number: QTBUG-66216
Change-Id: I0b208c675a23fb4bc1808dd3aa4dfef9bddf136b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-14 15:48:30 +00:00
Kari Oikarinen
716e4a0414 Blacklist tst_QWidget::moveInResizeEvent on Ubuntu
Previous version of Ubuntu used to be blacklisted and the test is still flaky on
Ubuntu 16.04.

Task-number: QTBUG-66390
Task-number: QTBUG-66216
Change-Id: Iec404879f61164b995f0df7348f4f4baf608ca90
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-14 15:48:16 +00:00
Liang Qi
305dd1b61f Merge remote-tracking branch 'origin/5.9' into 5.11
Conflicts:
	.qmake.conf
	src/corelib/animation/qvariantanimation.cpp
	src/corelib/global/qglobal.cpp
	src/corelib/global/qlogging.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/json/qjsonarray.cpp
	src/corelib/tools/qsimd_p.h
	src/corelib/tools/qtimezoneprivate_p.h
	src/corelib/xml/qxmlstream_p.h
	src/gui/kernel/qsimpledrag.cpp
	src/gui/kernel/qsimpledrag_p.h
	src/plugins/generic/generic.pro
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/widgets/styles/qmacstyle_mac.mm
	tests/auto/concurrent/qtconcurrentmap/BLACKLIST
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/dialogs/qmessagebox/BLACKLIST

Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
2018-02-14 12:51:24 +01:00
Qt Forward Merge Bot
318f728283 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-02-14 08:31:10 +00:00
Kari Oikarinen
a37dd93def Fix crash in tst_QStateMachine::dontProcessSlotsWhenMachineIsNotRunning
The test sometimes ended up with:

  QThread: Destroyed while thread is still running
  Received a fatal error.

This was because as a member variable of the local struct the QThread object was
sometimes destructed before the signal connection quitting it was handled. Fix
that by making sure that the thread is finished before finishing the test.

Also moved connecting to the state machine's signal to be before starting the
machine. Because the counting of QStateMachine::finished signal could hit 1
after the first signal is emitted and the test could pass without the code
working, check that both of the signals have been emitted.

Task-number: QTBUG-66372
Task-number: QTBUG-66216
Change-Id: If14141e39f37541032ddd8c6471daf40a77b0469
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-14 08:12:20 +00:00
Friedemann Kleint
087f26f9da tests: Refactor cleanup tst_QMenu::QTBUG47515_widgetActionEnterLeave
Add a main window, based on the observation that the original bug
report was about a typical main window.
The mainwindow typically has the mouse grabbed when clicking to open
a menu and all mouse events go to it. Mimick that in the test
by sending the mouse events to it.

Remove the code using QCursor::setPos().

Task-number: QTBUG-63031
Change-Id: I9117c9633f81aba8bdff235ce64884c489fdc9f7
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-14 07:13:42 +00:00
Friedemann Kleint
bb45b75f3d Windows QPA: Discard spurious mouse move events
Windows sends a mouse move with no buttons pressed to signal "Enter"
when a window is shown over the cursor. Discard the event and only
use it for generating QEvent::Enter as not to confuse tests.
This is preparing for the use of the new QPA API for mouse events.

Change-Id: I3eb7f3dad82d27d0b425c7eaf34b1eee11592074
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-14 07:13:39 +00:00