Commit Graph

1977 Commits

Author SHA1 Message Date
Andy Shaw
8e5f6e3bed Don't send a mouse move when we just need to do a synthetic enter/leave
[ChangeLog][QtWidgets] QApplication no longer sends a mouse move event
to the entered widget if it sends synthetic enter and leave events.

Task-number: QTBUG-67736
Change-Id: I75daaffd53f1ddc2bc4d7df67382cbc22d3eb6fc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 08:19:41 +00:00
Qt Forward Merge Bot
4aa6f54fec Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
2018-04-15 01:00:18 +02:00
Kari Oikarinen
0dd3e02aac tests/auto/widgets/util: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I795e564b051bbabd1fc2d2fca8171da6072f99eb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 12:32:52 +00:00
Kari Oikarinen
66cc08961f tst_QWidget: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I1696ccbdf0523ece694f2dac52c015443c8b19fb
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 05:43:45 +00:00
Lars Knoll
4f158ccee5 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
2018-04-12 22:00:35 +02:00
Kari Oikarinen
a88063008d Blacklist tst_QItemDelegate::comboBox on openSUSE
This failed (occasionally) in finding the editor widget, so wait for the window
to be shown properly. Also enter the event loop with QTRY_VERIFY and not for a
fixed time of 1 s.

This however just moved the point of failure. Now the test fails since the
clearing and setting of focus does not dismiss the editor widget sometimes, so
still blacklist it.

Task-number: QTBUG-67282
Task-number: QTBUG-66216
Change-Id: Iec598609fce23a25d7b955082d0973685d612715
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-12 12:48:12 +00:00
Kari Oikarinen
b096982899 Don't mark tst_QFiledialog as insignificant_test
Change-Id: Id3fef4e66bd8f96c8f87dd94bbca216cc65f8489
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-04-12 12:21:55 +00:00
Gabriel de Dietrich
91fa300cbe QMacStyle: CC_ComboBox is now HITheme-free
For the time being, no more stretched QComboBox. They
were already looking bad before and nobody complained,
so it's a non-issue. In the future, we might use square
combo boxes in the same way as we do for push buttons
but for non-editable QComboBox only.

Removes what is now dead code, including some leftovers.

tst_QMacStyle updated to reflect size changes to accom-
modate the focus ring.

Change-Id: I60fac86b9acb52cc96373bca0b3cad598ec4f1e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 00:20:42 +00:00
Liang Qi
093290a662 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/ios/quiview.mm

Change-Id: I0fd0adeca1590fffddd577873172f6d987a60412
2018-04-11 09:34:23 +02:00
Kari Oikarinen
b318c14bd5 Stabilize tst_QWidget_window::setWindowState
Bumping the timeout removed flaky failures in an RHEL debug VM.

Task-number: QTBUG-67151
Task-number: QTBUG-66216
Change-Id: I2fde636149f5104a41b757df956d84edc420e7c7
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-11 06:07:26 +00:00
Kari Oikarinen
32d9cf7310 Fix tst_QFiledialog::completer
The test was failing because the files it expected to create were not actually
visible on the disk.

This was because 189e9c93d7 made QTemporaryFile
use unnamed files if the file name is not actually requested. Fix by forcing the
temporary file to be made with the requested name.

CI has not caught this because the test executable is marked insignificant_test
on Linux.

Change-Id: Ibe0244fdfcc66acf3be4314da51b4c0b3b520b71
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-10 08:33:15 +00:00
Qt Forward Merge Bot
ffb2c2ac6c Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I33b47095efdfe0ba698c6a88ca41ec911f432208
2018-03-31 01:00:13 +02:00
Friedemann Kleint
f3a461c4a2 Stabilize tst_QGraphicsProxyWidget::tooltip_basic()
Use QTRY_VERIFY instead of hard-coded wait for the tooltip to appear.
Also use QTRY_VERIFY to verify that no top level widgets are left over
to account for tooltips and effect windows.

Change-Id: Ia9835fdc480c6abb034f6fc4ad3d6b32751ee536
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2018-03-29 20:50:00 +00:00
Liang Qi
794781e7cf Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_mouse.mm
	src/testlib/testlib.pro

Change-Id: Ia0ce4243418fe6a485b0f290c67bd433b3b04ff2
2018-03-28 08:12:21 +02: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
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
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
8264e495fa Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
2018-03-15 01:00:11 +01: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
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
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
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
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
954fe2c35d Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ifce6ddeb4dab8c672732ec6aa6c19a6c4bce447e
2018-03-05 13:15:31 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Ville Voutilainen
c7913f3a1f Blacklist a flaky messagebox test
Task-number: QTBUG-66371
Change-Id: I95fff726167d9fad2e2fb47891ce357d7025d254
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-13 23:35:11 +00:00
Qt Forward Merge Bot
9c055e8e47 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Iaec2e57d6bf33355ddfa61d25133580a8740335f
2018-02-13 22:56:03 +01:00
Christian Ehrlicher
92fc338de0 qtbase: cleanup BLACKLIST files
Cleanup BLACKLIST files which contain entries for CI-systems
which are no longer active:
 - opensuse-13.1
 - opensuse-42.1
 - osx-10.8
 - osx-10.9
 - osx-10.10
 - rhel-7.1
 - rhel-7.2
 - rhel-7.3
 - ubuntu-14.04
 - windows msvc-2010

Change-Id: I25590b0807a4454f9dc92aa4ea61300f7c9af56b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-13 15:20:33 +00:00
Kari Oikarinen
93a1d7ce27 Blacklist tst_qwidget_window::tst_resize_count
It is flaky on Ubuntu 16.04 and openSUSE 42.3.

Task-number: QTBUG-66345
Task-number: QTBUG-66216
Change-Id: I06fb88ee65113136309a0faa0336dd11672bfe59
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-13 15:08:26 +00:00
Benjamin Terrier
357822818d Ensure textEdited() is emitted if the input is changed by a validator
[ChangeLog][QtWidgets][QLineEdit] The textEdited() signal is now emitted even if the
QValidator has changed the user input.

Task-number: QTBUG-44046
Change-Id: Ife287269c7dcbb644cb03a291bf96f7db384ed56
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-12 21:52:07 +00:00
Christian Ehrlicher
b2b32682a9 qtbase: Remove BLACKLIST files which are no longer active
Remove BLACKLIST files which are no longer valid because the mentioned
CI systems are no longer active:
 - opensuse-13.1
 - opensuse-42.1
 - rhel-7.1
 - rhel-7.2
 - rhel-7.3
 - ubuntu-14.04
or the testcases are no longer available:
 - QTBUG_14292_filesystem in qactiongroup

Change-Id: I80a4397059fafba169096440fdc07d45c76a1ed8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-12 17:40:12 +00:00
Christian Ehrlicher
383d2eaab4 Fix autotest tst_QAction::setStandardKeys()
The possible key sequences for QKeySequence::Copy on X11 is Ctrl+C, then
Ctrl+Insert and at last F16. The order is defined in
QPlatformThemePrivate::keyBindings.

Task-number: QTBUG-46053
Change-Id: I86a0767e268088edfce98cfb07f9fb78f00d0713
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-12 17:39:57 +00:00
Ville Voutilainen
a211d5379b Blacklist a flaky scrollbar test on macos
Task-number: QTBUG-66321
Change-Id: Ib632ffad993e178305884170fdfe17809ea1e1e6
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-12 17:00:53 +00:00
Liang Qi
8dd22d9255 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia443f6eb1c854c99c68127a376b78c1986675a9d
2018-02-11 09:13:21 +01:00
Sergio Martins
7a342372bb Introduce QLayout::indexOf(QLayoutItem *)
This was the missing counter-part to indexOf(QWidget *), which is
sometimes implemented in user code.

Not sure why the original code doesn't use a for-loop and instead accesses
an out-of-bounds element, but I'll preserve the behavior of very old working code.

Change-Id: I7d7fa56b56a4626789774c15c23fdfef41d723e7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-02-10 21:14:55 +00:00
Tor Arne Vestbø
c94ef51f0c macOS: Blacklist tst_QStyleSheetStyle::task232085_spinBoxLineEditBg
Likely fail is 3d29a0dd74. Is preventing
merge from dev, so blacklisted for now.

Task-number: QTBUG-66324
Change-Id: Ieb522897e93d4a1b4c0e423fadd4138dfb089093
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-10 20:39:11 +00:00
Christian Ehrlicher
85f6dd8325 QTreeWidgetItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTreeWidgetItem setData() function

Change-Id: Ife87e9e046621b464ad340bd9eb451355730e93c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-10 13:18:57 +00:00
Ville Voutilainen
a0da6df87b Blacklist a flaky menubar test
Task-number: QTBUG-66255
Change-Id: Ia7c493496c3fbd551e724853e4f70e3500a1bb74
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-02-09 20:37:02 +00:00
Andy Shaw
c48f4bde00 Set the ellipseDiameters back to the original size in QGraphicsView
When calling setSceneRect() on a QTouchPoint it will cause the
ellipseDiameters to be changed, whereas this should not be affected by
the scene rectangle as it should be in logical pixels.

Also add a manual test for visually checking the ellipse diameters on
various devices.

Change-Id: I1ee9207cb1a63cfef33fe904594c73aba221af5c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-08 21:25:01 +00:00
Friedemann Kleint
9bd702a634 tst_QMenu: Add define QTEST_QPA_MOUSE_HANDLING
Use the clean implementation that does not use QCursor::setPos()
with the exception of macOS, where this causes
submenuTearOffDontClose() to fail.

Change-Id: I95a615c37bcf419ce1ede65b5ed79a5ec0568391
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-07 12:29:06 +00:00
Friedemann Kleint
bdd2697ce8 tests: cleanup tst_QMenu::click_while_dismissing_submenu()
- Use Qt 5 connection syntax
- Use QTest::mouseMove(QWindow *)

Change-Id: Ia2ea8595355801db3f4569a96dead60a7af51109
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-03 18:55:02 +00:00
Elvis Angelaccio
4772ac90fa QLineEdit: implement quick text selection by mouse
This is a standard feature in GtkEntry widgets or HTML
<input type="text"> elements. During a normal text selection by mouse
(LeftButton press + mouse move event), it's now possible to quickly
select all the text from the start of the selection to the end
of the line edit by moving the mouse cursor down.
By moving it up instead, all the text up to the start of the line edit
gets selected. If the layout direction is right-to-left, the semantic of
the mouse movement is inverted.

This feature is only enabled if the y() of the mouse move event is
bigger than a fixed threshold, to avoid unexpected selections in the
normal case. This threshold is set by the QPlatformTheme and a value
smaller than zero disables this feature.

The threshold is updated whenever the style or the screen changes.

[ChangeLog][QtWidgets][QLineEdit] Implemented quick text selection by
mouse in QLineEdit.

Change-Id: I4de33c2d11c033ec295de2b2ea81adf786324f4b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-03 16:34:05 +00:00
Gatis Paeglis
ac0ad5c69c tests: cleanup tst_QMenu::QTBUG47515_widgetActionEnterLeave
- Allocate widgets on stack. The previous version was inconsistent (some
  widets were managed by QScopedPointer and some were simply leaking).

- Use QTest::mouseMove(QWindow *)

- "This test fails on OS X on CI" was a clear indication that test is
flaky, the new implementation can reliably reproduce issue which is
now tracked in QTBUG-63031.

Task-number: QTBUG-63031
Change-Id: I59965ef8fa8edca17c8a73901d81e9efc7da3c5b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-01-29 21:19:58 +00:00
Liang Qi
27e8612fa4 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I6b40ecee4db13e6329e7a0433b57c5bca473c63f
2018-01-29 20:49:24 +01:00
Christian Ehrlicher
3adfcbf1ed QHeaderView: properly restore section data after layoutChanged()
QHeaderView is doing a complete rebuild of the sections when the layout
changed because everything could have happened. But since layoutChanged
is also called during e.g. sorting, the old data must be restored when
possible.

Task-number: QTBUG-65478
Change-Id: I088d4d843cad362b97df6dc5e0dcb9819b13547f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-29 10:34:31 +00:00
Christian Ehrlicher
6578946245 QListWidgetItem/QStandardItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QListWidgetItem/QStandardItem
setData() functions

Task-number: QTBUG-55903
Task-number: QTBUG-63766
Change-Id: I4da9346ef8401cc8633dc4b2ea7d00451d1e3942
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-26 19:58:26 +00:00
Christian Ehrlicher
52f1692b84 tst_QSplitter::replaceWidget: explicit wait for events
Wait a little bit longer for the visibility and resize events. By
directly waiting for the incoming events with QTRY_COMPARE we give
the test some more time to deliver the expected events.
Also move the check for the expectedResizeCount/expectedPaintCount
before the geometry check for better debugging.

Task-number: QTBUG-64639
Change-Id: I712e432aa8f8d35dd199adf88af3653009528b57
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-26 19:58:17 +00:00
Friedemann Kleint
0901d4290f QFileSystemModel/Win: Fix file system operations failing due to watchers
File system operations like renaming/removing may fail on Windows when
file system watchers are present. Add functions to
QFileSystemModelPrivate to temporarily remove the watchers prior to such
operations and to restore them in case of failure. Use them for
rename/remove (within a feature check for QFileSystemWatcher
and Q_OS_WIN).

Task-number: QTBUG-65683
Change-Id: I90142901892fbf9b1e1206a3397a95ffd3c8f010
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-26 11:36:30 +00:00
Yulong Bai
2a3f226e32 QMenuBar::mouseReleaseEvent: fix triggering hidden actions
While menubar actions are hidden, as menubar was too narrow
to contain them, by clicking the blank area, where the action
was supposed to place, can still trigger the action.

Task-number: QTBUG-65488
Change-Id: I6b137e0717f634ebd3371dbcc2c1ce2089688374
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-24 14:24:41 +00:00
Liang Qi
c97eb3e18e Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/global/qglobal.cpp
	src/corelib/global/qrandom.cpp
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp

Change-Id: Icc10543a1f2db5d640d01796bfec70a63517a6b2
2018-01-24 13:38:25 +01:00
Andy Shaw
efec288f58 itemviews: When an index widget gets focus, update the current index
By ensuring that the current index follows the focus of an index widget,
we can ensure that moving the cursor will happen in the way that is
expected from the focused widget.

Task-number: QTBUG-27793
Change-Id: Ia36891a94ce41c7d12fba678de23a6f3b69374ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2018-01-22 09:50:03 +00:00
Yulong Bai
4d898a73e6 QMenuBar: Fix repetitive emission of triggered() when using addAction(QString)
The action which added by QMenuBar::addAction(const QString &text) already
connected relevant signals and slots implicitly, however, while
QMenuBarPrivate::updateGeometry -ing, it reconnects them
if there's a extension button associated with a hidden popup menu.
In that case the QMenuBar::triggered would be fired twice.
Since the QAction's ownership may be changed or added dynamically,
there are still very rare cases like several widgets share the same
QAction object to result in this problem.

[ChangeLog][QtWidgets][QMenu] Fixed a bug in QMenu that caused QMenuBar::triggered
to be fired multiple times.

Task-number: QTBUG-25669
Change-Id: I4d52e82a2136a992e0b37118e41237d96a2c5d22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-01-21 17:54:47 +00:00
Liang Qi
65a97fccc6 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
2018-01-20 22:36:19 +01:00
Otto Ryynänen
6d50f746fe Support for Q_OS_ANDROID_EMBEDDED and android-embedded build flags
The Embedded Android build (Boot to Qt Android injection) is defined by
having both Q_OS_ANDROID and Q_OS_ANDROID_EMBEDDED flags defined,
as well as having Qt config android-embedded.
This commit enables the possibility to build embedded Android builds.
(i.e. Qt build for Android baselayer only, without JNI)

Change-Id: I8406e959fdf1c8d9efebbbe53f1a391fa25f336a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-01-20 18:16:59 +00:00
Christian Ehrlicher
e6fa35ff14 Sync QItemDelegate::doLayout with QCommonStylePrivate::viewItemLayout
QItemDelegate::doLayout added a margin after the checkbox which is not
done within QCommonStylePrivate::viewItemLayout. This created a small
but visual difference between using QItemDelegate or QStyledItemDelegate.
The additional margin was removed from viewItemLayout somehwere between
4.4 and 4.5 so it was intentional.

Change-Id: I2fc3f287fe8b181355edeebec9626c49d85fe74d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-18 18:01:39 +00:00
Tor Arne Vestbø
e2a546a18b Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I896b0cf54f317c4336cc3d3db319a0b89e421728
2018-01-16 11:48:55 +01:00
Liang Qi
f4d8cafc1b Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/3rdparty/harfbuzz-ng/src/hb-private.hh
	src/sql/doc/snippets/code/doc_src_sql-driver.cpp
	src/sql/doc/src/sql-driver.qdoc

Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
2018-01-11 18:10:41 +01:00
Liang Qi
5ba29e1672 Merge remote-tracking branch 'origin/5.9.4' into 5.9
Change-Id: Ic23e90146470d69060313628562f76a710696bab
2018-01-11 12:45:59 +01:00
Liang Qi
9bee6712fc Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I840849c072075a69819eb185b20bc42c3de0f825
2018-01-09 21:27:30 +01:00
Friedemann Kleint
fcbaa8ec38 QFileSystemModel/Windows: Make file name checking case-insensitive
Introduce a special hash modeled on the one used for QFileSystemWatcher
on Windows.

Task-number: QTBUG-31103
Task-number: QTBUG-64147
Change-Id: I69ebabe841716e4957ae3fb04fa5c43d233a3552
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-09 12:01:17 +00:00
Anton Kudryavtsev
79d3351855 QMenuBar: Add overloads of addAction() using Qt 5 signals and slots
[ChangeLog][QtWidgets][QMenuBar] Add overloads of addAction() using Qt 5 signals and slots

Change-Id: Ief21974213b80111f0ca87df490eb72dd6b9c9b9
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-06 18:48:54 +00:00
Christian Ehrlicher
20604ea554 QHeaderView: respect min/maximumSectionSize property
QHeaderView::resizeSection() did not check if the given section size is
inside the min/max property bounds.
Also on calling setMin/MaximumSectionSize() the current section sizes
were not checked if they are inside the new given bounds.
This is a small behavior change when a user is setting the section size
via resizeSection() without respecting the min/maxSectionSizes.

Task-number: QTBUG-64173
Change-Id: Ia9c9eebf058d60c776ab5f8f8336642013ec553f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-06 05:17:00 +00:00
Andy Shaw
5e9e4ccdc3 Add an option to scroll the QComboBox on macOS with the mouse wheel
Since there may be some applications that want to make their comboboxes
scrollable or not with the mouse wheel then a style hint is added to
make this toggable. It defaults to true for all platforms except macOS
to keep it in line with existing behavior.

[ChangeLog][QtWidgets][QStyle] Added SH_ComboBox_AllowWheelScrolling as
a style hint to enable/disable the use of the mouse wheel in a QComboBox.
This defaults to true in all styles except the macOS one so there is no
change in existing behavior.

Task-number: QTBUG-53094
Change-Id: I6eb61e1990bfc79e3b3ea82d7b91ee39096fa077
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-01-05 15:01:43 +00:00
Thorbjørn Lund Martsum
d5a11a0ec2 Revert "QTreeView: Make sure QHeaderView is notified on layoutChanged()"
It caused some sorting issues.
This reverts commit 93dabeba9d.

Change-Id: Ie8c7f2d47885be6626ddb6284474a78dcf09cf33
Task-number: QTBUG-65478
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-05 08:22:30 +00:00
Christian Ehrlicher
2dedf75819 QTreeWidget: fix visualItemRect()
QTreeWidget::visualItemRect() returned an invalid QRect when a column
was moved and then hidden (or the other way round). The reason was that
the logical index returned by QHeaderView::logicalIndexAt() was again
passed to QHeaderView::logicalIndex() to create the QModelIndexes needed
for QTreeView::visualRect()

Task-number: QTBUG-28733
Change-Id: I8676f21bcab8c05c2260b85d483902f18cbf3e24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-03 07:53:41 +00:00
Liang Qi
9de26a630f Merge "Merge remote-tracking branch 'origin/5.10' into dev" into refs/staging/dev 2018-01-02 09:32:37 +00:00
David Faure
739611221c Add QHeaderView::setFirstSectionMovable(), useful for flat treeviews
QTreeView makes columns movable except for the first one
(since Qt 5.0, see commit e0fc088c0c). This is indeed best
for actual trees, but not when using QTreeView as a flat
multi-column list (with no "root decoration"). Then it should
be possible to move the first column.

[ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow
the user to move the first column (like in Qt 4.x) using the new
method QHeaderView::setFirstSectionMovable().

Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-02 09:31:11 +00:00
Lars Knoll
0f315adf91 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	.qmake.conf
	sc/corelib/io/qfsfileengine_p.h
	src/corelib/io/qstorageinfo_unix.cpp
	src/platformsupport/eglconvenience/qeglpbuffer_p.h
	src/platformsupport/input/libinput/qlibinputkeyboard.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/ios/qiosscreen.h
	src/plugins/platforms/ios/qioswindow.h
	src/plugins/platforms/ios/quiview.mm
	src/printsupport/dialogs/qpagesetupdialog_unix_p.h
	src/printsupport/dialogs/qprintpreviewdialog.cpp
	src/printsupport/widgets/qcupsjobwidget_p.h
	src/widgets/widgets/qmenu.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
2018-01-02 09:58:44 +01:00
Lars Knoll
db92f2f3aa Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	.qmake.conf
	mkspecs/win32-g++/qmake.conf
	src/corelib/global/qglobal_p.h
	src/corelib/global/qoperatingsystemversion_p.h
	src/corelib/io/qfilesystemengine_win.cpp
	src/network/bearer/qbearerengine.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/sql/doc/snippets/code/doc_src_sql-driver.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetwindow.cpp
	src/widgets/styles/qfusionstyle.cpp
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp

Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
2017-12-30 12:09:53 +01:00
Christian Ehrlicher
a02b371eb2 QHeaderView: properly connect rows/columnsMoved
QHeaderViewPrivate reimplemented _q_layoutChanged() to handle changes
of rows/columns via layoutChanged/layoutAboutToBeChanged. This worked
fine for Qt4 but since Qt5 only the special signals rowsAboutToBeMoved/
rowsMoved are used for this (8021e2d5e7).
With this change, QAbstractItemViewPrivate::_q_rows/columnsMoved() is
calling the virtual function _q_layoutChanged(). This resulted in a
wrong call of QHP::_q_layoutChanged() for a horizontal header when
a row changed and for a vertical header during a column change. In the
end this can lead to an unhide of hidden sections.

Task-number: QTBUG-54610
Change-Id: Ide4bfc5b24a97746fd1e5af82d3ba08257149157
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-12-22 16:17:56 +00:00
Christian Ehrlicher
93dabeba9d QTreeView: Make sure QHeaderView is notified on layoutChanged()
QHeaderViewPrivate::_q_layoutChanged() was not called when used in a
QTreeView because it was explicitly disconnected in setModel().
The disconnect was added sometime prio to Qt 4.3, but there the signal
was connected to the doItemsLayout() slot. This was correct since
QTreeView::doItemsLayout() is calling header->doItemsLayout().
In Qt 4.3.0 _q_layoutChanged() was introduced and the disconnect was
adjusted. But since _q_layoutChanged() is doing much more than
doItemsLayout() (e.g. restoring hidden sections), functionality was
lost. The problem was already observed for Qt 4.6 (QTBUG-18196) but
only partially fixed.

Task-number: QTBUG-41124
Task-number: QTBUG-54610
Change-Id: Id13a9930d0163812e12a0287016bab9c3aa02068
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-12-17 12:42:22 +00:00
Laszlo Agocs
7257862fb2 Set sharedPainter correctly for QGraphicsEffect
Autotest is taken from the previously reverted
8b1377fde1.

Task-number: QTBUG-60231
Change-Id: I44dd79cba22b6baefdd6d95c176790bef0b7eafe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-12-12 20:21:07 +00:00
Eskil Abrahamsen Blomfeldt
4d88d79aa5 Update usage of QFontMetrics::width() to new API
QFontMetrics(F)::width() has been deprecated and is replaced by
horizontalAdvance(). This updates all usage of it in tests and
documentation.

It is worth noting that many or most of the usages of
QFontMetrics::width() probably intended to use boundingRect().width(),
but since it currently works, I have not looked into that, just
replaced the function name mechanically.

Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-08 15:06:32 +00:00
Marc Mutz
f33a1f574a Port away from QRegion::rects()
Use being()/end() instead.

These were the last remaining uses of QRegion::rects() within qtbase.

Change-Id: I264beb6f660968f40eecbbee2260341fca94ddb5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-07 19:10:12 +00:00
Marc Mutz
85d8975bc9 tst_QWidget: port away from QRegion::rects()
Drop the useless copy 'r' of 'region', reuse 'r' for the rects in 'region',
to clean up the region handling in verifyColor().

Change-Id: I8e159976b4b0152823be864488d2ef25d7cb0078
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-06 18:30:52 +00:00
Marc Mutz
1d47df8d52 tst_QWidget: port some easy QRegion::rects() calls to begin()/end()
QRegion::rects() will be deprecated.

Change-Id: If890e70e3e44b22e15342d280aaa9d44013c4d7d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:16:59 +00:00
Friedemann Kleint
0ebf0cfb6f Blacklist tst_QSplitter::replaceWidget(visible, not collapsed) for Linux
The test is flaky on Linux.

Task-number: QTBUG-64639
Change-Id: Iec56ebce4f656f52187b34c8f655b137e41c3d17
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-12-01 09:53:01 +00:00
Edward Welbourne
c27348985d Simplify date-time formatting in textForRole()
QAbstractItemDelegatePrivate::textForRole() was formatting date and
time separately, then gluing the parts back together with space.
QLocale can do that just fine itself (it has a toString() overload
that handles a QDateTime) and might even (some day) do it better.  To
my mild surprise, this proved sufficient to fix a problem with
date-time display in tool-tips, when the date-time includes a zone.

Extracted the date-time part of an existing selftest into a test of
its own and extended it to test times of each spec-type; verified that
the non-local spec cases of this all failed before this fix.

Task-number: QTBUG-61069
Change-Id: I6d6be0c27be9a557d8afc3ced200a10b2aaff816
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-11-30 20:21:42 +00:00
Edward Welbourne
a755c2e521 Raise the upper bound on years to 9999
Test-case taken from bug-report; fits in as an easy row in an existing
data-driven test.  Add similar tests for date-time and time; and an
isValid test on the end of year 9999.  The date-time parser was using
the end of year 7999 as maximum value for dates and date-times; extend
this to year 9999, as I can see no reason not to.

[ChangeLog][QtCore][QDateTime] Years up to 9999 can now be parsed
without error (previously 8000 and beyond were treated as invalid) in
all formats (not only in ISO format).  Widgets handling dates now
support dates to 9999, likewise.

Task-number: QTBUG-64401
Change-Id: I518cfa6c2cb4ecc5a85b896dc9e56b4fdd8a8bb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-30 20:19:13 +00:00
Giuseppe D'Angelo
bdcbbd7d5b QTreeWidgetItem::insertChildren: ignore out of bounds indexes
QTreeWidgetItem::insertChildren should behave like a more-optimized
QTreeWidgetItem::insertChild. Unlike the latter, the former lacks
out-of-bounds checks, resulting in successful insertions even
when using an invalid index (say, bigger than the row/column count).
Reintroduce some sanity checks instead. This allows to fix a "fixme"
left in the autotest.

[ChangeLog][QtWidgets][QTreeWidgetItem] QTreeWidgetItem::insertChildren
now ignores insertions happening at invalid indices, for
consistency with QTreeWidgetItem::insertChild.

Change-Id: I1532597768cc6aff96a6e8f356bc6075b582801d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-11-30 13:01:45 +00:00
Friedemann Kleint
58b70c2f1a tst_QFileSystemModel: Stabilize readOnly(), sortPersistentIndex()
The tests start to show flakyness on Linux in 5.10 (rowCount() check
failing). This seems to point to a race condition between the files
showing up and the file system watchers of QFileSystemModel starting.

To fix this, close the file and wait until it shows up in the directory
before pointing the QFileSystemModel to it. The tests then no longer
rely on the file system watchers.

Change-Id: I39cffb4cacf6843e8e4180efb405345307c78dd8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2017-11-30 10:16:48 +00:00
Liang Qi
87204c856a Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/corelib/thread/qsemaphore.cpp
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
2017-11-30 09:16:58 +01:00
Liang Qi
7c4b0aa970 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/corelib/io/qstandardpaths_win.cpp
	src/plugins/platforms/ios/qioswindow.mm
	src/plugins/platforms/ios/quiview.mm
	tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp

Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
2017-11-23 12:52:18 +01:00
Liang Qi
153e8b49ad Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/network/access/qhttp2protocolhandler_p.h
	src/network/kernel/kernel.pri
	src/network/ssl/qsslkey_qt.cpp
	src/plugins/platforms/cocoa/qcocoascreen.mm
	src/plugins/platforms/windows/accessible/iaccessible2.cpp
	src/plugins/platforms/windows/accessible/iaccessible2.h
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
	src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
	src/widgets/widgets/qmenu_p.h
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/other/qaccessibility/tst_qaccessibility.cpp
	tests/auto/testlib/selftests/expected_cmptest.lightxml
	tests/auto/testlib/selftests/expected_cmptest.teamcity
	tests/auto/testlib/selftests/expected_cmptest.txt
	tests/auto/testlib/selftests/expected_cmptest.xml

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
2017-11-23 09:36:03 +01:00
Stephen Kelly
a6d7f38791 QHeaderView: Simplify and fix layoutChange handling
A layoutChange indicates that anything can have moved to anywhere else,
including as a result purely of new items being added. It can also
indicate that items are removed.

The old code here incorrectly assumed that the section count remained
constant over this operation by setting the size of the oldSectionHidden
QBitArray - whose size is the size before the layoutChange operation -
and then calling setBit with model rows numbered after the layoutChange
operation.  As the two are not necessarily the same dimensions, this can
result in asserts from the setBit call.

Simplify the handling of layoutChanged entirely by clearing section
information, and using the QPersistentIndexes which indicate hidden
state to restore that state after re-population.

Task-number: QTBUG-53221
Change-Id: I3cda13e86b51b3029b37b647a48748fb604db252
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-11-22 21:24:56 +00:00
Andy Shaw
53f48fceee Start from the first visible item when doing a search
Since the first item in a treeview might be hidden, start from the
first visible item in the view when starting or wrapping round
during a keyboard search.

Task-number: QTBUG-63869
Change-Id: I202bea567c6d4484c3ffaf8a5f9af8ea2e13708d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2017-11-22 13:49:52 +00:00
Christian Ehrlicher
ba2f3a156e QTreeView: recalculate row heights in hide/showColumn()
When calling QTreeView::hideColumn() the row heights are not
recalculated. This can lead to rows which are unnecessarily high due to
hidden columns may contain large (e.g. multiline) content. The same
applies to showColumn() - there the row might be to small.
Hiding columns directly via QTreeView::header()->hideSection() is not
covered by this patch since QHeaderView has no way to inform about
newly shown/hidden sections.

Task-number: QTBUG-8376
Change-Id: I20b1198e56e403ab8cf649af76e5e2280821dd68
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-11-17 20:28:34 +00:00
Liang Qi
c4885b21d6 Merge remote-tracking branch 'origin/5.9' into 5.10
Also blacklist tst_QNetworkReply::ioHttpRedirectErrors(too-many-redirects)
on RHEL 6.6 in CI.

 Conflicts:
	tests/auto/network/access/qnetworkreply/BLACKLIST
	tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Task-number: QTBUG-64569
Change-Id: I7514fc0660c18fd3a3e1d0d0af3f15d879e3c6f4
2017-11-17 08:59:14 +01:00
Richard Moe Gustavsen
7465329fe1 QAbstractButton: don't clear 'pressed' flag unless left button is released
As it stood, we would set 'pressed' to false regardless of which button that
was released. This would end up wrong if pressing the left button, and
at the same time, did a click with the right button. This would clear the
flag prematurely, and cause a release signal not to be emitted when later
releasing the left button.

tst_QAbstractButton: adding autotest

Adding tests to simulate the bug report's cases:
1) left press button
2) click right/middle key
3) move mouse out of button's boundary
4) test if the released() signal triggered properly

Taks-number: QTBUG-53244
Change-Id: Ifc0d5f52a917ac9cd2df5e86c0475abcda47e425
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-11-15 10:06:16 +00:00
Liang Qi
e4206c3cd5 test: blacklist tst_QWidget::multipleToplevelFocusCheck()
on all Linux. This amends 3bbeb1e9dc.

Task-number: QTBUG-64446
Change-Id: I24ca5b881502fac41922e07908801eefee7f31d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-11-14 04:55:43 +00:00
Tony Sarajärvi
212f92182a Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2017-11-12 15:35:48 +00:00
Liang Qi
3bbeb1e9dc test: blacklist tst_QWidget::multipleToplevelFocusCheck() and setToolTip()
on Ubuntu_16_04 and openSUSE_42_3.

Task-number: QTBUG-64446
Change-Id: If8fff2823f041428852822470a2f00157795558b
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2017-11-12 15:35:34 +00:00
Liang Qi
88cf044580 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/gui/kernel/qwindow.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
	tests/auto/widgets/kernel/qaction/tst_qaction.cpp

Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
2017-11-09 11:47:57 +01:00
Thiago Macieira
19b0ce5daa Change almost all other uses of qrand() to QRandomGenerator
The vast majority is actually switched to QRandomGenerator::bounded(),
which gives a mostly uniform distribution over the [0, bound)
range. There are very few floating point cases left, as many of those
that did use floating point did not need to, after all. (I did leave
some that were too ugly for me to understand)

This commit also found a couple of calls to rand() instead of qrand().

This commit does not include changes to SSL code that continues to use
qrand() (job for someone else):
  src/network/ssl/qsslkey_qt.cpp
  src/network/ssl/qsslsocket_mac.cpp
  tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-08 09:14:03 +00:00
Christian Ehrlicher
b4f4c384d9 QHeaderView: Honor maximumSectionSize property during resizeSections()
Resizing a QTreeeView section with double click or
resizeColumnToContents() does not respect the maximumSectionSize when
the resize mode is Interactive or Fixed. Since the documentation of
maximumSectionSize states that it should honor this property for those
cases either the documentation or implementation is incorrect.
This patch fixes the latter.

Task-number: QTBUG-64036
Change-Id: Ic14c8e444d50b9c50a117efed19d0bca7ec1cf82
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-11-06 18:18:09 +00:00
Friedemann Kleint
eb5994df13 tst_QWidget::multipleToplevelFocusCheck(): Avoid overlapping
The test showed flakyness on Linux. It has been observed that its
windows overlap. Position the windows beside each other.

Change-Id: I4ff1b9cafaf753a6844b3dfabb576a07f74b396a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-11-06 14:39:18 +00:00
Liang Qi
a7e4b645dc Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/corelib/global/minimum-linux.S
	src/network/access/qhttpthreaddelegate.cpp
	src/widgets/kernel/qwidgetwindow.cpp

Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
2017-11-05 18:02:18 +01:00
Jake Petroules
cd542a82b0 Remove references to obsolete platforms
ultrix and reliant have not seen a release since 1995. dgux not since
2001. bsdi not since 2003. irix not since 2006. osf not since 2010.
dynix... unclear, but no later than 2002. symbian needs no mention.
All considered obsolete, all gone.

sco and unixware are effectively obsolete. Remove them until someone
expresses a real need.

Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-11-05 06:33:53 +00:00
Gatis Paeglis
ad36da8ff4 testlib: start sharing common helper functions
... by moving them in QTestPrivate namespace (qtesthelpers_p.h). This
header file is a convenient staging area for helper APIs, eventually
some could be moved to public QTest API.

This header file utilizes the same pattern as other qtestlib header
files - wrapping functions with QT_${LIBNAME}_LIB to automatically
enable certain APIs based on what is in the projects dependencies,
e.g. QT += widgets.

Change-Id: Ic0266429939c1f3788912ad8b84fc6e0d5edd68b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-11-04 20:11:22 +00:00
Gatis Paeglis
01f5f77c66 tests: skip tst_QMenuBar::check_cursorKeys* on Unity
This test is flaky on Unity due to regression introduced by QTBUG-39362.
Skip the test functions until QTBUG-39362 is resolved.

These test functions do not fail on Gnome and KDE, so the functionality
tested by check_cursorKeys* will be covered by other linux distributions
in CI.

Change-Id: Ifd1a7779a9728142424f4956dd6466c822ccde91
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-11-04 20:11:14 +00:00
Elvis Angelaccio
a4f9cf2344 Disable window shortcuts if there is a window modal dialog
If a window is blocked by a WindowModal dialog, it should not be
possible to trigger window shortcuts on that window if it receives
a WindowActivate event.

This currently happens if the blocked window gets clicked, because the
window becomes the active_window and then QApplication sends it a
WindowActivate event (this doesn't happen with application modal dialogs).

The correctWidgetContext() function calls QApplicationPrivate::tryModalHelper()
only if the shortcut context is ApplicationShortcut. This patch makes it
call even if the shortcut context is WindowShortcut.

Change-Id: Iff87d85bcae603a6a24128e0cedfa9d33b6485fd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-11-04 17:41:17 +00:00
Jesus Fernandez
adf07e9223 tests: Make braces consistent
Make the function brace policy consistent.

Change-Id: Iaf1f05a63958f19927e9b1953da06f99a4eba644
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-11-03 15:55:53 +00:00
Liang Qi
17d5141113 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/windows/qwindowswindow.cpp
	tests/auto/widgets/kernel/qaction/tst_qaction.cpp

Change-Id: Ia017a825ed2ca2d53ac586f4ae48df6f65818d40
2017-10-30 08:54:05 +01:00
Friedemann Kleint
01c7b474f5 tst_QMenuBar: Port to QWindow-based mouse test API
Add some helpers to convert the coordinates and change the code to use the
QWindow-based mouse test API. Remove mouse presses on the second and third menu
from task256322_highlight() since moving the mouse is sufficient to switch
menus.
Remove blacklisting/skipping of macOS and offscreen.

Task-number: QTBUG-63988
Change-Id: If3e94170d11df369aec199d13d54d39382a78723
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-29 10:12:52 +00:00
Friedemann Kleint
ed31393e06 tests: Fix warnings about inconsistent override
tst_noqteventloop.cpp   'event' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'canFetchMore' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'fetchMore' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'hasChildren' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'rowCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'columnCount' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'index' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'parent' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtreeview.cpp 'data' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'begin' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'end' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'updateState' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'drawPixmap' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
tst_qtextedit.cpp 'type' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Change-Id: I2a0c5da15994619383c1f90fee311927e58d7af0
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2017-10-27 20:01:25 +00:00
Gatis Paeglis
754b636053 tests: use QSKIP for temporarily disabled tests
Change-Id: Ib088e943668d00cbbd0e6e04ab7d565477b0cc51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-27 11:37:26 +00:00
Gatis Paeglis
f239dbe60a tests: enforce Qt menubar in tst_QMenuBar::taskQTBUG56860_focus
... the same way other tests do in this file.

Change-Id: Ifcaee084bd20c55d6b9f7ddcf35daebce2a02e07
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-27 11:37:21 +00:00
Maciej Czarnecki
3b8f828174 QWizard: Do not remove the Next button's shortcut
Currently on Windows, the Next button's shortcut doesn't work, because
QWizard overrides it with an empty key sequence.
The key sequence should be changed only if isVistaThemeEnabled() returns
true.

Task-number: QTBUG-46894
Change-Id: I54f26388b167973cc8065a867d9e771c1e6a2a72
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-24 16:43:52 +00:00
Yulong Bai
7e7683cabb QAction: fix ::setData() always emits changed()
QAction::setData() always emits changed() even without actual data change.
Original code lacks a guard to check if the data changes.
According to http://doc.qt.io/qt-4.8/signalsandslots.html,
adding guard also benefits to prevent infinite looping in case
of cyclic connections.

Task-number: QTBUG-62006
Change-Id: I776369b668082f9f02e4502a36b1ae234ee7e079
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-10-24 16:43:30 +00:00
Allan Sandfeld Jensen
fa9d12f4a2 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/plugins/platforms/windows/qwindowsmousehandler.cpp
	src/plugins/platforms/xcb/qxcbimage.cpp
	tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/manual/qtabletevent/regular_widgets/main.cpp

Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io>
Done-with: Mårten Nordheim<marten.nordheim@qt.io>
Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
2017-10-24 13:40:55 +02:00
Liang Qi
32f50225c4 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/plugins/platforms/direct2d/direct2d.pro
	src/plugins/platforms/ios/qiosclipboard.mm
	src/plugins/platforms/windows/windows.pro

Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
2017-10-23 09:40:54 +02:00
Gatis Paeglis
0aba5546ef tests: fix and un-blacklist tst_qgraphicsview::hoverLeave
Tests should not use QCursor to emulate mouse move, see QCursor::setPos() docs.

The flakiness of the test on XCB is not surprising when the test queries geometry
even before the window has been shown. With the re-factored version I could not
reproduce flakiness anymore.

Removed Q_OS_MAC and closed QTBUG-26274 as test passes on macOS from which I
assume that the underlying issue has been fixed.

Removed Q_OS_QNX ifdef as test does not rely on QCursor anymore.

This patch also fixes the issues on minimal / offscreen platform plugins.
QCursor::setPos() is evil for auto test purposes.

Note:

We intentionally use QTest::mouseMove(QWindow *window, ..), not the QWidget overload.
The QWindow version gets routed through QWSI, which ensures that all necessary events
are generated as expect. In QWidget code path this is currently disabled by
QTEST_QPA_MOUSE_HANDLING.

Change-Id: I285c26cff09e3f2750f8c2abbb1f46c8f7be984a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1af927976a)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-10-17 13:58:29 +00:00
Liang Qi
d0a0a3c041 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	examples/network/fortuneclient/client.cpp
	examples/network/fortuneserver/server.cpp
	src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
	src/plugins/platforms/cocoa/qcocoabackingstore.h
	src/plugins/platforms/cocoa/qcocoaintegration.h
	src/plugins/platforms/cocoa/qcocoascreen.h
	src/plugins/platforms/ios/qiosbackingstore.h
	src/plugins/sqldrivers/oci/qsql_oci.cpp
	src/widgets/kernel/qwidgetwindow.cpp

Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
2017-10-17 10:34:24 +02:00
Gabriel de Dietrich
198225983d QShortcut: Fall back to cross platform code in absence of QPA menu
On macOS, absence of a QPA menu means that we should be using our
own internal logic since there's no entity on the QCocoaMenuDelegate
to take care of the shortcuts.

Change-Id: I35ed8f0b55445f61d0528709d4debb636a502002
Task-number: QTBUG-61039
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-10-17 02:34:35 +00:00
Liang Qi
01afc8c810 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
2017-10-16 22:21:52 +03:00
Kai Koehne
f6cca6ab8a Replace 'an unique' with 'a unique'
Unique begins with a "y" sound, hence a unique is correct.

Change-Id: I9eb6b4d4c9ddab45af931e97c041c24edf163eca
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-11 18:44:57 +00:00
Tony Sarajärvi
e03b64c5b1 Extend blacklisting of tst_qwidget tests to cover RHEL 7.3 & 7.4
The autotest has been blacklisted for RHEL 7.1 and RHEL 7.2 earlier already
and it is still failing in 7.4.

Task-number: QTBUG-46116
Change-Id: I0f33be849513a2debaf8c093dcd413fa09b5c681
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2017-10-11 09:35:05 +00:00
Tor Arne Vestbø
08e083e682 Ensure result of all QTest::qWaitFor are verified
The qWaitFor functions themselves can not trigger a test failure, as that
will not result in the test function exiting early, so every single call
to qWaitFor needs to be wrapped in a QVERIFY.

Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-05 15:15:36 +00:00