Commit Graph

561 Commits

Author SHA1 Message Date
David Faure
ba6e0e4aac QHeaderView: fix assert when restoring section sizes over less columns
If columns are removed and we get notified via layoutChanged, the code
tries to restore old section sizes, and went out of bounds, leading to
an assert in QVector. Simply add an if() to skip restoring out-of-bounds columns.

This comes from https://bugs.kde.org/show_bug.cgi?id=395181,
which translates into the unittest that is part of this commit.

Change-Id: Ide42176a758f87b21957c40508127d67f1d5a2d9
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2019-04-23 09:42:54 +00:00
Liang Qi
b1a216649e Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	qmake/generators/makefile.cpp
	qmake/generators/unix/unixmake2.cpp
	src/corelib/thread/qthread_unix.cpp
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
2019-06-14 13:45:18 +02:00
Qt Forward Merge Bot
043f99954f Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Icc9b061c56e969756f0351c936cdeb8063c86079
2019-02-28 01:00:15 +01:00
Alexander Volkov
f657c74263 QListView: Fix Shift+click selection for non-default itemAlignment
QListView::setSelection() algorithm is designed for items to
occupy their cells completely, which is not the case when
itemAlignment is used. The middle part of the selection rect
goes beyond the column borders and extra items are selected.

Use the introduced cellRectForIndex() instead of rectForIndex()
to calculate the middle part correctly.

Fixes: QTBUG-73684
Change-Id: I4a1e42a056d56e85a16d8ae0ffe18b78d1d6deb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-27 15:58:56 +00:00
Andy Shaw
7e60858cbc Don't edit the item if we did not get the press event on the same item
With a QTreeView it is possible that collapsing an item can cause the
item under the mouse to be a new one and over the checkbox area for the
new item. As a result, a release can cause it to change the check state
even though it did not get the press for that item. This ensures that
it only allows the edit if it got the press as well.

Fixes: QTBUG-61476
Change-Id: I9a0821466afc84c97c9819755ccbacd729f7fbd7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-02-26 14:18:18 +00:00
Christian Ehrlicher
1b5a17632e Fix deprecation warnings in widget autotests
Fix all deprecation warnings within tests/auto/widgets

Change-Id: I854f54c0a1dc0a0086f626b93cd39f63cb1b6033
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-02-08 18:00:51 +00:00
Liang Qi
fbfacd33be Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/android/templates/AndroidManifest.xml
	src/network/ssl/qsslsocket_mac.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/corelib/kernel/qtimer/BLACKLIST
	tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
	tests/auto/testlib/selftests/expected_blacklisted.lightxml
	tests/auto/testlib/selftests/expected_blacklisted.tap
	tests/auto/testlib/selftests/expected_blacklisted.teamcity
	tests/auto/testlib/selftests/expected_blacklisted.txt
	tests/auto/testlib/selftests/expected_blacklisted.xml
	tests/auto/testlib/selftests/expected_blacklisted.xunitxml
	tests/auto/testlib/selftests/expected_float.tap
	tests/auto/testlib/selftests/expected_float.teamcity
	tests/auto/testlib/selftests/expected_float.txt
	tests/auto/testlib/selftests/expected_float.xunitxml

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
2019-02-08 12:31:02 +01:00
Alexander Volkov
f6edb0ef72 Improve keyboard navigation in QListView when isWrapping is enabled
Search the previous item or the next item in a model instead
of searching them on visual layout. This way the cursor will
not stop at the beginning or at the end of a row or a column.

Fixes: QTBUG-14444
Change-Id: I0ef203a4dcd876e4c50559fb87e61585f07434d1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-06 09:50:58 +00:00
Christian Ehrlicher
d726ccb83c tst_QHeaderView: fix defaultSectionSizeTest() on High-DPI screens
tst_QHeaderView::defaultSectionSizeTest() fails on High-DPI screens
because the default minimum section size is greater than the values used
for testing the header sizes. Therefore the test will fail.
Fix it by explicitly setting the minimum header size to something
smaller than the test values.
Also add a debug line to output the default minimum section sizes so
other failures due to this problem can be debugged better.

Fixes: QTBUG-73309
Change-Id: I257f341cef9381f140aa4d4f68376c5edadc39cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-02-05 08:24:45 +00:00
Eskil Abrahamsen Blomfeldt
02280535be Update bundled Freetype to 2.9.1
This is required to support the new emoji font on Android 9.

[ChangeLog][Freetype] Upgraded bundled Freetype version to 2.9.1.
This also adds support for the latest emoji font in use on
Android 9.

Fixes: QTBUG-70657
Change-Id: I99be72f0d23c20aca122b8fdadd4ded87b2edce1
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-01-31 10:40:41 +00:00
Liang Qi
980567b3a3 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/android/templates/AndroidManifest.xml
	tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
2019-01-26 08:35:40 +01:00
Christian Ehrlicher
75335b71c9 tst_QItemDelegate: try to stabilize combobox test
tst_QItemDelegate::comboBox() is flaky because sometimes the used
QTableWidget does not yet have the focus which prevents a correct
editing. Fix it by explictily setting the focus on the widget after it
is shown.
A similar fix was added for dateTimeEditor() in
9822d57d85.
With this patch the test no longer fails for my on opensuse, therefore
remove the blacklisting.

Task-number: QTBUG-67282
Change-Id: I907db662ca347f8e8d31e5be215a100377b159ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2019-01-25 14:47:17 +00:00
Qt Forward Merge Bot
e3da05f39a Merge remote-tracking branch 'origin/5.12.1' into 5.12
Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
2019-01-23 10:13:29 +01:00
Friedemann Kleint
9822d57d85 Stabilize tst_QItemDelegate::dateTimeEditor()
Add qWaitForWindowExposed() for the toplevel and use QTRY_VERIFY()
for finding the delegates consistently.

Change-Id: I430088a91b5cc1a8f856d0a58aba066b1baf179b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-01-22 12:33:01 +00:00
Qt Forward Merge Bot
f94ca82e0f Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf

Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
2019-01-21 13:03:09 +01:00
Tor Arne Vestbø
68511d41d5 qWaitFor: Prevent being stuck in QCoreApplication::processEvents
When using the overload of QCoreApplication::processEvents that takes a
maxtime argument, the function will keep processing events until there
are no more events, or until it times out.

The problem is that the function doesn't distinguish between events that
were on the event queue when the function was called, and events generated
by processing events as part of its own execution. If for example a widget
calls update() in its paintEvent, the function will spin for the entire
duration of maxtime.

That doesn't work for qWaitFor, where we need to check the predicate
between each pass, so we use the overload of processEvents that doesn't
take a maxtime. That's fine, as we have our own timeout logic.

Change-Id: I9738d7d0187c36d4a5ddfcd3fd075b0bd84583c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-09 18:10:54 +00:00
Tony Sarajärvi
8b1a23ed32 Blacklist a flaky qtableview function in WinRT
Task-number: QTBUG-72853
Change-Id: Iaf2b25712b571a3ce73387cb3d2e70d427808364
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-01-08 11:58:41 +00:00
Liang Qi
03039979b5 Merge remote-tracking branch 'origin/5.12' into dev
Also blacklist tst_QRawFont::unsupportedWritingSystem() and
tst_QGlyphRun::mixedScripts() on windows for now.

 Conflicts:
	qmake/generators/makefile.cpp
	src/corelib/itemmodels/qstringlistmodel.cpp
	src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
	tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
	tests/auto/gui/text/qglyphrun/BLACKLIST
	tests/auto/gui/text/qrawfont/BLACKLIST

Task-number: QTBUG-72836
Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
2019-01-04 07:33:14 +01:00
Christian Ehrlicher
4c1313197b QbstractItemView: Allow Key_Space for keyboardSearch()
The keyboard search in QAbstractItemView did not handled Key_Space
because this is also an edit trigger. It was also consumed if no edit
was started.
This patch changes this behavior and triggers the keybaord search when
the editing was not started.

Fixes: QTBUG-48505
Change-Id: I58e0d283f863c9b12ac5d2f6171f15522bd7c30a
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-25 10:15:32 +00:00
Christian Ehrlicher
f568bfce64 QTreeView: fix keyboard navigation when first or last item is disabled
The keyboard navigation did not consider the disabled state when trying
to find the new index under all circumstances. This lead to a
non-working PageUp/Down/Home/End navigation when the first or last item
was disabled or hidden.
Fix it by explicitly checking if the calculated item is hidden/enabled
and skip it in this case.

Fixes: QTBUG-44746
Fixes: QTBUG-34832
Change-Id: Ifa3b64a405e67b792db5db9d186d426fcfe183fb
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-25 10:15:29 +00:00
Christian Ehrlicher
7863be3115 QTableView: Fix keyboard navigation with disabled rows
The keyboard navigation with MovePageUp/Down and MoveEnd did not honor
disabled cells in all cases which lead to inconsistencies in the
navigation (esp. since MoveHome does honor them correctly).
Therefore make sure that all four move operations work consistent by
refactoring the code to use common functions.

Fixes: QTBUG-72400
Change-Id: I63fa3b626510d21c66f4f9b2b1bfb3261728ecaf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-18 05:33:52 +00:00
Christian Ehrlicher
e56c79dc9d QTreeWidget: mark is/setFirstItemColumnSpanned() as deprecated
Deprecate the QTreeWidget functions is/setFirstItemColumnSpanned() to
stay in sync with the other deprecated functions
(selected/expanded/hidden) so they can get removed in Qt6.
Also add a small unit test for them.

Change-Id: Ie1cb5d7163c2d56d653c21e841ccaf7d38569787
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-11 06:46:42 +00:00
Christian Ehrlicher
e2f473f4d4 QListWidget: mark (is|set)Item(Selected|Hidden) as deprecated
QListWidget::(is|set)Item(Selected|Hidden)() are deprecated for a long
time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.

Change-Id: I4567e740f1ebb5841b2e5b50c601fb83a782950c
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-04 21:01:18 +00:00
Christian Ehrlicher
1414407970 tst_QTreeView: set keyboardInputInterval to a smaller value
keyboardInputInterval() is 400ms by default which slows down the
testcase without a good reason.
Set it to 100ms which speeds up the testcase from 20s to 10s on my
system.

Change-Id: Ib883c5d3f09f8e896ae56a8fc8df2233be63de01
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-23 15:44:29 +00:00
Christian Ehrlicher
76bb804405 QTreeWidget: mark (is|set)Item(Selected|Hidden|Expanded) as deprecated
QTreeWidget::(is|set)Item(Selected|Hidden|Expanded)() are deprecated
for a long time but not marked as such. Therefore explicitly mark them
as deprecated so they can get removed with Qt6.

Change-Id: Ie4971350de61326811e0788df0d359ed3c442869
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-09 19:07:51 +00:00
Christian Ehrlicher
8713f22372 QHeaderView: Fix updating hidden sections during initializeSections()
QHeaderView::initializeSections() was calling updateHiddenSections()
with wrong parameters which lead to an inconsistency in the hidden
section handling.
updateHiddenSections() needs the first and last index which got removed.
Therefore we must pass the new section count for logicalFirst.

Fixes: QTBUG-55461
Change-Id: Ica06125cf19bdd500f55fd9cd59ace1795f3703f
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-08 16:54:12 +00:00
Christian Ehrlicher
e9bebc1281 Fix use of deprecated ItemDataRoles Background/TextColorRole
Replace BackgroundColorRole/TextColorRole with
BackgroundRole/ForegroundRole and explicit deprecate them for 5.13

Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-05 21:58:37 +00:00
Christian Ehrlicher
a5a1f338aa QTableWidget: mark isItemSelected/setItemSelected() as deprecated
QTableWidget::isItemSelected/setItemSelected() are deprecated for a
long time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.

Change-Id: I77fffe2786751306115c3f5da0ef98ff84e35b1a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-02 05:57:03 +00:00
Christian Ehrlicher
d0f909f8db QTreeView/TableView: explicitly mark sortByColumn(int) as deprecated
QTreeView/TableView::sortByColumn(int) was deprecated a long time ago
but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13)
so we can remove it with Qt6.
Also sync the handling of the sort order changes in QTableView with the
one from QTreeView.

Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-02 05:56:58 +00:00
Christian Ehrlicher
d84a7a8128 QTreeView: add expandRecursively() to expand all items below an index
QTreeView only had functions to either expand all items or until a given
depth. What was missing is to expand all subitems for an index
programmatically which is added with this patch.

[ChangeLog][QtWidgets][QTreeView] Added expandRecursively() to expand
all items below a given index

Fixes: QTBUG-10482
Change-Id: I8fc4d50b0b7e90245840c99a0188f13c0670253a
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-02 05:56:26 +00:00
Liang Qi
e28e91ae99 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/corelib/animation/qpropertyanimation.cpp
	src/gui/image/qicon.cpp
	tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp

Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
2018-10-25 07:21:53 +02:00
Christian Ehrlicher
c18a91b0dc QTableWidget: fix cellChanged signal emitted by takeItem()
QTableWidget::takeItem() emitted cellChanged with row and column set to
-1. The internal functions searched for item after it was reset to
nullptr and therefore it was not found.
Since the modified cell is known because it's passed to the takeItem
function, the correct row/column can be retrieved from there.

Task-number: QTBUG-70478
Change-Id: I5ff5991c49f3200efe95fde4c7d0d28e19be7ebf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-19 12:19:20 +00:00
Liang Qi
ccf26f6a88 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/plugins/platformthemes/platformthemes.pro
	src/printsupport/kernel/qplatformprintdevice.cpp

Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
2018-10-17 10:35:28 +02:00
Miguel Costa
0a7aebadfb Update ANGLE to chromium/3280
Change-Id: I0802c0d7486f772d361f87a544d6c5af937f4ca1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-13 21:36:35 +00:00
Liang Qi
c593492d16 Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:26:15 +00:00
Christian Ehrlicher
3e59a88e89 QAbstractScrollArea: fix sizeHint when widget is not visible
QTable/QTreeView did not follow the documentation and returned
their needed size with scrollbars within viewportSizeHint().
Then sizeHint() also took the size of the scrollbars into account
when the policy was set to ScrollBarAlwaysOn.
This lead to different results when the widget was shown/hidden and/or
the scrollbar was visible or not.
Fix it by only adding the additional size when the scrollbars are
really visible. Also use header->isHidden() instead of isVisible() in
QTreeView the same way it is done in QTableView.

[ChangeLog][QtWidgets][QAbstractScrollArea] QTableView/QTreeView are
now reporting their viewportSizeHint() correctly taking into account
its scroll bars visibility and visibilityPolicy.

Task-number: QTBUG-69120
Change-Id: If50959a9f7429275e3e33122644c978fb64972ba
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-04 09:48:40 +00:00
Liang Qi
afb2619d76 Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-09-25 21:06:50 +00:00
Christian Ehrlicher
7fafeb4a34 QTreeView: sync keyboard search behavior with other itemviews
QTreeView has a special implementation of keyboardSearch() which is not
consistent to the base implementation regarding the selection behavior:
 - currentSelectionStartIndex is not set which results in a wrong
   mouse selection behavior afterwards
 - only the current index is set but not the current selection
Sync the behavior by calling setCurrentIndex() directly in QTreeView
too.
One problem remains with this patch - the key handling is still
different between QAbstractItemView and QTreeView for repeating key
presses.

Task-number: QTBUG-18862
Change-Id: Ife79d146cf16d6ecbf9f86540777dae15aa1ffb0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-25 14:23:06 +00:00
Qt Forward Merge Bot
a607fcb31e Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I4d123c3cdf86524716ba67091e0347309b49c837
2018-09-25 10:56:53 +02:00
Tony Sarajärvi
e0ba6e09c0 Blacklist flaky tst_qheaderview test
Task-number: QTBUG-70590
Change-Id: I39ca2a7207db58d1a33bb918e065196a60471930
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:12:52 +00:00
Christian Ehrlicher
43ed09fed5 QListView: Speedup handling of hidden items
Instead iterating through all rows to get the number of hidden items,
iterate over the hidden items which are fewer items.
Also don't create a temporary vector with visible flow positions by
remembering the count of hidden items before the working index and
adjusting them appropriately which gives a significant performance
boost when working with a large data set.

[ChangeLog][QtWidgets][QListWidget] Speedup handling of hidden items
when working with large data sets

Task-number: QTBUG-68977
Change-Id: I599b6e97945c245f02229145baad8363ec2bf2f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-17 14:01:31 +00:00
Qt Forward Merge Bot
f5bf8ca9c3 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Icd201bf6b634e44e0e2ab05eaf91a7d8588d7f05
2018-09-13 01:00:39 +02:00
Tony Sarajärvi
fd6370d89f Extend opensuse blacklistings to opensuse-leap
In openSUSE 15.0 /etc/os-release the ID of the OS was
changed from "opensuse" to "opensuse-leap". So every blacklisting
we did for opensuse, didn't cover opensuse-leap. This one adds
opensuse-leap as a blacklisted platform whenever opensuse
was blacklisted.

Task-number: QTBUG-70463
Task-number: QTBUG-51399
Change-Id: I5879eb34926757163973d8b9442eae58f47d2f11
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-11 12:11:45 +00:00
Qt Forward Merge Bot
3d2832790a Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: If1baf48f0f396fb223672d14f0e1847ac42ca1a6
2018-09-10 01:00:42 +02:00
Christian Ehrlicher
85917c4b72 Autotests/QItemView: re-enable tst_QItemView::indexAt()
tst_QItemView::indexAt() was disabled since Qt 5.0 (and maybe earlier)
maybe due to it's long runtime (15s on my machine).
Speed it up by checking only some special positions inside the visual
rect (borders, center) as it will likely not fail on other positions but
succeed for the ones which get tested.

Task-number: QTBUG-22470
Change-Id: I5c7135757049176f9daca4afc1b7f40c75b9ecd9
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:04:15 +00:00
Christian Ehrlicher
ef40cad3a9 QTableView: Fix PageUp not getting to top when first row is hidden
When the first row(s) of a QTableView is hidden, PageUp could not reach
the first visible row because logicalRow(0) is taken without checking
if the row is visible.

Task-number: QTBUG-70215
Change-Id: Ic7820352b8988accb685ea7d16908d3fa8bf2847
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:03:55 +00:00
Luca Beldi
fcdb459c06 Implement QListModel::moveRows
Implemented the virtual method moveRows to allow row movement.

[ChangeLog][QtWidgets][QListWidget] Implemented moveRows in model

Task-number: QTBUG-69807
Change-Id: I212b560b8778306a0315d9d5e4710efcc7dbbe44
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:26:58 +00:00
Luca Beldi
551e11c286 Implement clearItemData in common models
A virtual method clearItemData was added to QAIM for Qt6.
This patch implements that method to all Qt concrete models for which
it makes sense.

Task-number: QTBUG-69616
Change-Id: If980fcfc36f723128bc56ec4587c5c3a338dbbcc
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 09:26:51 +00:00
Rolf Eike Beer
b3f9b2f148 remove internal use of SE_ViewItemCheckIndicator
This is marked to be removed in Qt6, so switch to
SE_ItemViewItemCheckIndicator internally and define the old value as
copy of the new one instead of the other way round.

Change-Id: I9e9804a7ff0e9b2ae1e24698d45b2cbd44423420
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-03 07:15:22 +00:00
Oliver Wolff
e05dc08ba0 winrt: Implement QPlatformCursor::setPos
Additionally to setting the cursor position we have to make sure that
enter and leave events are triggered. As WinRT at the moment only supports
maximized/fullscreen native top level widgets, an enter or leave event has
to be triggered, every time the cursor enters or leaves the core window.
Same as is done on Windows desktop an enter event is immediately followed
by a move event even for emulated mouse events.

Change-Id: I4b9a7b07f8e24b7887619f96979a064d933788aa
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-08-06 05:24:35 +00:00
Christian Ehrlicher
faff43348b QHeaderView: respect min/maxSectionSize in setDefaultSectionSize()
The min/max section size was not checked when setting the default
section size. This was an oversight when the check for min/max section
size was added to resizeSection().

[ChangeLog][QtWidgets][QHeaderView] setDefaultSectionSize() now
checks if the given value is inside min/max section size

Task-number: QTBUG-69431
Change-Id: I1b5704282927ce5a8520f52174ebf91d9840bc8a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-08-04 19:31:15 +00:00
Edward Welbourne
a040369622 Restore qlistview testing on Linux
It might have been fixed in the three years since it was marked
insignificant, and we can't investigate the crash while it's not
tested.

Task-number: QTBUG-50747
Change-Id: I99cdeb55e207d10fe524cd5f4868f042c64eb7d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-07-18 09:25:30 +00:00
Andre de la Rocha
dffbf4a7f6 Fix use of QTest::mouseMove() in widgets tests
Fixing some issues that could cause intermittent or environment-dependent
failures. One kind regards the use of multiple QTest::mouseMove()
calls in sequence internally using the QCursor API, causing timing
dependent failures. Switching to the override that does not require the
QCursor API, where possible. Other test could fail depending on the size
of the screen.

Change-Id: I4a368955ddbb48f729dcdf74c20eb163329936b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-07-12 09:51:56 +00:00
Liang Qi
e3ed2281c0 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_dragging.mm
	src/plugins/platforms/ios/qiosinputcontext.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/tools/androiddeployqt/main.cpp
		Was moved from qttools into qtbase in 5.11.
		So re-apply 32398e4d here.
	tests/auto/corelib/global/qlogging/test/test.pro
	tests/auto/corelib/global/qlogging/tst_qlogging.cpp
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
	tests/auto/corelib/thread/qthreadstorage/test/test.pro
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qapplication/test/test.pro

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Done-with: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
2018-07-02 11:23:45 +02:00
Christian Ehrlicher
451fcee8a8 QTableView: update editor geometries directly after scrollbars are adjusted
QTableView::doItemsLayout() updated the scroll offset for the vertical
header after layouting was done. Since the scroll offset affects the
viewport of the editors, the adjustment was done too late.
Therefore we update the scroll offset right after the scrollbars are
set inside QTableView::updateGeometries()

[ChangeLog][QtWidgets][QTableView] Fixed calculating geometries
for editors

Task-number: QTBUG-48244
Task-number: QTBUG-49548
Change-Id: I3b057764cf99d42d861928a1c73277d34b440f9a
Reviewed-by: David Faure <david.faure@kdab.com>
2018-06-28 04:23:46 +00:00
Christian Ehrlicher
c699daeceb QListView: do not delete item on internal move
When an internal DnD occoures in IconMode, the item is moved to it's new
place but the logic in filterStartDrag() has no clue about the fact that
an internal move happend. Therefore the item gets deleted. Fix it by
changing the event's drop action to Qt::CopyAction to avoid the deletion
as it is done within QListWidget DnD code.

[ChangeLog][QtWidgets][QListView] Do not delete item on internal move.

Task-number: QTBUG-67440
Change-Id: I873d3c9fa76e107e108d9af0dcf8cecd1e18a18f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-06-22 20:05:11 +00:00
Oliver Wolff
70884b4d2d winrt: Make itemview auto tests pass
Task-number: QTBUG-68297
Change-Id: I285dca678c34fd4170686635c7541e598442aa29
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-06-22 05:02:44 +00:00
Andy Shaw
d760f39d5c QTreeWidget: Keep items hidden even if their parents are reparented
When an item is explicitly hidden, then it should stay that way even if
its parent is reparented. The item itself needs to be explicitly shown
for it to be made visible.

Task-number: QTBUG-54843
Change-Id: I0c6eea9a936f82d5874e3246292bd16365440411
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-15 09:19:23 +00:00
Andy Shaw
f9b11bcf78 QHeaderView: Send the StatusTip events to itself if there is no parent
If there is a parent (typically an itemview) then StatusTip events
should be sent to that. However in the case of there not being a parent
then the event should be sent to the QHeaderView itself.

Task-number: QTBUG-68458
Change-Id: I2a8c11c973210c7adf1bf29443f224f968a357a9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-14 04:21:35 +00:00
Alexander Volkov
649490f359 Add itemAlignment property to QListView
This property allows to change the default behavior in
which list items occupy the entire width of their column.
Setting it to Qt::{AlignLeft,AlignRight,AlignHCenter} will
reduce their widths to the minimum values, thus allowing to
have intermediate free space. Then the user will be able to
begin selections by mouse from this space.

[ChangeLog][QtWidgets][QListView] Added itemAlignment property.

Task-number: QTBUG-56606
Change-Id: Iae55c251379be4e45d0c0d69175ff4388b5785b4
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-06-08 12:35:15 +00:00
Liang Qi
096e37910d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf
	src/corelib/kernel/qeventdispatcher_cf.mm
	src/gui/kernel/qguiapplication_p.h
	src/gui/kernel/qwindowsysteminterface.cpp
	src/gui/kernel/qwindowsysteminterface.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/cocoa/qnswindowdelegate.mm
	src/plugins/platforms/ios/qioseventdispatcher.mm
	src/plugins/platforms/windows/qwindowsdrag.h
	src/plugins/platforms/windows/qwindowsinternalmimedata.h
	src/plugins/platforms/windows/qwindowsmime.cpp
	src/plugins/platforms/winrt/qwinrtscreen.cpp

Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
2018-06-07 19:10:53 +02:00
Joerg Bornemann
9f27bfb31a Make sure we can build with -no-feature-draganddrop
We move QInternalMimeData to a separate file, because this class is
used, even if draganddrop is disabled. From now on, include
qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData.

Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-05-29 18:31:35 +00:00
Nathan Collins
4180e6be88 Fix build with --no-feature-wheelevent
tst_QListView::horizontalScrollingByVerticalWheelEvents failed to
compile with this qmake argument.

Change-Id: I35dd4ad4c9ee92c06c94b21dd7325aee00fc98d4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-05-23 19:26:09 +00:00
Liang Qi
4f421c274b Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-05-14 21:17:03 +00:00
Christian Ehrlicher
71a1df5456 QTableWidget: fix handling of Qt::EditRole/DisplayRole in setItemData()
QTableModel::setItemData() did not treat Qt::EditRole and
Qt::DisplayRole as the same. This lead to inconsistencies between
setItemData() and QTableWidgetItem::setData()

[ChangeLog][QtWidgets][QTableWidget] Fix handling of Qt::EditRole and
Qt::DisplayRole in setItemData().

Change-Id: I456f4c8e654de701dcd579236162b8aaa8ba1e53
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-14 18:17:35 +00:00
Liang Qi
7e1b504f31 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	mkspecs/features/qt_module_headers.prf
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qwidget/BLACKLIST

Change-Id: I2a08952d28d1d0e3d73f521a3d44700ce79ff16c
2018-05-14 14:51:46 +02:00
Christian Ehrlicher
d02e7b46a1 QTableWidgetItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTableWidgetItem setData() function

Task-number: QTBUG-48295
Change-Id: I82289b6db78eeef09d586da267046032984952da
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-05-12 05:22:13 +00:00
Christian Ehrlicher
0993a9e830 tst_QHeaderView: replace custom waitFor() function
replace custom waitFor() function with QTest::qWaitFor() to avoid code
duplication.

Change-Id: I44ebcbfe4c6f6c6f787fb7dbaf958a245bc27fa1
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-05-10 14:03:27 +00:00
Christian Ehrlicher
f02256cce1 QHeaderView: reset cached size hint on reset()
QHeaderView::reset() did not reset the cached size hint which could lead
to wrong geometries when the model was reset.

Task-number: QTBUG-67927
Change-Id: I5100b28a741cc816133a229c422f9abf83f2187e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-05-10 14:03:24 +00:00
Christian Ehrlicher
d2573f4dbd Enable checks for tst_QHeaderView::sectionSizeHint()
tst_QHeaderView::sectionSizeHint() did set some values but did not check
the return values.

Change-Id: Id606d7a06935a3d6783bc9a8c10bf05d953adec6
Reviewed-by: David Faure <david.faure@kdab.com>
2018-05-10 05:07:08 +00:00
Kari Oikarinen
e110ab6c28 tests/auto/widgets/itemviews: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: Id4fcb0c2e4f83edd9508565468e16f57e100c780
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-05-09 05:52:22 +00:00
Liang Qi
60fefff22f Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
	examples/widgets/graphicsview/elasticnodes/node.cpp
	examples/widgets/graphicsview/elasticnodes/node.h
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_drawing.mm
	src/widgets/kernel/qmacgesturerecognizer_p.h

Change-Id: I13cf06bac75d48d779d8ee7b5c91bfc976f2a32c
2018-05-03 14:50:22 +02:00
Friedemann Kleint
7a1df39010 Tests: Fix clang warnings about unused variables and captures
tst_qline.cpp(170,12):  warning: unused variable 'baseB' [-Wunused-variable]           ^
tst_qline.cpp(169,12):  warning: unused variable 'baseA' [-Wunused-variable]
tst_qheaderview.cpp(3329,14):  warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
    waitFor([this, &header, defaultSectionSize]() { return header.sectionSize(0) == defaultSectionSize; });

qheaderview.cpp(3338,14):  warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
    waitFor([this, &header, defaultSectionSize]() { return header.sectionSize(0) == defaultSectionSize; });

Change-Id: I0245a7b66d15b896e864b488f7a58e8513fbdc6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-05-02 09:36:00 +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
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
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
332ce6734d Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
2018-03-08 09:27:38 +01: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
6cf3428a43 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I42ec9e6aafc203465cbeb88af70c7af26b7df8ed
2018-03-02 01:00:10 +01: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
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
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
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
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
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
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
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
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
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
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