summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug showing folder icons for filesArnt Witteveen2012-03-171-9/+10
| | | | | | | | | | | | | | | | | | | | Fix an issue where the cache was updated with the folder icon, even though this is never used from the cache. This caused files to sometimes be shown with a folder icon: If a folder has an extension (e.g. a folder named 'folder.ext'), this means the folder icon will be written to the cache for the 'ext' extension, and from that point on all .ext files will be shown with the folder icon. The fix is to not save an icon in the cache for those cases where it will not be used from the cache anyway, by using the same condition for updating the cache as for reading it (which is in line 8 of the same function). Change-Id: I9ce8fca0718b2b62b9390fa64989acd54952a88e Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Use pointers for QAccessibleEvent.Frederik Gladhorn2012-03-154-38/+34
| | | | | | | | | At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* QTableView: call model->submit() on row changeMark Brand2012-03-151-0/+16
| | | | | | | | | QTreeView already does this in the exact same way. It's necessary to call submit() so edit strategy OnRowChange in QSqlTableModel will work as expected. Change-Id: Ib430143e8a71f3b0bcd842fcc772cc7ee4525f0a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QHeaderView - documentation update. Prefer hideSection over 0-resize.Thorbjørn Lund Martsum2012-03-141-2/+4
| | | | | | | | There is a different behavior on 0 sections and hidden sections e.g with scrollbars. Normally people want to use hideSection. Change-Id: Id99de30ea46906bb4ef7720ed12d4ac9615c9743 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - renaming functions in Qt5Thorbjørn Lund Martsum2012-03-145-46/+115
| | | | | | | | | | | | | | This patch renames the functions in Qt5 according to the notes. It also renames resizeMode to be consistent. The old functions are both marked with both QT_DEPRECATED and '### Qt 6 - remove' All usage of the function within the qtbase are also changed to use the new functions. Change-Id: I9e05fa41d232e9ca43b945fcc949987017f3aedd Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add two (forgotten) since 5.0Thorbjørn Lund Martsum2012-03-141-0/+2
| | | | | | | | | | | | SHA for QWidget::hasHeightForWidth change: 466107107a85e7211c4b7f77b36ec50625657061 SHA for QAbstractItemDelegate::destoryeditor change 15f253a46aa45e2a9fa1055799fa2768ba49b9a3 Change-Id: Ic7e38c15f62eef22ab95414fad6e7b6c9c7d4f59 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-0212-156/+156
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Refactor the QPA dnd interface.Friedemann Kleint2012-02-292-2/+10
| | | | | | | | | | | | | | | - Give QPlatformDrag a synchronous drag() function returning the Qt::DropAction - Move the base functionality for asynchronous event handling to the platformsupport library as QBasicDrag (extendable base class handling drag icon and providing new virtuals) and QSimpleDrag (sample implementation for drag within the Qt application). - Change the Windows implementation accordingly. - Change XCB to be based on QBasicDrag. - Clean up QDragManager. Change-Id: I654f76f0e55a385ba189bd74f3ceaded6a8fe318 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QHeaderView - remove sectionCount variableThorbjørn Lund Martsum2012-02-292-69/+67
| | | | | | | | | | | | | A previous patch ensures that we have exactly one section in a Span. ( see SHA : b800d8b94a7861ecf8853621f6556fca186fb5b7 ) Therefore we no longer need the sectionCount variable. We have assess to it through the sectionSpan.count. To keep this patch quite simple the variable sectionCount has been changed to a function returning the count value. Change-Id: Ibc419eafa38ab64b08f93074cb6ae4b8518995f6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - minor cleanup in viewportEventThorbjørn Lund Martsum2012-02-271-9/+4
| | | | | | | | | | | | | | | | | This is an improvement to a previous fix with SHA e62e71162606fec134600955a89b7e0c34a7840b We actually never want to call resizeSections if the parent is hidden. Therefore we can both simplify and improve the code with this patch. When we do show/hide on parent then the visible status is updated before we get into this code. I have verified the patch on the code from: Task-number: QTBUG-14234 Change-Id: If7bfa3b3813c97b4a545e48423526e9cfe118de4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove usage of deprecated QAbstractItemModel::setRoleNamesOlivier Goffart2012-02-271-5/+3
| | | | | Change-Id: If41bf0d6d50969156269c67a15e006d38edc8e1f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't use deprecated QAbstractItemModel::reset()Olivier Goffart2012-02-274-4/+8
| | | | | Change-Id: Idf9971668a372a12ba319d954c35e157d8a08bd1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove usage of deprecated QRect::uniteOlivier Goffart2012-02-261-1/+1
| | | | | Change-Id: I1920da995fde6ff2a8b2e3facddeee6e3c17b44c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* QHeaderView - fix setOffsetToSectionPosition a bitThorbjørn Lund Martsum2012-02-241-2/+2
| | | | | | | | | | | It might be silly to have sections with size 0 without using hideSection. Nevertheless we should still use the principle of least surprise. It does not make sense that hiding a row 'far' away should affect the semantics of setOffsetToSectionPosition on lower indexes. Change-Id: Iaf847eba2ea4d28fc7bcfe3a27d62f432f6f61e0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - change not needed if to Q_ASSERTThorbjørn Lund Martsum2012-02-241-2/+1
| | | | | | | | | | | | | | | This removes an if that should always be false. If it isn't false we had more logical indexes than sections. Unless visualIndices and logicalIndices are both 0-sized (meaning that visual and logical indexes are the same) then they better have exactly as many indexes as sectionCount. Otherwise there must be inconsistent data - some logicalindex would refer to non-existing visual sections or some visualindeces wouldn't be hit by logicalIndices. Change-Id: I2dc92f40895438d912bba20612131baf63df4fbe Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - create a union to save some space.Thorbjørn Lund Martsum2012-02-211-3/+5
| | | | | | | | | Beside saving some space it also ensures a bit faster vector operations (remove and insert memcpy) - and lower the risk for a cache-miss. (Many operations seems to be about 5-10% faster in the benchmark). Change-Id: If8109e2146c25f642015906375dfbb449706ce8e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderview - many sections removed performance boost.Thorbjørn Lund Martsum2012-02-212-2/+23
| | | | | | | | | | | | | | | | | | | When the QHeaderView model rowCount is decreased then the headerview needs to remove some sections. If e.g swapSections had occured then qheaderview before this patch did a very slow removal by removing one section at a time and for each section it restored visual and logical indexes. By temporarily storing the logical index on the section we can reduce the execution time of this a lot. The old code is only faster when we remove one index (and is kept for that situation) There is a complexity in difference (and many factors in our qheaderview benchmark (the trunc part)) Change-Id: If45eab17fbca3364d458b004980570b5d013e4bd Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Widgets: Remove obsolete QGuiPlatformPlugin.Friedemann Kleint2012-02-171-5/+0
| | | | | | | | It has been superseeded by QPlatformTheme. Task-number: QTBUG-24204 Change-Id: I8c4131c7bfd8201e747984d772ed8042610192b8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Some small doc fixes, typos and removal of one incorrect paragraphAndy Shaw2012-02-172-5/+5
| | | | | | | | | The QTextStream paragraph that is removed referred to something that is incorrect. This was confirmed for Windows, Linux and Mac. Change-Id: Ibac8f82482f2060308b5b8485d6da228bdf52fe6 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> (cherry picked from commit 80cebfde10cf34dcc0777c24f1b3ff37cad20181)
* QHeaderView::moveSection performance boostThorbjørn Lund Martsum2012-02-152-245/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | The patch also speeds up swapSections and hideSection a lot. It work by eliminating the Span. (That is forcing each 'Span' to have exactly one element) That saves a lot of loops since we can often lookup info fast - and/or change it fast. Since it is often a complexity change, it is difficult to put %-increase on. (The most used linear function is recalcSectionStartPos() - and it has a very low constant) However comparing with the new benchmark (2500 rows) swapSection, showHideSection and moveSection are about 20-40 factors faster. (Yes, it is a lot faster!) In the benchmark moveSection is about 300 factors faster. Beside being a far better model it is also far more simple. This fix partly solves: Task-number: QTBUG-19092 Change-Id: I8deeb9315276d15c68e8a27d5dcb8e0c0badf367 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove no longer needed ifdef Q_OS_WINCE.Andreas Holzammer2012-02-101-8/+0
| | | | | | | | There is now an implementation to qt_pixmapFromWinHICON. So use it for Windows CE too. Change-Id: Ie2f3cacd4be9209e33d49e53703c5abc95d98d09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QHeaderView - minor bug in visualIndexAtThorbjørn Lund Martsum2012-02-101-2/+2
| | | | | | | | | | | | | | | This fixes a minor bug in VisualIndex triggered when calling resizeSection with size 0 (but not hideSection). It is mostly cosmetics - however hopefully there will soon be a minor refactoring and there is really no need to make strange code to keep a semantic bug. However it is also doubtful to make a semantic change while refactoring. Change-Id: Ide153e421fd7a634062cb74867f4a49da4bf9cd6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Replace Q_WS_WINCE against Q_OS_WINCE.Andreas Holzammer2012-02-091-1/+1
| | | | | | | | | | Window system Macros where deprecated so use Q_OS_WINCE for now. This code will need some refactoring, but this is the first step to it. Change-Id: I5876b80ee45d4b38ac63fc7d51e775dc70bbd485 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Make QAbstractItemView::itemOptions properly initialize a V4 optionGiuseppe D'Angelo2012-02-031-16/+15
| | | | | | | | | Since the QStyleOptionViewItem now contains the V4 fields, they must be properly initialized when calling itemOptions. Change-Id: I1346e6887d2d9a7eb29cc458fa4eede0b815001c Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Introduce QItemDelegate::destroyEditor virtual invoked at editor closeThorbjørn Lund Martsum2012-02-024-8/+28
| | | | | | | | | | | | | | This provides a stronger mechanism e.g when inheriting QItemDelegate. It makes some things much easier e.g avoid delete of an editor and maybe only delete depending on what the editor says itself. This introduces a new virtual function. Task-number: QTBUG-2299 Change-Id: I8410f8199775987dbacffd99e4c354fdadcdd21f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - Do not try to remove non-existing sectionThorbjørn Lund Martsum2012-02-011-1/+1
| | | | | | | | | The end parameter passed to removeSectionsFromSpans is off by one. removeSectionsFromSpans can currently handle/ignore it, but it is still wrong. Change-Id: I9148bd106504a37a5c8fd72928ab84c669eebcdb Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Windows: Fix inclusion of <windows.h>Friedemann Kleint2012-02-011-3/+3
| | | | | | | | | | | | | - Always use <qt_windows.h> as the last file to be included. - Remove it from some headers, use Qt::HANDLE instead of HANDLE. - Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE. - Add NOMINMAX to qt_windows.h to avoid problems with the min/max macros. - Remove <windows.h> from qplatformdefs.h (VS2005) Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Accessibility: Use new updateAccessibility() API in widgets.Friedemann Kleint2012-02-014-20/+20
| | | | | Change-Id: Id69cc28a54abc675a991f2c657a446f38313ac6e Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Compile with clangMorten Johan Sorvig2012-02-011-0/+1
| | | | | | | | | | Add back friend declaration removed in e8105e4. QListViewPrivate uses QAbstractItemView:: DropIndicatorPosition, which is protected. Change-Id: Ie9fa9422bf4fb7846637dac24a644d4814cfe622 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
* QHeaderView - preventing negative section sizes.Thorbjørn Lund Martsum2012-02-011-1/+1
| | | | | | | | | | | | | | This patch removes the posibility to call resizeSection with negative sizes. Sections with negative sizes affect the other sections, and it does not seem to have a useful, well-defined semantic. The length can also become negative - and visualIndexAt work strange. Change-Id: I632beb160649fa10e2106314557b8c5a106aa3cf Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - fix to resizeSection patch (Ia812a747)Thorbjørn Lund Martsum2012-01-311-0/+2
| | | | | | | | | | | | | | | | | | | A minor simple adjustment to the update-patch for resizeSection. ( http://codereview.qt-project.org/#change,11267 ) We can't just return and ignore that we might needed to call d->doDelayedResizeSections Just because the header does not have updates enabled does not mean that the view hasn't updates enabled - and even in that situation we actually still wanted to keep this. (It is only if the parent is not visible we safe can/should skip this - but I will look into that later) Change-Id: I771de086a07d1e7612a6bfea132d4d15f277ceb3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView::setOffsetToSectionPosition documentation updateThorbjørn Lund Martsum2012-01-311-4/+6
| | | | | | | | | | | | | | | | The documentation has used the word visualIndex for the argument to this function. That is however very misleading since this visualIndex is not the same as 'visualIndex' as we have in visualIndex(int logicalIndex) logicalIndex(int visualIndex) or visualIndexAt(int position) Beside the above a variable name has also been changed from visualIndex to actualVisualIndex. Change-Id: I43808adfd7c287a349474ab1e2656c417c8cf3e9 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Windows: Fix compilation with -qtnamespaceKai Koehne2012-01-311-2/+4
| | | | | Change-Id: Ib006d74299d65e5872a5a524eaa937e127306ec7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add public role names setter to QStandardItemModelChris Adams2012-01-312-0/+11
| | | | | | | | | This allows QStandardItemModel to be usable in QML without requiring clients to subclass it. Task-number: QTBUG-15067 Change-Id: I867fcd8137132affdf21f37a9fa293e855a09a13 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove Symbian and Maemo 5 code from QtWidgets.Xizhi Zhu2012-01-312-8/+3
| | | | | Change-Id: I715c0ec70cbad05a6ba9737e49be9da7cbd65bf9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Change the type key for delegate editors to int.Stephen Kelly2012-01-304-30/+28
| | | | | | | | | | | | | | | | Previous type of QVariant::Type does not allow for custom types. While technically source incompatible I found no re-implementation of this class in qttools or qt-creator (most likely to use it for property editors). The virtual methods are not needed because registerEditor is all the API that is really needed. Task-number: QTBUG-1065 Change-Id: I2a9c578c444a80359416f2224a0ee03903bfe779 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QHeaderView - length returns wrong value fixThorbjørn Lund Martsum2012-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | setSectionHidden called with (logindex, true) will sometimes prevent a (correct) call to resizeSection(logicalIndex, 0). This seems a bit odd - however it does execute d->doDelayedResizeSections(). Therefore the section is going to be hidden later. However it is a problem that the length meanwhile is wrong. (That is a value that is not the sum of the sections) This is fixed by execute updates before returning the length. Task-number: QTBUG-14242 Change-Id: Ia1d2f6db3213792b250a6a37942b56554261cd3a Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3056-56/+56
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-2519-19/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2356-56/+56
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QTreeView: fix crash when starting a drag with hidden columns.David Faure2012-01-121-4/+12
| | | | | | | | | | | | Crash was introduced by d639105759491 (pre-Qt-4.8 only) Task-number: QTBUG-15834 Merge-request: MR-2725 (cherry picked from qt4 commit fd25323de7b5d5f3e0ffb1bd81ea4d251e071566) Change-Id: I59959d3ba4c9bcb0d39bdbe58432817bbbfdd9f1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Set missing flags in the option when rendering QTreeView drag pixmapDavid Faure2012-01-124-39/+82
| | | | | | | | | | | | | | | | QAbstractItemViewPrivate::renderToPixmap was not setting all the flags that the normal QTreeView painting sets: option.showDecorationSelected, option.viewItemPosition (so the drag pixmap looked wrong on Windows 7, with rects around each cell), and then the unittest also discovered that State_Children/State_Sibling wasn't set either. Task-number: QTBUG-15834 Merge-request: 2517 (cherry picked from Qt4 commit d63910575949106f84dacf04abaa14fc866aa66b) Change-Id: I0a5014d960543c3ed8fea73d6df578e7e521b0e0 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Rename internal method check to doCheckStephen Kelly2012-01-102-18/+6
| | | | | | | | | | | Mac OSX has a check macro in /usr/include/AssertMacros.h which can conflict with this API if used together. http://boost.2283326.n4.nabble.com/Boost-with-Darwin-Mac-gcc-4-0-1-td2580330.html Change-Id: I93ddd08fa2b51b198bbc02ce501d79ed97a32c34 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add roles to the dataChanged slots in views.Stephen Kelly2012-01-068-14/+14
| | | | | | | | | | | | | | | | This is a source incompatible change. This is for consistency with the signal for the lifetime of Qt5. I could imagine people trying to override a virtual function (in a new class while using the Qt5 library) with the arguments of the signal and have that fail due to the arguments not being correct. It also allows ignoring dataChange events when they are known not to be for roles which are relevant to particular views or delegates. Change-Id: Ica191835125c1c8fdaf665debb62d635e81700dc Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add the roles to the dataChanged slot.Stephen Kelly2012-01-062-7/+7
| | | | | | | | This will allow the possibility of ignoring dataChange signals for roles which are not interesting to particular widgets. Change-Id: Ia7dcebd875f7b9fa90aa5e9bff7ef5ca9f381d55 Reviewed-by: David Faure <faure@kde.org>
* Update copyright year in license headers.Jason McDonald2012-01-0556-56/+56
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Connect to the moved signals in the header view.Stephen Kelly2011-12-211-0/+8
| | | | | Change-Id: I6954f77ad7d02970f562abcbaf4e733c6d43ead5 Reviewed-by: David Faure <faure@kde.org>
* Fix whitespace consistency.Stephen Kelly2011-12-211-4/+4
| | | | | Change-Id: Ia5debce8e5be4e9c67e1ef303e136816ab55bf90 Reviewed-by: David Faure <faure@kde.org>
* Add missing connections.Stephen Kelly2011-12-201-0/+8
| | | | | | | Unit tested in next commit. Change-Id: Iab37829f98ef8f2258a30aed60e95aa114379b7e Reviewed-by: David Faure <faure@kde.org>
* Change a slot into a virtual method.Stephen Kelly2011-12-193-15/+9
| | | | | | | | Implements a BiC Qt5 TODO. Change-Id: Ie7dc32d954335019166dbd78d8b01ef79e2ad5c2 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>