Commit Graph

240 Commits

Author SHA1 Message Date
Frederik Gladhorn
b6191b16d4 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/global/global.pri
	src/corelib/global/qcompilerdetection.h
	src/corelib/global/qglobal.h
	src/corelib/tools/qdatetime.cpp
	src/plugins/platforms/xcb/qxcbscreen.h
	src/plugins/platforms/xcb/qxcbwindow.h
	src/widgets/dialogs/qcolordialog.cpp
	src/widgets/dialogs/qcolordialog_p.h
	tools/configure/configureapp.cpp

Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
2015-01-21 11:10:14 +01:00
David Faure
70ed7c727a tst_qitemdelegate: remove more duplication.
Makes it easier to add new tests.

Change-Id: I5c2bca60e125259eac83a03860e60ca85b51db24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-17 10:25:31 +01:00
Eskil Abrahamsen Blomfeldt
7a760f5ed9 Android: Fix QDirModel tests
This test needs to have a test environment available on the regular
file system, so we create this when initializing the test. In
addition we QEXPECT_FAIL one of the tests which seems to expose
a legitimate bug. A bug report has been created for this.

Change-Id: I7c90aea78a067815cb647a51db5d91a652a9fc1c
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-16 09:27:52 +01:00
Giuseppe D'Angelo
84a3dacf46 QItemDelegate: let QTextEdit and QPlainTextEdit receive tab keypresses
We already let enter/return key presses to reach text edits instead
of closing the editor. Do the same for tab/backtabs.

[ChangeLog][QtWidgets][Important behavior changes] QItemDelegate will
now not close a QTextEdit/QPlainTextEdit editor when the tab key
is pressed; instead, the key will reach the editor.

Task-number: QTBUG-3305
Change-Id: Ife9e6fdc5678535c596d1068770b0963134d8d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2015-01-04 18:33:49 +01:00
Alexander Volkov
53022e04bb Make the defaultSectionSize property of QHeaderView style dependent
Add new enum items PM_HeaderDefaultSectionSizeHorizontal and
PM_HeaderDefaultSectionSizeVertical to QStyle and get corresponding
values in QHeaderView. This way we get rid of some magic constants in
QHeaderView and we can have reasonable values for the default section
size for high-DPI displays.

[ChangeLog][QtWidgets][QHeaderView] Default section size is now style-dependent by default.

[ChangeLog][QtWidgets][QHeaderView] Added resetDefaultSectionSize().

Change-Id: I44e152c5cf0bec1e5d78e1e62f47a2d1f761dfbf
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-12-11 10:26:41 +01:00
Simon Hausmann
015002fec9 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	doc/global/template/style/online.css
	mkspecs/android-g++/qmake.conf

Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
2014-12-10 07:58:06 +01:00
Andy Shaw
2ca57e39e3 Respect the size hint signal for the column and row delegates
The sizeHintChanged() signal from the column and row delegates need to be
connected to the doItemsLayout() slot so that the view is updated when the
size hint changes.

Additionally doDelayedItemsLayout() is called to ensure that this is
up-to-date as the size hints may have changed when the new delegate was
set on the row or column.

Change-Id: I458293f05ce9ef40a03bdbcab1a6e7a10f648c89
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
2014-12-03 13:31:07 +01:00
David Faure
bb4625f472 tst_QItemDelegate: simplify code, no behavior change
Remove duplication of the set of flags.
Remove "text" column which had a constant value.

Change-Id: I39dd541a545664fb3f992b32b8c64e4dd263a9c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-12-02 14:41:26 +01:00
Frederik Gladhorn
34aba4724f Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/io/qiodevice.cpp
	src/plugins/bearer/linux_common/qofonoservice_linux.cpp
	src/plugins/bearer/linux_common/qofonoservice_linux_p.h
	src/plugins/platforms/android/qandroidplatformtheme.cpp
	src/tools/bootstrap/bootstrap.pro
	src/widgets/styles/qmacstyle_mac.mm

Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
2014-11-24 13:39:13 +01:00
David Faure
dcbf704bc0 tst_qtableview: fix virtual-override clang warning
Change-Id: I40391890c988ce15d8fa65898976bf0fdc446992
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-24 08:05:34 +01:00
Giuseppe D'Angelo
fd05f26d80 tst_qdatawidgetmapper: stop using module-wide includes
Change-Id: Ia0e170e2185a46685cb1c130a16b8a9d379b6e02
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-14 21:01:59 +01:00
David Faure
e3240214e4 tst_qitemdelegate: make the test more robust
Change-Id: Ieb05d7a05d5d8f6f652a0351deba7208d0770dd6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-11 12:32:13 +01:00
Giuseppe D'Angelo
ee17adebd2 Implement QTableWidget/QListWidget::mimeData()
For some reasons lost in history, those methods simply ignore
the list of items passed to them, and always return NULL.
Of course, that's totally broken. Fix that by doing the same thing
that the respective (hidden) models did when calling mimeData().

Surprisingly enough, QTreeWidget has a proper implementation.

Task-number: QTBUG-25900
Change-Id: I99ca7b4d4f87f096fd9ff0b0cb4e58282aa9c26e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-10-31 14:06:25 +01:00
Frederik Gladhorn
3361fcbc28 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
2014-10-20 19:12:25 +02:00
Frederik Gladhorn
b55a688b61 Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: Ic01820f2390e419a5b286643e7351e85ae032473
2014-10-14 13:54:50 +02:00
Maximilian Hrabowski
4cbb99c5e2 QAbstractItemView: fix CTRL+A select all behavior
The check for Qt::Key_A to handle selectAll was changed to directly
compare to QKeySequence::SelectAll as this will only match Ctrl. The
former implementation also triggered when e.g. Shift was pressed.
Added a check that selectAll is only called when selection is not
disabled, i.e. selectionMode=NoSelection.

Added a unit test for selectAll().

Task-number: QTBUG-26687
Change-Id: I721e7ab590b55d7d754b3b74ef01756fa5aa1315
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-13 13:53:28 +02:00
Frederik Gladhorn
881ceeff42 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
2014-10-09 17:56:52 +02:00
Alessandro Portale
106487387d Removing a few unneeded "? true : false"
Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-10-09 09:43:26 +02:00
Oswald Buddenhagen
189dc655bb Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/tools/qbytearray.cpp
	src/gui/image/qimage.cpp
	src/gui/image/qppmhandler.cpp
	src/gui/kernel/qguiapplication.cpp
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
2014-09-29 14:08:49 +02:00
Marc Mutz
55fbf1db19 Widgets: remove references to QStyleOptionFrameV<n>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.

Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-26 00:39:48 +02:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Kalle Viironen
00b1360d9d Blacklist constantly failing test cases on OS X
tst_qcolumnview fails on OS X # QTBUG-41341
tst_qaccessibility fails on OS X # QTBUG-41340
tst_qnetworkreply fails on OS X # QTBUG-41320
tst_qfontcombobox fails on OS X # QTBUG-41318
tst_macplist fails on OS X # QTBUG-41314
tst_qgraphicsitem fails on OS X # QTBUG-41342
tst_qmdiarea fails on OS X # QTBUG-41343
tst_qtableview fails on OS X # QTBUG-41344

Change-Id: I2626aa61417336805872a807c4a6065b7e0ddb02
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-23 16:26:59 +02:00
Alexander Volkov
256df2484c Make the default value of QTreeView::indentation() be style dependent
Add a new PM_TreeViewIndentaion enum value to QStyle and get
the corresponding pixel metric in QTreeView.

[ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default.

[ChangeLog][QtWidgets][QTreeView] Added resetIndentation().

Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Adam Majer <adamm@zombino.com>
2014-09-15 10:05:25 +02:00
David Faure
de4cad945d QAbstractItemView: add iconSizeChanged signal.
This is useful when writing a generic preview-icon-generator which
should work with different type of views, itemviews and QML views.
A way to be notified of a change of icon size was missing on the itemview side.

[ChangeLog][QtWidgets][QAbstractItemView] Added iconSizeChanged signal.

Change-Id: I19b3049961002ca27d71aefbb6980d1e6f225c79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-12 02:07:48 +02:00
Christoph Schleifenbaum
fc4993be1f QListView: Catch stack overflow on mutual scrollbar calculation.
Task-number: QTBUG-39902
Change-Id: Ie850371098070e8ce485d5cb122aa89c18d97359
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-29 07:26:29 +02:00
Robin Burchell
6aa1b6e015 tst_qtreewidget: Skip test that crashes on Wayland.
Change-Id: I6cc2eb90df57eb5c33d3a93920ea719b5e2cfc0d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 23:23:26 +02:00
Robin Burchell
f10eda7cb5 tst_qtreeview: Skip test that crashes on Wayland.
Change-Id: Iff2499dff1906a7c65fc5c007b96675f4bac2b42
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 23:23:20 +02:00
Robin Burchell
ac1f1c42c7 tst_qlistview: Convert some qWaits into QTRY_* usage.
This takes the total runtime of tst_qlistview for me from ~47 seconds to ~10
seconds.

Change-Id: Ie6fe95fe0852c2de37e99c2ad02230de78e0995e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-18 13:52:54 +02:00
Friedemann Kleint
088e9bbb4b QHeaderView::restoreState(): Add sanity check.
Read data into local variables and apply only after a check.

Task-number: QTBUG-40462
Change-Id: Id06060d0d5b0eafc2d303526a86d552ff5747a72
Reviewed-by: David Faure <david.faure@kdab.com>
2014-08-06 06:28:39 +02:00
Jorgen Lind
c750d8408e Fix crash when inserting the same instance widget more than once
Task-number: QTBUG-39324
Change-Id: Ib1e0e107cd411311344aa5d85c3ca4c34211448b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-26 10:17:36 +02:00
Mitch Curtis
a18e3a3cef Fix key navigation through cells with spans in QTableView.
When navigating with the directional keys or tab/backtab, there are
certain situations where the cell that is edited is incorrect.
For example, consider the table below.

 '^' represents the starting cell and the direction of navigation.
 'c' represents the index that is arrived at as the currentIndex prior to this patch as
reported by view.selectionModel()->currentIndex().
 'x' is the cell that should be edited:

+---+---+---+---+
|   |   | e |   |
+---+---+---+---+
|   | x     |   |
+---+       +---+
|   |     c |   |
+---+---+---+---+
|   |   | ^ |   |
+---+---+---+---+

Before this patch, the cell that will actually be edited is c, rather
than x, so after editing the cell and pressing enter, the previous
contents of the cell will still be shown.

With this patch, currentIndex() will be changed after every call to
cursorMove(). Navigation into and out of cells is not affected because
the visualCursor member in the QTableViewPrivate tracks the keyboard
navigation entry point. If after the up navigation into the span, the
user presses up, the cell entered is 'e', not the cell above 'x'.

Task-number: QTBUG-29239

[ChangeLog][QtWidgets][QTableView][QTableWidget] currentIndex() now
reflects the top left cell when in a span.

Change-Id: I3dc3db46ebba340102860fc4ad98fcaf91484983
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-06 15:50:58 +02:00
Friedemann Kleint
85aef2dd4b Fix visual index lookup in QTreeViewPrivate::adjustViewOptionsForIndex().
Determine the visual index by looking up the column of the QModelIndex
in the logicalIndices array instead of looping.

Task-number: QTBUG-37813
Change-Id: I5c3c73c67537877b03cdc2c36a52041d99f7f49d
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-06 16:35:56 +02:00
Friedemann Kleint
7e14e69fd5 Stabilize tst_QAbstractItemView::task250754_fontChange().
Increase window size when verifying that the scrollbar disappears
when using a small font on Windows 8.1

Change-Id: I7d4520bc5882d8ccd59db3f5bff7e9d6d68a4827
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-04-30 16:53:55 +02:00
Fabian Bumberger
ff34070709 QNX: Fix QTreeView autotest
The style is dpi dependent. I.e. on high dpi displays the pixel size of
sections and rows of a QTreeView will be larger.

Change-Id: I7477bfdd641d4db67973cafef5147f026f72c111
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 16:47:51 +02:00
J-P Nurmi
b2a6c9ec3e Fix tst_QListWidget::task217070_scrollbarsAdjusted()
QMacStyle::styleHint(SH_ScrollBar_Transient) wants either a style
object or the widget argument in order to return correct values.

Change-Id: I2fdef0820334fa66e076a4734eb2a30c722c841c
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-04-09 20:53:06 +02:00
Fabian Bumberger
b490116f82 QNX: Fix QHeaderView autotest
Some margines and sizeHints are DPI dependent on QNX and BlackBerry.
This patch skips two test that expect the section size to be of a
certain pixel size.

Change-Id: I7869f77fc2b623e091f53e420d1a4fdb3ec30724
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-09 20:53:06 +02:00
J-P Nurmi
82934f11e0 Stabilize tst_QListWidget
Replace weird QEventLoop hacks by sending all posted deferred delete
events.

Change-Id: I6da743f2b3fb6ef5dfc960dd3d752973cd511037
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-09 10:47:06 +02:00
Marc Mutz
d9077669a1 tst_QTreeView: fix use of uninited variable
Valgrind complained:

==13941== Conditional jump or move depends on uninitialised value(s)
==13941==    at 0x4206FC: tst_QTreeView::styleOptionViewItem()::MyDelegate::paint(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const (tst_qtreeview.cpp:3062)
[...]

Change-Id: I76da01c191415ba0a00b4b85312f2fe08e4ee2d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-07 23:41:30 +02:00
Fabian Bumberger
bf05df9a23 BlackBerry: Fix QListView autotest
Change-Id: Id4967911d82cff86214665cc9ca3dbbefa69da11
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 19:32:21 +02:00
Fabian Bumberger
f3eb59e3fc Fix QTreeWidget autotest
Change-Id: I94b4d9d2f0ef013691faedc4cd12050aa49e98f2
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 19:32:21 +02:00
Fabian Bumberger
5947fda8fd QNX: Fix QAbstractItemView autotest
One problem was that tests expect the top-level window to have a certain size,
which is not possible on BlackBerry. Another problem was that certain elements have a
dpi dependent size which the task250754_fontChange test did not consider.

Change-Id: I465ebe234a74d6150cdcbb7fc7e458a62155e0d0
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 10:39:21 +02:00
J-P Nurmi
0cb2c760c2 Item views: respect selection mode when closing an editor
Task-number: QTBUG-31411
Change-Id: I1a52eb739e0bc2afa7227f006461916df8ecaf48
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-04-01 05:27:00 +02:00
J-P Nurmi
cc08fc7bfd Item views: respect focus policy when closing an editor
Task-number: QTBUG-31411
Change-Id: Ib0a72755c35a553653ea014672d59979a550b7ae
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-04-01 05:26:50 +02:00
Friedemann Kleint
48773be981 Do not run tst_qcolumnview in parallel
Task-number: QTBUG-36395

Change-Id: Id1f5cfeca3f18d6d7d1f2354211e15d349dd7b8f
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-03-19 19:51:20 +01:00
J-P Nurmi
3a4b8cbc3d Fix tst_QColumnView::scrollTo()
The test relies on active focus, so activate the test window in
the beginning of the test to avoid undesired focus widget changes
by QApplication::setActiveWindow() during the test.

Task-number: QTBUG-36395
Change-Id: I6febec7d552224b1754aaf57520ed6d435d29563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-03-19 19:50:50 +01:00
Frederik Gladhorn
634b9b1e5c Do not run tst_qabstractitemview in parallel
This test waits for window activation and gets disturbed by mouse
movements.
The test duration is not long enough to justify the flakyness (around 10
seconds on my laptop).

Change-Id: I985044f954c09442220db3ca318045c04ef6bb77
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-03-19 01:02:03 +01:00
Oswald Buddenhagen
30fd22b957 Merge remote-tracking branch 'origin/dev' into stable
Change-Id: Ice524edcc51373509f0023ae7f7c2963f4602f88
2014-02-19 10:06:25 +01:00
Sergio Ahumada
8102b75ee8 Remove qSort usages from widgets tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Ica7639d16f52b4ffcd2c00cc806fed1378a7948b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-02-18 11:59:55 +01:00
Frederik Gladhorn
a1fe728fa5 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp
	src/plugins/platforms/android/androidjnimain.cpp
	src/plugins/platforms/android/qandroidplatformintegration.cpp
	src/plugins/platforms/android/qandroidplatformintegration.h
	src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/sql/doc/src/sql-driver.qdoc
	src/widgets/widgets/qtoolbararealayout.cpp

Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
2014-02-07 13:07:25 +01:00
Friedemann Kleint
0841a5e367 tst_qcolumnview: Set layout direction on widgets instead of application.
Most of the test is executed in RTL mode since it is never restored.

Task-number: QTBUG-36395
Change-Id: I110966085a5a265f093fc4479eebc1f1bf0614c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-01-28 08:27:53 +01:00