summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* Qt 5.0 QTreeView. Prevent manual moving of the first sectionThorbjørn Lund Martsum2012-11-025-1/+23
| | | | | | | | | | | | | | | | | | This prevents the user of moving the leftmost column. There will be no API to allow move of the tree-structure. It is very weird to do that, so it shouldn't be a problem. In case it is a big problem somewhere it can be hacked with: QTableView unused; unused.setVerticalHeader(tree->header()); tree->header()->setParent(tree); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); Task-number: QTBUG-332 Change-Id: I3a251c8d0fd472ec0ad7edb20a7f3e00af7e0da8 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView 5.0 - correct drop on manual QHeaderView sectionmoveThorbjørn Lund Martsum2012-11-021-1/+1
| | | | | | | | | | | | | | | | | This fixes an error in the calculation of the exact drop position when an user is moving a section in QHeaderView. Before we compared a mouse-position local to the widget (pos) with a summed length of sections (posThreshold). However we need to consider/substract the headers offset to make the posThreshold comparable to the local mouse position. This solves e.g. Task-number: QTBUG-14814 Change-Id: If0281cf0c7b98316474f18e8eaa32c6d062dda56 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - call invalidateCachedSizeHint() on clearThorbjørn Lund Martsum2012-11-021-0/+1
| | | | | | | | | This calls invalidateCachedSizeHint on clear, which is a logical thing to do. Task-number: QTBUG-22528 Change-Id: I0befb2d492599fa8a05b1c2162bbca586e1b019d Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Strip trailing whitespace in itemviews.Stephen Kelly2012-11-017-11/+11
| | | | | | | | | | | Using git ls-files -z | xargs -0 sed -i 's/ \+$//' in the relevant directories. Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Do the actual removal of the Soft Keys API and related codeJan Arve Saether2012-10-292-33/+0
| | | | | | | | | | | | | | | | | | | In addition to the actual removal of the softkeys API in QAction, this commit removes some enums related to the softkeys feature: Qt::WA_MergeSoftkeys Qt::WA_MergeSoftkeysRecursively It also removes some "zombie" enums: Qt::WindowSoftkeysVisibleHint = 0x40000000, Qt::WindowSoftkeysRespondHint = 0x80000000, (The only implementation that used these were removed when qapplication_s60.cpp and qwidget_s60.cpp were removed.) Change-Id: Ib6fc6d543def4757383d5f19256199d9d190c614 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix build on MinGW after 0f14ea3f3a05ef785b44fa610bf90ff3b5ba7bebKonstantin Ritt2012-10-291-4/+0
| | | | | | | | Also generalize set _WIN32_WINNT to 0x0501 and _WIN32_IE to 0x0501 globally, as it is out minimal requirement these days. Change-Id: I8ca9102d49c37f908fd8ac032f707f8fe4fdcb22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove some dead code in switch statementsSergio Ahumada2012-10-291-2/+0
| | | | | | | | | | Following the Code Style described in http://qt-project.org/wiki/Qt_Coding_Style#e289ee44592e9c32d4212069f0806daf There is no need for a 'break' after a 'return'. Change-Id: I1eca350391a7e4e14e504d60b24b69982cc5ac47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHeaderView 5.0 - no emit of sortIndicatorChanged when unchangedThorbjørn Lund Martsum2012-10-261-0/+2
| | | | | | | There is no reason to emit this when there is no change. Change-Id: I34f0ceec7c4b0959b77bc5be3ce2c2ad55864598 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Implement viewOptions logic in QTableViewPrivate.Stephen Kelly2012-10-252-3/+11
| | | | | | | | | | | This is similar to the patch 05aa8c6c12509cce87d1a3811c5ea1dd83fa0898 which was applied to QListView. Task-number: QTBUG-26548 Change-Id: I38ff07230673a93a32b01a7f1951d0378d94185b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make sure uints remain uints when editing in itemviews.Stephen Kelly2012-10-191-1/+32
| | | | | | Task-number: QTBUG-22974 Change-Id: I07428862c4dffc629f868f3010f663eb655922d0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Correct accessibility index handling in QListViewJosé Millán Soto2012-10-191-3/+3
| | | | | | | | QListView::currentChanged and QListView::selectionChanged changed to use 0-based indexes instead of 1-based indexes. Change-Id: Ie618970c9a37ec76156dbfab2e86685c3c8f374c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* QPA: Introducing QPlatformTheme standardPixmap(), fileIconPixmap()Gabriel de Dietrich2012-10-161-162/+32
| | | | | | | | | | | | | | | | | | | | The basic idea is that the platform theme is now responsible for providing the pixmaps for the given standard name, or any file or directory. Then, the QStyle implementation should query the platform theme for the pixmaps, and build the icons accordingly using ThemeHint::IconPixmapSizes. Same thing for QFileIconProvider. This also opens future support for getting platform dependent pixmaps in QtQuick components. Also includes the implementation for the Cocoa (QCocoaTheme) and Windows (QWindowsTheme) platform plugins. Task-number: QTBUG-27450 Change-Id: I4e8406585d970a9af481be10f6643cf0abbc38a3 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Notify accessibility events in QAbstractItemViewJosé Millán Soto2012-10-131-35/+35
| | | | | Change-Id: Idd713dc3bc3e817529968384edd0418e151f0e5b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Link to Item Views Puzzle Example in QListView docs.Mitch Curtis2012-10-131-1/+1
| | | | | Change-Id: I75972727077fa1aa1ec66995c4d0ea67057d283b Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Constify QTableWidget::selectedItemsStephen Kelly2012-10-052-3/+3
| | | | | | | Task-number: QTBUG-27448 Change-Id: I99175cc2b255b93f698d3c343639c19845c9f5a0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix segfault when delegates change properties on editors.Stephen Kelly2012-10-041-2/+6
| | | | | | | | | | | The solution is similar to that in b84e180263d0da3d1e6967fcf759225a778ea6ea which affected QSortFilterProxyModel. Task-number: QTBUG-25370 Change-Id: I6bbb9d9786bcb2c9fa8027ab8a7cc13664784b8d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Store an unsigned temporary for the internalId.Stephen Kelly2012-09-271-1/+1
| | | | | | | | This is compared later with the internalId() of other indexes, which produces a warning. Change-Id: I57ea248c792db3b49947cc6a8fe989c68b67ff0f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix typo: contais -> contains.Stephen Kelly2012-09-271-1/+1
| | | | | Change-Id: I718b0178ba03fcf15f2962cb6f917efb2da27a04 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* ItemViews: Fix MinGW compiler warningKai Koehne2012-09-271-0/+3
| | | | | | | Fix compiler 'warning: "_WIN32_IE" redefined' Change-Id: I70ada35027a2bab0a6c4f84dd1384028d2afbcc9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* documentation fixesMarcel Krems2012-09-271-1/+1
| | | | | Change-Id: If165933df41e518f5ba6065792676260fd2492b6 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix hover handling in QTreeViewMiikka Heikkinen2012-09-242-14/+12
| | | | | | | | | | | | | | Cached hoverBranch could get invalid if branches were collapsed or expanded programmatically, leading to a crash in some situations. Fixed the logic for updating hovered over branch indicators and also now update hoverBranch when drawing so that it is guaranteed to be up to date there - this fixes issues like hover indicator not updating when the view is programmatically scrolled. Task-number: QTBUG-27158 Change-Id: I5bd1ad76aee512ad78df33959a84ead16886a47c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Implement viewOptions() logic in QListViewPrivate.Stephen Kelly2012-09-242-6/+14
| | | | | | | | | | | | | | | | | | The private method is called in several places in QListViewPrivate, but before this patch, the implementation in QAbstractItemView was called. This meant that the options were not set properly, resulting, for example, in icons in icon mode being laid out in list mode (on the left and small). This is a regression resulting from 8eab9cbce2014ffc6186dd6b6fb73da85956ee86 and 3578e05b293c1cc53582109001b20f02c7a1eeb7. Other views are not affected in a similar way. Change-Id: I753cb99410e367266753eaf2fa43361b9212ab96 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QModelIndex: clean up integer size confusion in the APIMarc Mutz2012-09-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | QAIM::createIndex() took either int or quint32, but QMI::internalId() returned qint64. In the new interface, createIndex() takes, and internalId() provides, integers of type quintptr. This matches the storage size of the void* in the model index and avoids truncation. Remove the createIndex(int, int, quint32) and \obsolete createIndex(int,int,int) overloads. This makes a literal 0 in the third parameter ambiguous now. The solutions have been noted in changes-5.0.0. Change-Id: I0a0ecd8430eaf695129a4d09d14d4e30745485c4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2250-1200/+1200
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Documentation fixes.Frederik Gladhorn2012-09-211-1/+1
| | | | | Change-Id: I2e234ec4307bbe39359cdfa8b13e86661dad43b6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Replace QStyleOptionViewItemV? with QStyleOptionViewItemStephen Kelly2012-09-2111-144/+133
| | | | | | | | | | The former are a typedef for the latter in Qt 5. This only touches internal implementation, as the API was migrated long ago. Change-Id: Ided73021ebecc00508e6325c3d988b6c6ad336cd Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove casting of QStyleOptionViewItems to set data.Stephen Kelly2012-09-191-8/+1
| | | | | | | | The correct values are already set inside setOptions, because the multiple versions of QStyleOptionViewItem were squashed in Qt 5. Change-Id: If0faf4b35bbf476e00905905376868814b8b095a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove qLowerBound usages from qtbaseGiuseppe D'Angelo2012-09-193-6/+12
| | | | | | | | | Replace them with std::lower_bound; this allows for deprecation of qLowerBound. Change-Id: I536e7338eb85ea6c7c1a5bf23121292767927e0b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fix example includes for qdoc.Frederik Gladhorn2012-09-111-1/+1
| | | | | | Change-Id: Ifa6a99db27ce51529489bf077a839a3107b524d2 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Removing duplicate includesSergio Ahumada2012-09-091-1/+0
| | | | | | | Do not include a header more than once Change-Id: Ia2e5d66e72988ad833cf5177a3f8aa988bf510e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fixed the QTreeView expansion/collpasing when animatedThierry Bastian2012-08-291-2/+6
| | | | | | | | | | | | | | | | | | If you had a QTreeView with expandable items, if you tried to expand and while the animation was still running you'd try to collpase the node, the display would be completely broken: the items below that items would not be visible any more except for a fraction of a second when expanding or collapsing it again. The problem is in the fact that when starting an animation the QTreeView stores the state before animating. And it does that even if an animation is already running. So the stateBeforeAnimation becomes AnimatingState and when the animation finishes, AnimatingState is the state that is restored breaking the painting. Unit test is included. Change-Id: I015212c1ed8962e6df705655099a5660f195caf3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix qdoc link.Frederik Gladhorn2012-08-281-1/+1
| | | | | Change-Id: I65e58351737b5628ac8c5dfe36a14b898076d690 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Doc: Fix snippet and example referencing widget examplesAndy Nichols2012-08-231-1/+1
| | | | | | | | Widget examples were moved into a widgets subfolder, but qdoc references were not updated. Change-Id: Id2a4573e723745b9827c664c852807d6116f8f6d Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make keyboard search work in the current column, not only the first.Stephen Kelly2012-08-221-0/+5
| | | | | | | Task-number: QTBUG-26540 Change-Id: I1c365aeb013f5ddedd0589aa4c4844be759a3882 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix indexAbove and indexBelow to return indexes in the correct column.Stephen Kelly2012-08-221-2/+4
| | | | | | | | They used to always return indexes in column 0. Change-Id: I2cf4239e0a975b37548de00a1deb916fcd88b4c7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Minor documentation fixes in item views.Shawn Rutledge2012-08-212-9/+8
| | | | | Change-Id: I986662ba48840e0195f0cfd4264e4d5d8b186c51 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Whitespace fixesShawn Rutledge2012-08-212-6/+6
| | | | | | Change-Id: Ibfb48076ad62804344db6e9e97ac90fdcf82dc04 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Fix the doc errors in itemmodels and itemviews.Stephen Kelly2012-08-204-6/+13
| | | | | | | | | Other errors remain, but they appear to be due to missing links to QtCore documentation (a generic error not specific to itemviews). Change-Id: I7b83380c3754c26d3d42be9ef0c0721ce3127562 Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove QProxyModel from qtbase.Stephen Kelly2012-08-204-794/+0
| | | | | | | A copy is placed in uihelpers for anyone who might be using it. Change-Id: I175f7bc5dcbf25a910d28bfd8985579866392938 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Take account of hidden items in QListView when using scrollTo.Stephen Kelly2012-08-201-3/+9
| | | | | | | Task-number: QTBUG-21804 Change-Id: I475166f3f60b1278089baa255ace4e18baeb568e Reviewed-by: Jani Honkonen <jani.honkonen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix a QListViewItem width when spacing is setJani Honkonen2012-08-191-1/+1
| | | | | | | | | | | | | The listitem width was calculated incorrectly because spacing was not considered. This fixes the second part of the reported bug where spacing is set. Added some tests to catch the issue relating to the reported bug. Also added a test to check spacing in general. Task-number: QTBUG-21804 Change-Id: Icc6326bce914264d882a60a9fc0ebe7d2a08dbf6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix QListWidget scrolling with keys when there are hidden itemsJani Honkonen2012-08-191-3/+11
| | | | | | | | | | If the selected item is scrolled with keyboard keys the selected item will go outside the visible area. The scrolling did not take hidden items into account when calculating the amount to be scrolled. Task-number: QTBUG-21804 Change-Id: I63da0248cec43be464898f9dc8167e739f00ccd0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make selectAll() do nothing if the mode is NoSelection.Stephen Kelly2012-08-151-1/+1
| | | | | | | | Task-number: QTBUG-26687 Change-Id: Iaa0197efe64c61505e22e4a63a1f5c012af0bc78 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use Qt::WindowFlags, not Qt::WFlags.Stephen Kelly2012-08-132-2/+2
| | | | | | | | | The latter seems to date from the Qt 1 days, and such abbreviations are not current Qt style. Change-Id: I83bc8722a309f4ece7e51881590d07b40fbe6bef Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Take scroll position into account when painting drag pixmap.Stephen Kelly2012-08-101-1/+1
| | | | | | | | Task-number: QTBUG-26793 Change-Id: Ic19cb6581cd5838d26713998e152772a5d12da4f Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Only emit the clicked() signal from views if the left button is used.Stephen Kelly2012-08-071-2/+3
| | | | | | | | | | | | This is consistent with QAbstractButton, QCalendarWidget, QDialogButtonBox and QGroupBox (ie, all other widgets with a clicked signal) Task-number: QTBUG-26105 Change-Id: Ieafe988b5c03216796b69a7cd70ac1a03fc12b0a Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Ensure that we return an invalid QTableWidgetItem when none is available.Stephen Kelly2012-08-071-1/+1
| | | | | | | Task-number: QTBUG-26195 Change-Id: Iede4f51770bd8c8eab3558137aaf7b1721f25a87 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Do not draw garbage branches if 0px indentation is specified.Stephen Kelly2012-08-071-1/+2
| | | | | | | | | This can't realisitically be unit tested. Task-number: QTBUG-26305 Change-Id: If7f56c44c472ff0ffbda4744b76ed2119bb64bf8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use == for button flag test instead of &Stephen Kelly2012-08-071-2/+2
| | | | | | | | QMouseEvent::button() returns Qt::MouseButton, not Qt::MouseButtons. Change-Id: Ib5dc5b3998ed8f442c72e26d1aff62bc4ebcff71 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* replace \key and \gui qdoc commands with \uicontrolJeremy Katz2012-08-012-2/+2
| | | | | Change-Id: I0753305d4fe1ea20417f451766101da1247dfeeb Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>