When tabbing/searching for the next focus widget, the current
code would check if the next widget in the focus chain
had a focus proxy, and if so, ignore it. The exact reason
for this behavior is not clearly understood, but some widgets
(e.g QSpinBox) has children (a QLineEdit) that sets the parent
as focus proxy. If we didn't ignore children with focus proxy, tabbing
from a QSpinBox would lead us to find the inner QLineEdit, which
(because of its proxy), would lead us back to the QSpinBox. And
therefore not be able to tab out.
But ignoring the focus proxy has other problems. Normally a focus
proxy is the next sibling to the widget it acts as a proxy for, and
tabbing to the widget will therefore appear correct. But if the
focus proxy is not the next sibling, the logic will fail, since
the tab would anyway give focus to the next sibling. This becomes very
apparent if the focus proxy is a child of the widget, since then
its likely that the focus proxy is not the _first_ child among all
the children. So tabbing to the parent would not give focus to
the proxy.
This patch will change this logic so that you are allowed to tab to a
widget with a focus proxy. But we check that if you do so, you actually
end up moving focus in the right direction. If not, we ignore it like
before. This will ensure that we tab correctly when dealing with focus
proxies, and especially when focus proxies are used to construct
compound widgets.
[ChangeLog][Widgets] When tabbing to a widget with focus proxy, focus
will now be given to the proxy rather than just being ignored.
Task-number: QTBUG-10907
Change-Id: I66d1da5c941fdd984bb2783cc355ca65b553b5dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This autotest is blacklisted as it is deemed flaky.
Task-number: QTBUG-63260
Change-Id: I3e83bcb0dbbe4fbf9d5c16f764fbeeca2b52d10c
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
Remaining uses of Q_NULLPTR are in:
src/corelib/global/qcompilerdetection.h
(definition and documentation of Q_NULLPTR)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Remaining uses of Q_DECL_OVERRIDE are in:
src/corelib/global/qcompilerdetection.h
src/corelib/global/qglobal.cpp
doc/global/qt-cpp-defines.qdocconf
(definition and documentation of Q_DECL_OVERRIDE)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
When scrolling to the bottom of the view, if there are expanded items
then it should call canFetchMore/fetchMore up the chain until it
finds one with more items that can possibly be retrieved.
This brings it in line with the QAbstractItemView implementation
which would call canFetchMore on the root index, therefore we
go up the chain to the root to see if anything before that can be fetched.
[ChangeLog][QtWidgets][QTreeView] QTreeView now calls canFetchMore and
fetchMore when the bottom of the QTreeView is scrolled to.
Task-number: QTBUG-48725
Change-Id: I2b2145684bb34c8c317bfce4a0ef14f243a64719
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
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>
Speeds up the test from approximately 770ms to 180ms.
Change-Id: I2e5479fd5190b841b44d4a66380d27b1c3b55162
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Conflicts:
examples/examples.pro
qmake/library/qmakebuiltins.cpp
src/corelib/global/qglobal.cpp
Re-apply b525ec2 to qrandom.cpp(code movement in 030782e)
src/corelib/global/qnamespace.qdoc
src/corelib/global/qrandom.cpp
src/gui/kernel/qwindow.cpp
Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08)
src/network/ssl/qsslkey_openssl.cpp
src/plugins/platforms/android/androidjniinput.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/widgets/widgets/qmenu.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
This reverts commit 8561281768.
This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.
Change-Id: Ice250ecedb14ac96fb3693b2d9884ef452a91cc2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
This reverts commit 3d5bf00f18.
This change needs to be reverted because Windows 10 Creator's
Update doesn't fail on this test anymore during CI runs.
Reason for this is unknown.
Change-Id: I9f1c88606c97afc5952af34e04310612b783a9c2
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
When calling resize() from showEvent(), we'd set the full geometry
on the widget's QWindow. This resulted in the top-level window
being moved to the top-left corner, even though no other call to
move() or setGeometry() had happened before.
The solution consists on calling the proper QWindow methods depending
on whether setGeometry_sys() is called for a move, a resize or both.
Furthermore, this needs QWindow::resize() to set its position policy
to frame-exclusive. The documentation states that is already the case
and we're setting the full geometry on the platform window, so we need
to convey that bit of information.
This also solves the age-old conundrum: "### why do we have isMove as
a parameter?"
Change-Id: I2e00fd632929ade14b35ae5e6495ed1ab176d32f
Task-number: QTBUG-56277
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Has become flaky on CI. Does not fail locally.
Change-Id: I42938849571938db78b16a72c215442a69f7c2d5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QLineEdit with a mask does not return empty fields with the
ImSurroundingText query. This is a problem for the input
context that is not aware of the mask and relies on the
fact that the cursor position never exceeds the boundaries
of the surrounding text.
This change fixes the issue by returning unmasked text with
the ImSurroundingText query.
[ChangeLog][QtWidgets][QLineEdit] Fixed behavior of the
ImSurroundingText query. Previously, it returned a masked
text whose length may be less than the cursor position.
Now it returns unmasked text, so the text length is always
greater than or equal to the cursor position.
Task-number: QTBUG-60319
Change-Id: I1c8009164836a1baa2e3a45958bf1ea5fa9be38d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Conflicts:
src/widgets/kernel/qwidget.cpp
This merge also extends the expected output of the pairdiagnostics
teamcity output (added in dev in commit
c608ffc56a) after the recent addition of
the flowId attribute to the teamcity output (commit
8f03656211 in 5.9).
Change-Id: I3868166e5efc45538544fffd14d8aba438f9173c
If in a slot connected to QAbstractItemView::clicked
QAbstractItemView::setModel(nullptr) is called the method
QAbstractItemView::mouseReleaseEvent will cause a segmentation fault.
The problem is that the method QAbstractItemView::model used in
QAbstractItemView::mouseReleaseEvent will return a nullptr if a null
model was set. The solution is to used d->model since it is always a
valid model. (See line d->model =
(model ? model : QAbstractItemModelPrivate::staticEmptyModel());
in method QAbstractItemView::setModel)
Change-Id: I6f01bdeac64495ee4a76adcc7bf8da8a7719ef4d
Reviewed-by: David Faure <david.faure@kdab.com>
These tests need fixing, but they are already partially blacklisted
and need investigation once the switch is completed.
Task-number: QTQAINFRA-1292
Task-number: QTQAINFRA-1355
Task-number: QTQAINFRA-1362
Change-Id: Ic50d0c4a01ee7e72be1129d418eff244ba783185
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This test fails on Windows 10 x64 Creators Update CI builds for unknown reasons.
Change-Id: I766bccfd4dea9ea195c68403018b419e800a7b3b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
tst_qgraphicswidget::checkReason_ActiveWindow fails on Windows 10
Creators Update. Added expect fail for Windows platform.
Task-number: QTBUG-62244
Change-Id: I71868a496659e7136af9a5b74684ba39edaf03ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Moving the cursor is not synchronous.
Change-Id: I6b820af026585e1fcfef845cc712fa8f6812e941
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
internalInsert() will set the cursor to the right position which accounts
for any input mask set on the control as well. Therefore it will already
be placed at the next correct position and should not be changed again
after that.
Task-number: QTBUG-40943
Change-Id: Ic0f5fad6999ddd367e435ec4409a5db5b9eacb7b
Reviewed-by: Daniel Teske <qt@squorn.de>
Reviewed-by: David Faure <david.faure@kdab.com>
Change-Id: Id220f10f4ff756230155c7c8f37713d53ed3ca0c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's flakey/failing on macOS, the menu is opened but opened above
the button, so the intersection test fails.
Change-Id: I6b13a1b0df2b07fa36bbb73071cdeb55547ac93a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
...tst_qlineedit.cpp:1938:9: warning: explicitly assigning value of variable of type 'Qt::Key' to itself
-Wself-assign]
key = key;
~~~ ^ ~~~
Change-Id: I18a46f61e13f6e2c74edce869a1c36a7f3a0fb70
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Counting draw calls in the style is not a reliable way to count
italic items in the combobox.
Task-number: QTBUG-62080
Change-Id: I6cb6d54535f073f66cfcf61bb19eb645284c835d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Don't assume signals will not be emitted during show. The test should
focus on testing that changing the model results in change signals. What
happens before that is not under test, and not stable.
Change-Id: I71e62abc15fc81c069d7685e4342e795449c3632
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's failing when enabling synchronous expose events, but likely
due to making assumptions about expose behavior. Will be looked
at in more detail once the expose event patch is in, so we can
move forward.
Task-number: QTBUG-62092
Change-Id: Ie76b5f11ccf841981a42d2eda19fbcda8b43c36c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Getting the end position of the selection was not possible.
[ChangeLog][QtWidgets][QLineEdit] Added selectionEnd(), selectionLength(),
complementing selectionStart().
Change-Id: Iaecc624063d7c043f9502351f07eb76f869e86f1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This is the result of running the (experimental) clang-tidy check
qt-modernize-qsharedpointer-create
Discarded changes:
- tst_qsharedpointer.cpp: not sure we want these replacements there
(→ separate change)
- tst_collations.cpp: hit in a template specialization that is
instantiated with both QSharedPointer and QSharedDataPointer.
Change-Id: I203c2646e91d026735d923473af3d151d19e3820
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Verify that all pixels of the grabbed image are green instead
of comparing an image loaded from file.
The test then also passes when High DPI scaling is active in
which case a twice as big pixmap with DPR=2 is obtained when
grabbing the widget.
Change-Id: Ie5244a39a68ea0defd2590cf30f251d660d0869b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Scale coordinates in a few places, remove pixmap scaling in
grabWindow() (Windows).
Change-Id: Iba9e5d3ca55422a14eda09c8d04329a455d3acb3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It's broken due to tst_QWidget::testDeletionInEventHandlers,
but the root cause is not known yet.
Task-number: QTBUG-61986
Change-Id: I5b77efaf6910123d10a1456c54b873100e538a69
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Change-Id: I7dbe9c7a91301e0002f9e1827f6d0b495d2b9ec5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>