summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Giuseppe D'Angelo2013-02-172-5/+5
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-142-5/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| | * When expanding up the tree, there is no need to expand above root.Stephen Kelly2013-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The index set by setRootIndex is the root of the visible part of the model. Expanding more than that is not needed. Change-Id: I0015e313ef046ff63c67338c4f00c37e1aa71ca7 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| | * Fix minor typos in docs, printed messages & commentsSze Howe Koh2013-01-281-4/+4
| | | | | | | | | | | | | | | | | | | | | Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | QMetaMethod is needed in qtreeview.cpp even without accessibility.Samuel Rødal2013-02-131-1/+1
|/ / | | | | | | | | | | | | Change-Id: I195c4d591a1908e17ad45338d6b9a19b8948b804 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | QTreeView - optimize. Do not do signals-work if signals are blockedThorbjørn Lund Martsum2013-02-021-20/+28
| | | | | | | | | | | | | | | | There is no need to do any kind of work with emitting signals if signals are blocked. Change-Id: Ic352ba157fd89bbd36c650edd809a2ea91bcdd5f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | QTreeView::expandToDepth - add missing emit of expanded and collapsedThorbjørn Lund Martsum2013-02-021-0/+20
| | | | | | | | | | | | | | | | | | | | | | Just like other functions this function should emit expanded and collapsed. A part of fixing Task-number: QTBUG-8176 Change-Id: I6d801f61e6f0cb8836634cc52f0be2b610f6c728 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | QTreeView - emit collapsed in collapseAll()Thorbjørn Lund Martsum2013-01-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | When we call call collapase we emit collapsed. Therefore it should also be emitted on collapseAll() This partly solves: Task-number: QTBUG-8176 Change-Id: I20c1388fcbbb60d12debb4a0b3b0d9fed41e2563 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | QTreeView - emit expanded on expandAllThorbjørn Lund Martsum2013-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | When we call QTreeView::expand expanded is emitted. For the same reason we should emit expanded on expandAll() This partly solves: Task-number: QTBUG-8176 Change-Id: Ie85e724eec50980c68f626ec47dec5c1e08cc085 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Add the Qt::ItemNeverHasChildren flag and use it in QTreeView.Stephen Kelly2013-01-292-3/+7
| | | | | | | | | | | | | | | | | | It can be used to determine whether expand() should really expand. Change-Id: If79d8c295a4ca1356e60051682b227524a065126 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2917-68/+0
| | | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* | Don't emit activated on clicking disabled itemview item.Mitch Curtis2013-01-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | A itemview item with its flags set to Qt::NoItemFlags is considered disabled, and therefore should not cause the activated signal to be emitted. Task-number: QTBUG-20490 Change-Id: If824505c46f4fcadb9265ad6d1e9337f0cee32cf Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2250-50/+50
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1850-50/+50
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-047-19/+19
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
| * Fixed typo 'collasping' in QTreeView documentationThorbjørn Lindeijer2012-12-281-1/+1
| | | | | | | | | | | | Change-Id: Ib49c3500c4b3a40a7eaf17404cecc2c38de90530 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * Accessibility indexes are no longer 1-based.Frederik Gladhorn2012-12-181-5/+5
| | | | | | | | | | | | | | | | | | | | The updates for focus/selection in QTreeView were still adding +1 as it was required in Qt 4. Task-number: QTBUG-28174 Change-Id: Ib9fea7e20d431a0ef0db18494e7bdda06a0646b0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
| * QtWidgets docs: use WinVista screenshots instead of obsolescent WinXPJ-P Nurmi2012-12-066-12/+12
| | | | | | | | | | Change-Id: Ic7fd291d4ce4468ae12cf5dd102fbcc45387dd87 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * Compile with QT_NO_GESTURES.Volker Krause2012-12-031-1/+1
| | | | | | | | | | Change-Id: I9f8f7c586ccb5de227ec42af44159af90b39d1dd Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | QAbstractItemView - allow deselect in single selection mode.Thorbjørn Lund Martsum2013-01-021-1/+19
|/ | | | | | | | | This patch allows single selection to be cleared with the normal control modifier. This affects e.g QTreeView and QListView. Task-number: QTBUG-8836 Change-Id: I7fd50b987acc3552b36657409568192763257536 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Basic high-dpi "retina" support for Qt 5.Morten Johan Sørvig2012-12-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring Qt 5 on par with Qt 4, prepare for more comprehensive support later on. Introduce device independent pixels (dips), device pixels, and devicePixelRatio. Add high-dpi support to QPainter, QGLWidget, the cocoa platform plugin, mac and fusion styles. Dips are similar to CSS pixels, Apple points and Android density-independent pixels. Device pixels are pixels in the backing store/physical pixels on screen. devicePixelRatio is the ratio between them, which is 1.0 on standard displays and 2.0 on "retina" displays. New API: QImage::devicePixelRatio() and setDevicePixelRatio() QPixmap::devicePixelRatio() and setDevicePixelRatio() QWindow::devicePixelRatio() QScreen::devicePixelRatio() QGuiApplicaiton::devicePixelRatio() Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QtWidgets docs: use Fusion screenshotsJ-P Nurmi2012-11-286-12/+12
| | | | | | | | The Plastique style no longer exists in QtBase. All the references have been updated to Fusion, and the obsolete screenshots have been removed. Change-Id: I771a9ecf23b82965c7b3c41a40945cf051cb5f3a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QHeaderView: - avoid cursor move on setDefaultSectionSizeThorbjørn Lund Martsum2012-11-251-0/+2
| | | | | | | | | | | If we are reacting on the sectionResized signal and we call setDefaultSectionSize we should ensure that we are not moving the mouse-cursor. This is an improvement of f8f6acb05ce9aa5fccc329bf5587adf14ed9a710 Change-Id: I1adee7821bc8fcc9633f692bfd515f2c458b12c8 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix selection in QTableView when rows and columns have been movedMiikka Heikkinen2012-11-231-8/+12
| | | | | | | | | | | | The determination of top left and bottom right model indexes for the selection used logical indexes, which resulted in selection truncating itself if the first or last row or column had been moved to different position on the table. Changed the logic to use visual indexes instead. Task-number: QTBUG-28009 Change-Id: I4eb9dab690dafda9d2ab7c452dd6271fad70cb30 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - Fix auto-scroll on manual move on sectionsThorbjørn Lund Martsum2012-11-232-0/+21
| | | | | | | | | | | | | This patch fixes the manual move of sections when auto scroll is on. It is done in QAbstractItemView::doAutoScroll by letting the qheaderView use its parents scrollbars if they are childs of a QTableView or QTreeView. Task-number: QTBUG-993 Task-number: QTBUG-1103 Change-Id: I70d999d9a07c3566e42d01cc5ebb47a69a83d9d4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QAbstractItemView - prepare fix for auto scroll on sectionmoveThorbjørn Lund Martsum2012-11-231-10/+13
| | | | | | | | | | | | | There are no semantic changes in this patch. We just avoid many calls to horizontalScrollBar() and verticalScrollBar() by storing the result of them in local variables, that are used instead. This is just a prepare for auto-scroll when a user is moving a section. Change-Id: I4b3d3ecbf3a29992e6f578d4b0442d7f494125e4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Account for the item spacing when using QListView::scrollTo()Pierre Rossi2012-11-231-0/+1
| | | | | | | | | Somehow this bug managed to stay hidden until the introduction of QFusionStyle. Task-number: QTBUG-27675 Change-Id: I86b049b869e9f2951426dc67a485ad7c60ef1403 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QHeaderView - call viewport->update() in setDefaultSectionSizeThorbjørn Lund Martsum2012-11-211-0/+1
| | | | | | | | Just like in resizeSection, moveSection, swapSection (and more) we should call update on the viewport after setDefaultSectionSize. Change-Id: I88154138d98f644050054d7cd287a0addd9a9cf9 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView::setDefaultSectionSize to handle auto size of sections.Thorbjørn Lund Martsum2012-11-211-0/+3
| | | | | | | | | | | setDefaultSectionSize should respect auto resized sections like QHeaderView::resizeSection(). When setDefaultSectionSize is called we should process a possible pending resize and afterwards we should do a (delayed) resize of the sections (if we have autosized sections) Change-Id: Ie09e6f073c944b58693ffbbd1d1a8b60104c1a55 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView:setDefaultSectionSize add invalidateCachedSizeHint callThorbjørn Lund Martsum2012-11-211-0/+1
| | | | | | | | | We cannot rely on the previous sizeHint and we also call it in QHeaderView::resizeSection(). There seems to be no reason not to call it. Change-Id: Ia473fb7163369aafa5c019ff97a030f9f54a33d9 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Detect Unity by checking XDG_CURRENT_DESKTOP and use Gnome theme.Friedemann Kleint2012-11-201-1/+2
| | | | | | | | | | Fallback to Gtk for unknown desktops, which should be suitable for most cases like XFCE. Task-number: QTCREATORBUG-8254 Change-Id: Iaf9959f75852e03a83b5af7d0dead01ef657d678 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* QHeaderView - do not keep indexes from an obsolete modelThorbjørn Lund Martsum2012-11-201-0/+1
| | | | | | | | | | | | | When we call setModel persistentHiddenSections are no longer relevant. It contains indexes from the previous model. This solves: Task-number: QTBUG-18196 Change-Id: Ida02fa63a915695e3730fd63995ac5f8520ae827 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Made QGtkStyle internalJ-P Nurmi2012-11-201-1/+1
| | | | | | | | | | | | | We will take this opportynity to remove various QStyle specializations from the public API in Qt5. This gives us much more freedom, for example some styles could be even separated out of QtWidgets and be provided as plugins instead. => Use QStyleFactory and/or QProxyStyle instead of creating an instance or inheriting QGtkStyle directly. Change-Id: Iea1f7ebc80949d29f02733f81674355578e2e4fc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Regression fix to QHeaderView::setDefaultSectionSizeThorbjørn Lund Martsum2012-11-151-0/+1
| | | | | | | | | | | | When the sections has been resized we need to calculate new values for the section start-positions. Otherwise we break visualIndexAt and sectionPosition. This fixes a regression introduced in b800d8b94a7861ecf8853621f6556fca186fb5b7 Change-Id: I148dbf44f742208787ed59b70d82b8048d721e90 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* 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>