summaryrefslogtreecommitdiffstats
path: root/src/gui/itemmodels
Commit message (Collapse)AuthorAgeFilesLines
* Long live QAIM::multiData!Giuseppe D'Angelo2020-09-022-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Views / delegates absolutely *adore* hammering data(). A simple QListView showing a couple of dozens entries can call data() a hundred of times on the first show. Back of the hand calculation, * 2 times per visible item (sizeHint() + paint()), * times 9 roles used by the default delegate, * times 20 visible items = 360 as a bare minimum, assuming the view doesn't redraw twice accidentally. Move the mouse over the view, and that'll cause a full update with certain styles: 360 calls to data() per update. This has an overhead visible in profilers. The model's data() has to re-fetch the index from its data structure and extract the requested field every time. Also, QVariant is used for the data interexchange, meaning anything that won't fit in one is also a memory allocation. This problem will likely be gone in Qt6Variant as that will store sizeof(void*) * 3, meaning QImage/QPixmap and similar polymorphic classes will fit in a QVariant now... So I'm trying to to remove part of that overhead by allowing views to request all the data they need in one go. For now, one index a a time. A view might also store the data returned. The idea is that the same role on different indexes will _very likely_ return variants of the same type. So a model could move-assign the data into the variant, avoiding the memory allocation /deallocation for the variant's private. This patch: 1) Introduces QModelRoleData as a holder for role+data. 2) Introduces QModelRoleDataSpan as a span over QModelRoleData. The idea of a span type is twofold. First and foremost, we are in no position to choose which kind of container a view should use to store the QModelRoleData objects for a multiData() call; a span abstracts any contiguous sequence, leaving the view free to do whatever it wants (statically allocate, use a vector, etc.). It also solves the problem of efficient passing the roles and gathering the returned variants from multiData(). 3) Add multiData(), which populates a span of roles for a given model index. The main advantage here is that a model can fetch all the needed information for a given index just once, then iterate on the span and provide data for each requested role. Cf. this with data(), where every call has to re-fetch the information for the index. A couple of models have been ported to multiData(), as well as QStyledItemDelegate. [ChangeLog][QtCore][QModelRoleData] New class. [ChangeLog][QtCore][QModelRoleDataSpan] New class. [ChangeLog][QtCore][QAbstractItemModel] Added the multiData() function. Change-Id: Icce0d108ad4e156c9fb05c83ce6df5f58f99f118 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove ### Qt 6 commentVolker Hilsheimer2020-08-261-1/+0
| | | | | | | | | Adding the role that changed to the itemChanged signal is computationally expensive for the general case. Not going to be done, at least not for Qt 6.0. Change-Id: I3e6fca6a5c7b517c3c035477ce5d23d8870bad57 Reviewed-by: David Faure <david.faure@kdab.com>
* Move QFileSystemModel into QtGuiVolker Hilsheimer2020-08-256-6/+3368
| | | | | | | | | | | | | | This requires a QAbstractFileIconProvider in QtGui, as the standard QFileIconProvider depends on QStyle, and cannot be moved out of QtWidgets. QAbstractFileIconProvider returns strings for file types, but returns no icons yet. Support for a default icon set might be added in a follow-up commit. Change-Id: Ib9d095cd612fdcf04db62f2e40709fcffe3dc2b7 Fixes: QTBUG-66177 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Disentangle QIODevice dependenciesLars Knoll2020-08-151-0/+1
| | | | | | | | | | | | | | | | | Move the QIODevice::OpenMode enum into a base class, so that we can remove the full QIODevice (and thus QObject) dependency from qdatastream.h and qtextstream.h. This is required so that we can include QDataStream in qmetatype.h without getting circular dependencies. As a nice side effect, QDataStream and QTextStream can now inherit QIODeviceBase and provide the OpenMode enum directly in their class scope. Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-311-11/+11
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-071-27/+26
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype in QListLars Knoll2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in guiJarek Kobus2020-06-291-6/+5
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Restore default role names in QStandardItemModel::roleNames()Shawn Rutledge2020-06-101-0/+1
| | | | | | | | | | | | | | Amends 32b586864e3a4398da38c045f4ac0823c3dc3c57, which added an override of QStandardItemModel::roleNames(). It's good for it to have its own QHash so that roles can be added, and because QStandardItemModel::setItemRoleNames() remains un-deprecated; but before that change, they were the roles that QAbstractItemModel had initialized from QAbstractItemModelPrivate::defaultRoleNames(). In particular, we need "display" to map to Qt::DisplayRole by default; several tests in qtdeclarative depend on that. Change-Id: I58b2d6aa6b6c78b1d618335ddc4ecb834af57274 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* ItemModels: remove deprecated functionsChristian Ehrlicher2020-06-072-10/+0
| | | | | Change-Id: Id3430493a62b11977f64e146f7668ca30935b959 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QAbstractItemModel: remove deprecated setRoleNames()Christian Ehrlicher2020-06-073-0/+11
| | | | | | | Remove setRoleNames() and all its now unneeded helper functions. Change-Id: I0a83751aace35700655d4cc7c79278325994cbdd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the deprecated QDirModelVolker Hilsheimer2020-06-041-2/+2
| | | | | | | | | QFileSystemModel is the documented replacement. It uses threads to populate the model, which QDirModel doesn't. Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Models: remove version check for clearItemData()Christian Ehrlicher2020-05-232-16/+1
| | | | | | | The version checks for clearItemData() are no longer needed now. Change-Id: I5052188fb96cf637128662f3442d339820f0f41d Reviewed-by: David Faure <david.faure@kdab.com>
* QStandardItemModel: port a local QSet to QDuplicateTrackerMarc Mutz2020-05-051-4/+3
| | | | | | | | | Apart from a more fitting, minimal, API, QDuplicateTracker also transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or at least reduce, memory allocations. Change-Id: I59242287debfd1e41c663aa2b88d0d3ea44f43fb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove deprecated members from several QtGui classesVolker Hilsheimer2020-04-272-30/+0
| | | | | | | | | | | | | | Those can be trivially removed as they have direct replacements, or are completely unused. The migration path for QCursor::bitmap and QCursor::mask is QBitmap *pb = c.bitmap(); // up to 5.15, warns in 5.15 QBitmap vb = c.bitmap(Qt::ReturnByValue); // from 5.15, works in 6 QBitmap b = c.bitmap(); // from 6.0 on Change-Id: I3b3acd1c7f09c4c8414e98b3ce11986f1ecd5eda Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port QT_NO_TOOLTIP to QT_CONFIG(tooltip)Joerg Bornemann2020-04-211-4/+0
| | | | | | | | | | | | We remove the QT_NO_TOOLTIP check from qstandarditemmodel.h, because as the 'tooltip' feature is in QtWidgets, we cannot use it properly in QtGui. Also this affects just two non-virtual inline methods, i.e. it has no effect on library size. Task-number: QTBUG-82785 Change-Id: Ic166f14fb1cf3e9dd789573a6b9db6a87fb50e10 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Don't call QSet::erase() on an end iteratorLars Knoll2020-03-251-1/+1
| | | | | | | | hash.erase(hash.constFind()) is bound to crash if the hash doesn't contain the item we're looking for. Change-Id: Icbefca87b0258970373ec55d5dc113e6ab39c5f0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsettings.cpp src/corelib/kernel/qvariant.cpp src/corelib/serialization/qjsoncbor.cpp src/corelib/serialization/qjsonvalue.cpp src/corelib/tools/tools.pri src/gui/image/qimage.cpp src/gui/kernel/qguivariant.cpp src/widgets/kernel/qshortcut.cpp tests/auto/tools/moc/allmocs_baseline_in.json tests/auto/tools/moc/tst_moc.cpp src/opengl/qglframebufferobject.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Leander Beernaert <leander.beernaert@qt.io> Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
| * Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-01-041-1/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h Make QVector(DataPointer dd) public to be able to properly merge 5b4b437b30b320e2cd7c9a566999a39772e5d431 from 5.15 into dev. src/widgets/kernel/qapplication.cpp tests/auto/tools/moc/allmocs_baseline_in.json Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
| * QStandardItemModel: do not reset persisten index in setItem()Christian Ehrlicher2019-12-141-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an existing item is replaced with a new one in QStandardItemModel::setItem() then the persitent index is invalidated which leads to some unexpected behaviors (like e.g the header size and resize mode are reset). Therefore we have to make sure that the invalidation does not happen. This can be achieved by delaying the call to QStandardItem::setModel() for the old item until the new is properly added. After this, the old item no longer gets a valid QModelIndex from the model and therefore can't invalidate the persistent index anymore. Fixes: QTBUG-13605 Fixes: QTBUG-73000 Fixes: QTBUG-80586 Change-Id: I4e45e6feb81b7287c0859f638d7ab1a576fc2f0f Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-091-46/+46
|\| | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-46/+46
| | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Get rid of QList forward declarationsLars Knoll2019-10-041-2/+0
| | | | | | | | | | | | | | | | Include qcontainerfwd.h instead where required. This prepares for unifying QList and QVector. Change-Id: I6c85e2bdd44fb41aedd884b0d551f682760df5b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-06-061-1/+1
|\| | | | | | | Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-131-1/+1
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| | * Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Bump version to Qt 6Lars Knoll2019-05-141-2/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed to disable QT_NO_UNSHARABLE_CONTAINERS, as this triggers asserts. QMetaType also has some Qt 6 specific code disabled to get things to compile. Fix various details in autotests to accommodate for the changes with Qt 6. Add a workaround for black lists on macos, where QSysInfo::productType() now returns 'macos' and not 'osx' anymore. Change-Id: Ie26afb12a2aac36521472715934a7e34639ea4d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-03-151-4/+4
|\| | | | | | | refs/staging/dev
| * Doc: replace 0 with \nullptr in documentationChristian Ehrlicher2019-03-131-4/+4
| | | | | | | | | | | | | | Replace some more 0 with \nullptr. Change-Id: I2af91bf3712eef5161b11da0c44614bc039ade03 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | More nullptr usage in headersKevin Funk2019-03-141-6/+6
|/ | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-211-9/+9
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * Documentation: Add \nullptr macro and use where applicableFriedemann Kleint2019-01-101-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-221-0/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * Doc: Qt GUI: Fix documentation warningsTopi Reinio2018-11-061-0/+3
| | | | | | | | | | | | | | | | | | These are minor typos or documentation warnings that snuck in with new features. Task-number: QTBUG-71502 Change-Id: I03669cfecc3c3d80168ff7b1ca8bca7571e06d25 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Remove excess "virtual" keyword from destructors in Qt GuiAlessandro Portale2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | Destructors whose base class have a virtual destructor are automatically virtual and do not need to be marked as such. Change-Id: I84c73ab965077bbb03f4213e53c241569213cae0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-071-4/+9
|\| | | | | | | Change-Id: I799e2ca2fefa140c8b73b73aa959c6ed8da6eae6
| * Fix QSIM::itemData returning role 255Luca Beldi2018-09-061-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | Before this fix, QStandardItemModel::itemData returns a map containing role 255 which is used internally to store the flags. This role is an undocumented implementation detail so it should not be returned to the user. [ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255 Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd Reviewed-by: David Faure <david.faure@kdab.com>
* | Implement clearItemData in common modelsLuca Beldi2018-09-061-0/+6
|/ | | | | | | | | | A virtual method clearItemData was added to QAIM for Qt6. This patch implements that method to all Qt concrete models for which it makes sense. Task-number: QTBUG-69616 Change-Id: If980fcfc36f723128bc56ec4587c5c3a338dbbcc Reviewed-by: David Faure <david.faure@kdab.com>
* Add a method to clear the data to QStandardItemModelLuca Beldi2018-08-172-0/+35
| | | | | | | | | | After the behavior of setItemData has been changed following QTBUG-45114, QStandardItemModel was lacking an interface to clear all the data from a single index. Task-number: QTBUG-69616 Change-Id: Ide0b5bb6358439fc42c474df8b044fbace6def8d Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: David Faure <david.faure@kdab.com>
* ItemModels: Cache last-known child indexErik Verbruggen2018-06-272-11/+25
| | | | | | | | | | | | | | | Instead of caching the last index of a search for a child item, cache the index of the child in the child item. When the item model is not changed, the index is valid. Otherwise, the index can only change when items get inserted or removed before the child. So in that case, start searching in the vicinity of the previously known index. As an example: a selectAll() on the view will always hit the cached index, so no search is performed for any item in the model/view. Task-number: QTBUG-61368 Change-Id: I85d085299987237fae23451d9e8bbb6060464ef2 Reviewed-by: David Faure <david.faure@kdab.com>
* ItemModels: search for the child index in 2 directionsErik Verbruggen2018-06-271-7/+29
| | | | | | | | | | | | | | | Previously, the search for the index of a child was done by searching forwards (minus 2) from the last search, and subsequently backwards when it wasn't found. This would cause quite some searching in models with lots of items, and where the child lay before the last search. We still assume that subsequent searches for children are "nearby" the previous search, but instead of first searching forwards and then backwards, do the search in both directions. Task-number: QTBUG-61368 Change-Id: Idb549c2d02840632cd658f906816ce911f3ff8bc Reviewed-by: David Faure <david.faure@kdab.com>
* Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-292-4/+4
| | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Gui: Properly use the standarditemmodel featureUlf Hermann2018-03-204-13/+6
| | | | | | | | Require it in the headers and exclude the implementation from the build if disabled. Change-Id: Ida3303f8595f47b469e92d68e8bccc3957d943b6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QStandardItem: add more sanity checks on insertRow(s)/Column(s)Christian Ehrlicher2018-03-071-3/+3
| | | | | | | | | | When QStandardItem::insertRows/Columns is called with an empty list or an insert count of 0, do not assert but return false. Task-number: QTBUG-66491 Change-Id: I328598e08584fb9b0a35075458bfeb31c57ebfee Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QListWidgetItem/QStandardItem: pass role to dataChanged() signalChristian Ehrlicher2018-01-263-8/+28
| | | | | | | | | | | | QAbstractItemModel::dataChanged() gained an optional role parameter with Qt5 which was not filled within QListWidgetItem/QStandardItem setData() functions Task-number: QTBUG-55903 Task-number: QTBUG-63766 Change-Id: I4da9346ef8401cc8633dc4b2ea7d00451d1e3942 Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Correct QStandardItemModel::setItemData to follow QAbstractItemModelSamuel Gaist2017-10-172-10/+94
| | | | | | | | | | | | | | | | | QStandardItemModel::setItemData replaces the content of an item data with the new values rather than updating/inserting which is the behavior for QAbstractItemModel. This patch aims to unify the behavior. [ChangeLog][QtWidgets][QStandardItemModel] Fixed setItemData() incorrectly deleting unmodified data. That behavior is not following QAbstractItemModel's documented behavior which is no modification of data not provided in parameter. Task-number: QTBUG-45114 Task-number: QTBUG-10872 Change-Id: I2be40cee372b68d9f71c976548ecda6dc3011241 Reviewed-by: David Faure <david.faure@kdab.com>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-3/+3
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-22/+22
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix QStandardItem::setChild crash when passing a null pointerJesus Fernandez2017-07-271-2/+13
| | | | | | | | | | | | Passing a null pointer as a parameter to the setChild function no longer crashes when calling the QStandardItemModelPrivate::itemChanged signal. The child is removed from the model. The patch also fixes the behavior of deleting a item. A dataChanged signal is emitted. Change-Id: I027e8b0d84fe33c5fca056df870f0e60a020824b Reviewed-by: David Faure <david.faure@kdab.com>