summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* Remove workaround for QComboBox not having a USER property.Stephen Kelly2012-03-281-0/+31
| | | | | | | | | | QComboBox does in fact have a user property since b1b87a73012342dc1619a8e907ea9954d59ca564. Change-Id: I24eb2ef267cec5d8a9f7348954b703fa6df04fa5 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: David Faure <faure@kde.org>
* Add USER properties to QDateEdit and QTimeEdit.Stephen Kelly2012-03-281-0/+10
| | | | | | | | | | | | Both classes had such components before, but there were issues with the NOTIFY signal not being in the same class as the Q_PROPERTY. This patch solves that problem by using a signal of a different name. Task-number: QTBUG-15731 Change-Id: Ibc7ce4dba8a6b88c05d62a90e14d0101c5cd3082 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QHeaderView - minor fix to setDefaultSectionSizeThorbjørn Lund Martsum2012-03-201-0/+27
| | | | | | | | | | This fixes a situation where we (wrongly) assume that a section with size 0 is hidden. However a hidden section should be one that we have called hideSection (or setSectionHidden) on. Change-Id: Ic14eded2666022f27434dc55927323a74910549c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QTableView: call model->submit() on row changeMark Brand2012-03-151-0/+27
| | | | | | | | | 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 - renaming functions in Qt5Thorbjørn Lund Martsum2012-03-141-30/+30
| | | | | | | | | | | | | | 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 fonts to QPlatformTheme.Friedemann Kleint2012-03-071-1/+2
| | | | | | | | | | | | | | | | - Remove QPlatformFontDatabase::defaultFonts() returning a hash containing widget name ->font and the Windows implementation. - Add enumeration and font accessor to QPlatformTheme. The value returned for the enumeration value overwrites the default font of the font database. - Implement for Windows, Mac and KDE. - Add more Windows palettes. Task-number: QTBUG-23686 Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Fix inconsistent auto test executable namesDavid Faure2012-02-271-1/+1
| | | | | | Change-Id: I3b6b5b37e32be25d1b9933395c43f6d5aa5b8810 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* QHeaderView - fix setOffsetToSectionPosition a bitThorbjørn Lund Martsum2012-02-241-0/+28
| | | | | | | | | | | 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>
* Make 'nmake check' succeed for widgets testsMiikka Heikkinen2012-02-171-0/+2
| | | | | | | | | | | | | Marked a bunch of tests insignificant, and skipped one crashing test case in QApplication test, as that couldn't be made to pass simply by marking the test insignificant. Once the underlying issues are fixed, the tests need to be re-enabled. Task-number: QTBUG-24203 Change-Id: I9aea4fa207d307793445efdcaead72219fbf6c4f Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove usages of QT_ARCH and QT_ARCH_* from qtbaseBradley T. Hughes2012-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The architecture is detected at compile time based on the predefined macros from the compiler. Don't use QT_ARCH in .pro, .pri, or .prf files. The PNG_NO_ASSEMBLER_CODE define from libpng.pri is not present in the current copy of src/3rdparty/libpng, so no change in functionality is expected. The conditional for the SUPPORT_JIT define in pcre.pri is moved to src/3rdparty/pcre/config.h, again so that we can use the compiler's predefined macros to detect the architecture at compile time. Replace QT_ARCH_ARM, QT_ARCH_MIPS, and QT_ARCH_SPARC with their Q_PROCESSOR_* equivalents. Replace QT_ARCH_INTEGRITY, QT_ARCH_VXWORKS, and QT_ARCH_WINDOWSCE with their Q_OS_* equivalents. Note that this commit also effectively disables the SPARC atomic implementation. An inline implementation for SPARC needs to be added, or we remove the current code and instead rely on the GCC intrinsic or C++11 std::atomic support on SPARC. Note also that this commit does not remove QT_ARCH from configure or qconfig.h. This will continue to be set until all Qt 5 projects can be moved away from using QT_ARCH. Change-Id: I5de747cc4436d21941329974cff3016970f497b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Eliminate duplicate data row names in widgets autotests.Jason McDonald2012-02-154-14/+14
| | | | | Change-Id: I82bab3cc39320014fac6732c7b60233b262cb30d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QHeaderView - minor bug in visualIndexAtThorbjørn Lund Martsum2012-02-101-12/+21
| | | | | | | | | | | | | | | 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>
* Merge QStyleOption*V{2,3,4} classes togetherGiuseppe D'Angelo2012-02-022-0/+10
| | | | | | | | | | | | | | | | | | | | | | | In order to keep binary compatibility, Qt 4 introduced V{2,3,4} classes for QStyleOption subclasses. They're simple, low level containers for various members with public access (no accessors required). In Qt 5.0 we can break BC, so this patch moves the members from the derived classes into the ``base'' ones. The ``base'' ones get a version bump matching the highest version available, and the V{2,3,4} classes become typedefs. This change can cause problems in code that used QStyleOption directly, especially QStyleOptionViewItem, because the old V4 fields get default initialization but the QStyle subclasses detect that the option is a V4 option and expect all fields to be properly initialized. The fix in such places is to properly initialize all fields. Task-number: QTBUG-23522 Change-Id: I2f782da09ca5cc8c4cbafc07448fb0d33153a251 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Introduce QItemDelegate::destroyEditor virtual invoked at editor closeThorbjørn Lund Martsum2012-02-021-3/+29
| | | | | | | | | | | | | | 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>
* Extending the auto test for QHeaderViewThorbjørn Lund Martsum2012-02-011-3/+501
| | | | | | | | | This is a test that verifies correct behaviour of qheaderview. It includes test of swapSections, moveSection, rowcount-change, resizeSection, hideSection and position lookup. Change-Id: Idc1fe8167f2d95dee5c5b1161cb633cbf9495d17 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QHeaderView - preventing negative section sizes.Thorbjørn Lund Martsum2012-02-011-0/+10
| | | | | | | | | | | | | | 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>
* Add public role names setter to QStandardItemModelChris Adams2012-01-311-0/+20
| | | | | | | | | 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>
* QHeaderView - length returns wrong value fixThorbjørn Lund Martsum2012-01-301-0/+21
| | | | | | | | | | | | | | | | | | | | 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-3019-19/+19
| | | | | | | | | | 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>
* Fix a typo in tst_qtreewidget autotest.Jędrzej Nowacki2012-01-261-1/+1
| | | | | Change-Id: I573467c3fdfc4b3d059b216258d39944ac546061 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Replace Q_WS_MAC with Q_OS_MAC in tests/auto/widgetsBradley T. Hughes2012-01-231-3/+3
| | | | | | | | tst_qwidget.cpp will not build/link without tst_qwidget_mac_helpers.mm, so re-add it to the build as well. Change-Id: I55130f62c215c4b82683d90456e31fdb09f833a8 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2319-19/+19
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Expect tst_QTreeView::editTriggers() failure on Mac OS XBradley T. Hughes2012-01-201-0/+3
| | | | | | | | | EditKeyPressed 4 test data fails, all other test data for the function pass. Task-number: QTBUG-23696 Change-Id: Ied56bd0b653ad4dcc2b6451b486aae7cad134211 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Expect tst_QColumnView::moveCursor() failure on Mac OS XBradley T. Hughes2012-01-201-0/+3
| | | | | | | | Both test data fail. Task-number: QTBUG-23697 Change-Id: Iee4b08a88db33c72c584e326e928863af61c8dd4 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Flag tst_QTreeView::styleOptionViewItem test as unstable.Toby Tomkins2012-01-161-0/+3
| | | | | | | Task-number: QTBUG-23638 Change-Id: I8c07976001aeec5ba796d4b3e9ee421e32ba1360 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Flag tst_QItemDelegate::task257859_finalizeEdit test as unstable.Toby Tomkins2012-01-161-0/+2
| | | | | | | Task-number: QTBUG-23637 Change-Id: Ib08431ab1752c354f62646b3c207d9c24ac5eae5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QTreeView: fix crash when starting a drag with hidden columns.David Faure2012-01-121-19/+26
| | | | | | | | | | | | 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-122-1/+13
| | | | | | | | | | | | | | | | 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>
* Update copyright year in license headers.Jason McDonald2012-01-0519-19/+19
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move proxy and selection models to QtCore.Stephen Kelly2011-12-1616-7397/+0
| | | | | | Change-Id: I71097855cb9e28105238e496778f29f99f7fc84e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Forward the contents of the parents argument through this proxy.Stephen Kelly2011-12-091-0/+53
| | | | | Change-Id: Ifabc2a7deec8ea045bf9a9f46fb3a97410dd33f2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Notify about moves in the source model more efficiently.Stephen Kelly2011-12-091-0/+130
| | | | | Change-Id: I5ea2a2dddc1b39a3d2b405bda815f42df7c07c75 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use QTRY_VERIFY to test asynchronous behaviour.Jason McDonald2011-12-071-23/+2
| | | | | | | | | QTRY_VERIFY waits for a condition to become true while regularly processing events. There is no need for a custom solution to this problem. Change-Id: Ia65c90cbdb165b543f5c78f9bac3cfadd77dfb3f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use QTRY_VERIFY to test asynchronous behaviour.Jason McDonald2011-12-071-18/+1
| | | | | | | | | QTRY_VERIFY waits for a condition to become true while regularly processing events. There is no need for a custom solution to this problem. Change-Id: Ia23e2fb61cdc5c3a3a8a729cd4356ba930fe7cb7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-0619-57/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moved integrationtests/* into other/Jo Asplin2011-11-302-2/+2
| | | | | | | | | | | | | | | Currently there seems to be no precise definition of what an integrationtest is in the context of Qt testing. To avoid confusion, the tests under integrationtests/ are moved into other/ (which is effectively where we keep tests that don't clearly fit into any other category). Tests can be moved back into an integrationtests/ directory at a later point, should an unambiguous definition be established. Change-Id: I3bb289be2dc2aca11b51a8ce8fcc5942f06d6c5c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Be specific about what part of the model is being re-layouted.Stephen Kelly2011-11-251-0/+69
| | | | | Change-Id: I6b6fe98929543447f945a335c33960823c0d1a4a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* qtbase tests: Fix some warningsFriedemann Kleint2011-11-212-3/+1
| | | | | | | | - Fix warnings about QAtomicPointer/Int usage - Fix some gcc 4.6 warnings about assigned/unused variables Change-Id: Ib4dbf9110f0dad93ad48e97278310f05fad3a82a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't depend on moc to disable test functions.Jason McDonald2011-11-183-22/+17
| | | | | | | | | | | | | | | | | | | | | The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Provide defaultFont with fontconfig dbJiang Jiang2011-11-151-1/+0
| | | | | | | | | | | So that it won't just return "Helvetica" that may not exist in target system. Providing it seems to fix QTBUG-21833 as well, thus we can remove the QEXPECT_FAIL statement in qlistview test. '_' appears to reach the minimum right bearing in some fonts. Task-number: QTBUG-21833 Change-Id: I2340af6ee736083ec4f6575e469840ebec4e545e Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Avoid crash in QColumnView autotest.Jason McDonald2011-11-151-0/+5
| | | | | | | | | | | | | When combined with http://codereview.qt-project.org/8644, the test crashes. This appears to be due to a column of the view being deleted in response to calling setCurrentIndex(), as documented in QTBUG-22707. This commit must be merged at the same time as http://codereview.qt-project.org/8644. Task-number: QTBUG-22707 Change-Id: I075be7df5d9196e37e2286e61d317086a76a167d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add API to clear the current index. Symmetric with clearing selection.Stephen Kelly2011-11-111-0/+32
| | | | | Change-Id: I08070f4fdf26898d5b6edd5259f011f9b3c75512 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make this API virtual to make selection proxying possible.Stephen Kelly2011-11-111-0/+9
| | | | | Change-Id: Ie93c8b38c59d347026a68eae03687d9017b3d048 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Re-enabled passing tests in tst_qlistviewJo Asplin2011-11-042-2/+1
| | | | | | | | | | | To increase the effective test coverage, this patch re-enables the tst_qlistview test case as such, and instead disables only the test functions that are currently failing in CI. Task-number: QTBUG-22453 Change-Id: I029be60c16cdff5ee3e38889d2780f1ee7d01b51 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Remove empty functions from QDirModel test.Jason McDonald2011-11-031-27/+0
| | | | | Change-Id: Ieb8af41425739f9175df26224b171cd9f8b3c4f3 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve QDirModel autotestJason McDonald2011-11-031-5/+25
| | | | | | | | | | The unreadable() test function has been disabled since before the tests were imported into the Qt repository. The idea of the test seems valid (though the original implementation failed to correctly create an unreadable file), so it should be re-enabled. Change-Id: I94634bc5785dfbfbb42ca975badaead7fe812b29 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Reinstate disabled part of qsortfilterproxymodel testJason McDonald2011-11-021-3/+1
| | | | | | | | | This test function has been disabled since before the tests were imported into the Qt repository in 2006, but seems to pass today, at least on Linux. Change-Id: I8ff90a11a0fbb260d66b20ae735b5f21c450a5af Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove stale test data from qsortfilterproxymodel testJason McDonald2011-11-021-43/+0
| | | | | | | | | The removed test data has been disabled since before the tests were added to the Qt repository in June 2006, and was incomplete (the "pattern" field was missing). Change-Id: I974d03a4dcca76ba1a20f740372702612c8ce02b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove redundant code from qsortfilterproxymodel testJason McDonald2011-11-021-4/+1
| | | | | | | | | Remove a couple of "#if 1" directives (but not their contents), which have been present since before the tests were imported into the Qt repository in 2006. Change-Id: Id43aff37843e7a44ed96973f809de3838ba0e5b9 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove disabled code in QItemView test.Jason McDonald2011-11-021-56/+0
| | | | | | | | | | The removed code was disabled in January 2007. The commit history does not make clear what the code was supposed to achieve and the code doesn't do what the comment at the top says (that looks like a TODO). Best to delete it and start again. Change-Id: I42b6b1d865c96518d74dc189a4a41d0d2776e5bc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>