Commit Graph

2410 Commits

Author SHA1 Message Date
Liang Qi
947e1f45c7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp

Change-Id: Ifaa56153f5f0d687a6b4d94f84fcfa1e1751afd2
2020-03-31 12:30:18 +02:00
Andy Shaw
2e0c29a4bb itemviews: Use the start of the current selection when getting the range
When doing a shift-select while moving the mouse then the start point
should be based on the start of the current selection and not the
pressed position. If there is no current selection start index, then
we can safely depend on pressed position as this will be the previous
index pressed on.

This resolves an issue introduced by
e02293a76d when fixing QTBUG-78797

Fixes: QTBUG-81542
Change-Id: Ia66c42b220452fdcbc8cfccc05dbc8a3911c3f5e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-30 11:17:59 +00:00
Lars Knoll
46ebd11e66 Fix deprecation of QComboBox:::currentIndexChanged(const QString&)
Don't introduce another overload with two parameters. Users
want a simple signal to connect to, not another overload. Deprecate
the currentIndexChanged(QString) overload, usage of that can/should
get replaced by currentTextChanged().

This partially reverts commit 11dc7b35c8.

Change-Id: I5e7d16413f3d62b1a5a7a197f510af2c45cdfa55
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-03-25 13:09:38 +01:00
Mitch Curtis
3f744be923 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-23 13:55:35 +01:00
Volker Hilsheimer
580e9eedf7 QDateTimeEdit: with keyboardTracking off, allow values outside the range
QDateTimeEdit very aggressively prevents user input that would result in
values that are outside the dateTimeRange. While keyboardTracking is on
this makes sense, as otherwise the dateTimeChanged signal would be
emitted after each section, with a value that is outside the range.

However, this prevented users from entering a date that is allowed, but
where sections of the date are above or below the respective section in
the maximum or minimum value.

If keyboardTracking is off, QDateTimeEdit only emits the dateTimeChanged
signal at the end of editing, when focus is lost or the return key is
pressed, and then it enforces that the value is within the range anyway.
This change makes the parser ignore the range during editing if
keyboardTracking is off, thus allowing the user to enter a date where
temporary values are outside the range.

The test makes sure that we don't get signals emitted with out-of-range
values, testing both with and without keyboard tracking.

Change-Id: I00fb9f1b328a3477163f890c4618b40878657816
Fixes: QTBUG-65
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-20 22:18:00 +01:00
Mitch Curtis
69a5be7ef0 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ib2a2e3a292af43be3a980c2ccc943c08f4bbf72f
2020-03-20 11:28:14 +01:00
Volker Hilsheimer
e7cff5bca7 Fix keypad navigation within a button group for push buttons
Keypad navigation within a group should work for auto-exclusive buttons,
or for checkable buttons that are in a button group. Since the code
already tests whether the button should be treated like an exclusive
(which implies checkable) button, use the result of that test when
finding the candidate button to move focus to, and not only when
actually changing the checked button and the focus.

Change-Id: I4dc41a90d51a8304483046252ceff0ebfe2a2e52
Fixes: QTBUG-27151
Done-with: david.faure@kdab.com
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-20 08:20:00 +01:00
Qt Forward Merge Bot
22daba4ff9 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iaab37b633a8286c2c21425aaac34d30529a3ea82
2020-03-18 11:44:49 +01:00
Timur Pocheptsov
05dd80871c tst_QMenu: make QSKIP message truthful
Since the test was refactored and QCursor::setPosition() replaced
with QTest::mouseMove(), the test is completely crippled on macOS,
since it relies on the parts in widget's code, ifdefed with condition
!Q_OS_OSX and commented as "Cocoa tracks popups". Yes it does,
but not for "fake" events generated by QTest. The original test
was introduced when fixing different problems on non-Apple platform(s)
anyway. Let's make QSKIP message saying the truth.

Task-number: QTBUG-63031
Change-Id: If54f195ccc0d4409cc2e7f4ae0b0fbf43989b286
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-18 10:02:29 +00:00
David Faure
97422abcfc QTreeView: don't call model.index(-1, 0) when using spanning items
drawTree() does
    QPoint hoverPos = d->viewport->mapFromGlobal(QCursor::pos());
    d->hoverBranch = d->itemDecorationAt(hoverPos);
and itemDecorationAt does
    const QModelIndex index = q->indexAt(pos);
which might very well be an invalid index.

Change-Id: I7db98871543bd7e1c57fcc475d2646757bf2bb42
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-03-16 10:44:26 +01:00
Shawn Rutledge
7d20f86958 Stabilize and rename tst_qmessagebox::expandDetails_QTBUG_32473
This has been flaky on OpenSuSE; if the stored geom.topLeft() is 0,0
it apparently means the window manager (probably kwin) didn't get around
to decorating and repositioning the dialog by the time
qWaitForWindowExposed() returns.  Because we check later to see whether
it moved, we need to be certain of its initial position.

Waiting for the extra "fleece" widget to be shown was based on the
theory that by the time the X server has processed messages related
to that new window, the WM should be done processing the consequences
of the resized dialog window.  But there's no such guarantee, so let's
try removing that.  On the other hand, removing the delay does open
us up to miss a regression (maybe the dialog gets moved after we have
checked that it didn't move).

Rename because we don't name autotests after bugs.

Amends 26ddb586ac

Task-number: QTBUG-32473
Change-Id: I6bbfe2b4baaee389db0d4112f0fec3b7cb9da554
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-03-12 18:46:44 +01:00
Qt Forward Merge Bot
116d68f105 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/plugin/qlibrary.cpp
	src/corelib/plugin/qlibrary_unix.cpp
	src/corelib/plugin/qpluginloader.cpp

Change-Id: I866feaaa2a4936ee5389679724c8471a5b4b583d
2020-03-11 11:27:49 +01:00
Jarek Kobus
50d2acdc93 Add default arguments to QPainterPath methods using transform
Fixes: QTBUG-82602
Change-Id: Id82f145ffb33e6d4ef9b81282ad14657b1c8fbd0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-06 21:09:48 +01:00
JiDe Zhang
4f370d36ec xcb: Fix logic for minimized state
When _NET_WM_STATE_HIDDEN is not contains in the _NET_WM_STATE
window property, the window should not be considered to be minimized

According to
https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html
_NET_WM_STATE_HIDDEN should be set by the Window Manager to indicate
that a window would not be visible on the screen if its desktop/viewport
were active and its coordinates were within the screen bounds. The
canonical example is that minimized windows should be in the
_NET_WM_STATE_HIDDEN state. Pagers and similar applications should use
_NET_WM_STATE_HIDDEN instead of WM_STATE to decide whether to display a
window in miniature representations of the windows on a desktop.

For mutter/GNOME Shell, without _NET_WM_STATE_HIDDEN, window manager
will not reply XCB_ICCCM_WM_STATE_ICONIC settings in WM_CHANGE_STATE
client message.

Task-number: QTBUG-76147
Task-number: QTBUG-76354
Task-number: QTBUG-68864
Done-With: Liang Qi <liang.qi@qt.io>
Change-Id: Ic9d26d963979b7f0ef4d1cf322c54ef8c40fa004
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-03 22:08:18 +01:00
Volker Hilsheimer
b4669b9190 QMenu: hide when a QWidgetAction fires the trigged signal
QMenu hides regularly when the user interacts with it, and manages
the firing of signals based on that. It ignores if a QAction that is
added to it fires the triggered() signal programmatically.

With QWidgetActions added to the menu, the menu usually doesn't get
interacted with directly, as the widget gets the input events.
Since the action can be added to multiple menus, neither widget nor
action can interact with the menus programmatically. Instead, the
menu needs to hide when the widget action triggers.

Test included that covers the case where a QWidgetAction is added
to multiple menus that are visible. Documentation updated, and
removed a redudant paragraph as a drive-by change.

[ChangeLog][QtWidgets][QMenu] a popup menu hides when a QWidgetAction
added to it fires the triggered signal.

Change-Id: I69f378426a45c2e46cebdaa5e6f1b21c8fb03633
Fixes: QTBUG-10427
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-03 18:52:11 +01:00
Qt Forward Merge Bot
60ec012d8d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I851c0328c3c38ea67b5ad115b205ac6a1262706e
2020-02-29 01:00:44 +01:00
Edward Welbourne
305ddbeb5b Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Volker Hilsheimer
924b97d6ab Fix QDateTimeEdit's handling of invalid time in dst gap
During a spring forward, a time-zone omits an hour. A QDateTime with
such an hour is invalid, but QDateTimeEdit's handling of this invalid
time was not done correctly.

With this fix, up/down changes of any field that would result in an
invalid date-time corrects the time to be valid, while leaving as
much as possible of the user-entered data unchanged. To do that, we
rely on QDateTime::toMSecsSinceEpoch to return a value even for such
an invalid time, which then can be used to construct a valid
QDateTime.

Edits that would result in an invalid hour are reverted to the
previous when pressing return, if correctionMode is
CorrectToPreviousValue. This change also implements support for
CorrectToNearestValue, which uses the same mechanism as when stepping
over an invalid time.

Include a test that verifies that the various interactions result
in a reasonable value. Since QDateTimeEdit does not respect the
timezone or timespec of the QDateTime it is initialized with, we
have to find the first hour of daylight saving time for a year
that we know works for most time zones. Failing that, we have to
skip the tests. Verified in a wide range of time zones.

Change-Id: I05b906ae3b5f6681891d23704f00f9c10cd479ae
Fixes: QTBUG-79803
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-27 19:35:28 +01:00
Volker Hilsheimer
31b06a0437 QWizard: deprecate visitedPages and add visitedIds instead
As per the ### Qt 6 comment. A method visitedPages should, following
the convention of the other QWizard APIs, return a list of QWizardPage
pointers. Since the method returns a list of IDs, visitedIds is the
correct name.

[ChangeLog][QtWidgets][QWizard] visitedPages has been deprecated, use
visitedIds instead.

Change-Id: Ifdb94adf093be14cb48c84cb40818c55ff5189a0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-02-27 19:35:19 +01:00
Volker Hilsheimer
6324873543 Stabilize task255529_transformationAnchorMouseAndViewportMargins
This test doesn't test whether window activation works, so there is
no reason to fail the test if it doesn't. Instead, abort the test, so
that we can record it as a skipped test.

Change-Id: Ia44308ef17f110d40c6455d7ee85d90914face4f
Fixes: QTBUG-22455
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
2020-02-27 10:24:09 +01:00
Qt Forward Merge Bot
226533fd85 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iad459349ea8b4090d79b4771bfff8f656a8a8189
2020-02-26 01:00:08 +01:00
Liang Qi
4403ec3bc1 tests/xcb: fix tst_QWidget::updateWhileMinimized() on mutter/GNOME Shell
Task-number: QTBUG-68862
Change-Id: I6247867ae4ec126ab0549741f2d2d491a7f2e8a0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-25 18:58:17 +01:00
Friedemann Kleint
a5ea2f7e99 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ibe5b4aa249863a54007180f3684dc5ce1b23cb7b
2020-02-24 08:40:45 +01:00
Christian Ehrlicher
875420f1c2 QAbstractItemView: Make sure to update the editor geometries
QAbstractItemView::setIndexWidget() does not trigger a relayouting when
a new widget is set. This results in a wrong editor geometry under some
circumstances. Fix it by triggering a delayed relayout.

Fixes: QTBUG-81763
Change-Id: I75d0e19bd5e56d63effe4990d782d202fb39e3e6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-23 10:48:53 +01:00
Volker Hilsheimer
962a3d8a98 Stabilize QFileSystemModel::dirsBeforeFiles test
Make the test operate in its own temporary directory, so that entries
left behind by other test functions don't impact this test.

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

In case of sort failure, print diagnostics.

Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fixes: QTBUG-75452
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 4e796e0b0d)
Change-Id: I144b68a17280a38cc7d6daf7ec343eea4453623d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-22 02:52:44 +01:00
Volker Hilsheimer
f79efbc867 Un-blacklist QFileSystemModel::dirsBeforeFiles
After 4e796e0b0d we only have blacklisted
passes in the database, and no flaky failures on macOS.

Exception is WinRT, which stays blacklisted.

Change-Id: Ie1c492d20c76d4ba12b3f513ac038f023b864cb1
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-20 11:23:44 +01:00
Volker Hilsheimer
1821f5163d Fix font and palette propagation for themed children created at runtime
Widgets have a default palette and font that is influenced by several
factors: theme, style, QApplication-wide overrides, and the parent's.
If an application sets a font or palette on a parent, then widgets
inherit those settings, no matter when they are added to the parent.

The bug is that this is not true for widgets that have an application-
wide override defined by the platform theme. For those, we need to merge
parent palette and font attributes with the theme, and this is currently
not done correctly, as the respective masks are not merged and inherited.

This change fixes this for fonts and palettes. Children are inheriting
their parent's inheritance masks, combined with the mask for the
attributes set explicitly on the parent. This makes the font and palette
resolving code correctly adopt those attributes that are set explicily,
while leaving everything else as per the theme override.

The test verifies that this works for children and grand children added
to a widget that has a palette or font set, both when themed and
unthemed. Children with own entries don't inherit from parent.

The QFont::resetFont test had to be changed, as it was testing the
wrong behavior. If the child would be added to the parent before the
font property was set, then the test would have failed. Since this
change makes sure that children inherit fonts in the same way, no
matter on when they are added to their parent, the test is now
modified to cover both cases, and ensures that they return identical
results.

[ChangeLog][QtWidgets][QWidget] Fonts and palette settings are inherited
by children from their parents even if the children have application-
wide platform theme overrides.

Change-Id: I179a652b735e85bba3fafc30098d08d61684f488
Fixes: QTBUG-82125
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-20 08:04:47 +01:00
Tor Arne Vestbø
8c3cc07bf5 widgets: Translate QWindow move events into widget relative position
If a widget backed by a QWindow is moved we need to translate the window
geometry into a position relative to the parent widget. In most cases this
was incidentally working due to widgets backed by QWindows always having
QWindow parents too, so the QWindow position was applicable to the widget
as well. But when Qt::WA_DontCreateNativeAncestors is used this is no
longer the case, and we would end up with a widget geometry that included
the parent positions all the way up to the next native widget.

The updatePos() function has been squashed into handleMoveEvent(), since
we need to ensure the position in the move event sent to the widget is
correct as well.

Change-Id: I55894ad7ab42a6d4d65e446a332ecdd7dcdcc263
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-19 20:04:19 +00:00
Andy Shaw
9029c55864 Send the LanguageChange event to all top level windows, not just widgets
By sending it to all top level windows it will make it possible for
non widget based controls to listen for this event if it cares about it
so it can handle translation updates as appropriate.

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

Change-Id: I7d2120c02eb870040b2ee94986a2ac5608d5a423
Fixes: QTBUG-66345
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-02-17 17:47:56 +01:00
Jan Arve Sæther
5e83a2eed2 Deprecate one overload of QInputDialog::getDouble() for 5.15
...and merge the two overloads of getDouble() in Qt6

Change-Id: I55faa2ff222b41e48889a0ef14dd00a6da691c36
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-12 16:10:24 +01:00
Volker Hilsheimer
4e796e0b0d Stabilize QFileSystemModel::dirsBeforeFiles test
Make the test operate in its own temporary directory, so that entries
left behind by other test functions don't impact this test.

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

In case of sort failure, print diagnostics.

Change-Id: I44c2b82ef1330cc8787aed2b5cbf109ef3a67876
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Fixes: QTBUG-75452
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-11 17:27:41 +01:00
Vitaly Fanaskov
11dc7b35c8 QComboBox: deprecate currentIndexChanged(const QString&)
Task-number: QTBUG-81845
Change-Id: Ia0ff5321423a5d3d4853bd425dd7236926f16047
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-02-11 10:37:10 +01:00
Qt Forward Merge Bot
9634055543 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I5d80d84d1fd9f52e7c8e4895cc34d4d29043f400
2020-02-08 01:00:08 +01:00
Wang Chuan
75285b64ad QComboBox: send font change event to popup menu when font changed
The font change in QComboBox might cause incorrect appearance of popup
menu since it doesn't notify popup menu to relayout itself

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

Fixes: QTBUG-75846
Change-Id: I4821015cca95a7e233a22262596a6fbf27f10aef
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-02-07 09:18:47 +08:00
Qt Forward Merge Bot
8ce0ad805d Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/network/ssl/qsslsocket_openssl_symbols.cpp

Change-Id: I8c13b5c48a8ecce96540b39c6d5f8ca146eb2339
2020-02-06 11:10:34 +01:00
VaL Doroshchuk
9ecc595d71 widgets: Don't create winId when the widget is being destroyed
When QWidget is being destroyed, its winId is cleared, and
a QEvent::WinIdChange is sent. If a listener of this event
reacted by calling winId() again, we might crash.

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

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

This will lead to infinite loop:

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

Fixes: QTBUG-81849
Change-Id: Ib4c33ac97d9a79c701431ae107bddfb22720ba0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-05 11:05:24 +01:00
Qt Forward Merge Bot
97417e8f28 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	.qmake.conf
	examples/widgets/widgets/imageviewer/imageviewer.cpp
	src/corelib/text/qchar.cpp
	src/corelib/time/qdatetime.cpp

Change-Id: I9762f5c4ff650799219729d6aee79ac07ce9024a
2020-02-04 10:44:00 +01:00
Morten Johan Sørvig
17affdfbcb Blacklist failing tests on macOS 10.14
These tests fail locally, and have been reported to
fail on the CI system.

Change-Id: Ia76bb15c288af4171ebe47b3c30f3651a63df3f2
Task-number: QTBUG-75786
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-30 13:47:27 +00:00
Giuseppe D'Angelo
78edc18057 QGraphicsProxyWidget: fix handling of proxy focus
If a widget inside a QGPW has a proxy focus, the code would keep
sending focus in events to the proxy even if the proxy was already
focused. Amend the check in place to prevent this from happening.

Change-Id: Id28d3bfe4f396da5c9477df713441ca7d506662f
Fixes: QTBUG-51856
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-29 19:57:02 +01:00
Volker Hilsheimer
6e1d70ae12 QPushButton: only trigger button when click occurs within the bevel rect
On the mac, the push button's bevel doesn't cover the entire widget
rectangle, but is smaller to leave space for focus frame, shadow, and
in general to meet style guidelines. Without this change, a click
anywhere inside the widget would activate the button.

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

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

Change-Id: I01b60a763bccf39090aee5b2369af300f922d226
Fixes: QTBUG-81452
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-28 22:26:26 +01:00
Qt Forward Merge Bot
6c3eb39832 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-28 16:02:04 +01:00
Qt Forward Merge Bot
082faeff9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/image/qpnghandler.cpp

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

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

Task-number: QTBUG-46653
Fixes: QTBUG-81627
Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-28 04:12:25 +01:00
Andy Shaw
bb42b7d8b2 Make sure the focus is passed on correctly when back-tabbing
When the tested widget has a focus proxy, then we should check if the
current focus widget is not the same as that focus proxy before setting
it to be the widget that gets focus. This ensures that when back-tabbing
from a widget like QDoubleSpinBox that it will not get stuck inside that
widget and will back-tab to the next correct one.

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

Fixes: QTBUG-81222
Change-Id: Ide3a6897e43f389d396a80d8b158f7c8eb04e3aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-01-25 08:10:27 +01:00
Tor Arne Vestbø
92918e567a Flatten version-specific blacklisting on macOS to all macOS versions
We don't know which versions these blacklistings actually apply on
unless we actually get macOS 10.14 and 10.15 into the CI and running
tests, so let's start with that, and then granularize the blacklists
after that.

Task-number: QTBUG-75786
Change-Id: Id79642afa50cb20efa2cd209286b6933918d3a4a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:58:31 +01:00
Tor Arne Vestbø
f047c44e71 Extend blacklisting for a few tests to include all macOS versions
Task-number: QTBUG-75786
Change-Id: I06867de99a19f9e46ac0eeea10a7365a30c49c6d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:26:23 +01:00
Tor Arne Vestbø
14690e9cf1 Blacklist two tst_QScroller tests on macOS
Task-number: QTBUG-75786
Change-Id: I43e0a9a6e28a67f6aa1f2adaecd60ed0d65601d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 17:26:22 +01:00