summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
Commit message (Collapse)AuthorAgeFilesLines
* QtBase: combine adjacent qDebug()/qCritical() linesMarc Mutz2015-11-281-8/+4
| | | | | | | | | For qDebug() and qWarning(), this is just an optimization. For qCritical(), which can be fatal, the old code was just wrong. Change-Id: I6d8ab1d7531d766cd41b49569dc0fd4420ecab8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-4/+0
| | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: added specs to setHorizontalHeaderItem()Nico Vertriest2015-11-161-0/+2
| | | | | | | | Added that adding an item deletes an existing one Task-number: QTBUG-42105 Change-Id: Ibcf08e6e2bf9c9239e7eca5aa48f2f30c8417fec Reviewed-by: Martin Smith <martin.smith@digia.com>
* Item Views: Avoid reentrant call in updateEditorGeometries()Gabriel de Dietrich2015-10-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This may result in incrementing an invalid iterator after the iterator's container has changed. Also, for this to happen, the view needs to have an active editor. The reentrant call happens as follows in QTreeView, after the model adds new rows to the view: QTreeView::rowsInserted() QAbstractItemView::rowsInserted() QAbstractItemView::updateEditorGeometries() QTreeView::visualRect() QAbstractItemViewPrivate::executePostedLayout() QTreeView::doItemsLayout() QAbstractItemView::doItemsLayout() QTreeView::updateGeometries() QAbstractItemView::updateGeometries() QAbstractItemView::updateEditorGeometries() Other concrete item view classes may be prone to the same issue. The fix consists in relayouting the items if needed, which should trigger calling updateEditorGeometries() again. This doesn't invalidate previous optimizations regarding item relayouting since we only force relayouting when it'll be done by visualRect(). Change-Id: Id31507fdc8d9a84d50265298191d690d1a06792b Task-number: QTBUG-48968 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtWidgets: use printf-style qWarning/qDebug where possible (I)Marc Mutz2015-10-272-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "..."; with qWarning("..."); Change-Id: I1f6869b024103c98262f1deae014e0d7337a541c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QAbstractItemView::sizeHintForRow()/Column: Check for null delegate.Friedemann Kleint2015-10-191-4/+4
| | | | | | | | The delegate may be null in QHeaderView. Task-number: QTBUG-48543 Change-Id: I4d3ba104b0b57431e8765271dc2dc880be096672 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-131-4/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qabstractsocket.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp src/sql/drivers/mysql/qsql_mysql.cpp Change-Id: Ifb73623d09f53340ee5e10283f1f86b580998902
| * QListView: Use correct available size when calculating scrollbars.Christoph Schleifenbaum2015-10-121-4/+2
| | | | | | | | | | | | | | | | | | | | Calculation was working as long as one didn't use per pixel scrolling. Task-number: QTBUG-48579 Change-Id: Ie02e28b008c5c81ed45d7dd17fed96148c23b598 Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | | | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QTreeWidget: Fixed reverse order of first level items in Drag and DropLibor Tomsik2015-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | The list with taken indexes (selected items) was created in reverse order but then retrieved from beginning. This was causing unexpected rotation of the moved items. Task-number: QTBUG-45320 Change-Id: I858d9af7b838bbd2618442c176dac0648b3512c4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix selected items after sorting in QTableWidgetLibor Tomsik2015-10-071-5/+7
| | | | | | | | | | | | | | | | | | | | OldPersistentIndexes store selected items during sort operation. They were wrongly taken from static list of indexes. This change takes them from parent (QTableWidget) who maintains the list of selected segments. Task-number: QTBUG-48408 Change-Id: Ie1bc4071a275dd76d113d883ab30ccd4cb1fa625 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Clean up cancel operation handling on OS XTor Arne Vestbø2015-09-271-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for handling cancel operations was spread out through the code base and sometimes hard-coded to only include the Escape key shortcut, missing the Command+. shortcut. We now intercept both attempts at cancel operations from the system through cancelOperation, which we forward as normal key events. A new QKeySequence::StandardKey has been added for the Cancel sequence, which maps to Escape on all platforms, and Command+. in addition for OS X. The hard-coded logic in QWidget and subclasses for dealing with closing the dialogs has been replaced with this key sequence, which allows clients to override the behavior. Note that the widget code is not wrapped in checks for QT_NO_SHORTCUT, as we don't care about keeping widgets building and working under that define. The logic in QCocoaWindow to bypass windowShouldClose when delivering IM events has been removed as we now handle that specific case by also forwarding Escape as a cancel operation. Task-number: QTBUG-47557 Task-number: QTBUG-45771 Task-number: QTBUG-44076 Change-Id: Ibe0b3a4819f8659d246a2142dd7d9cd3a826ef78 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-08-261-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
| * QTreeView: add size hint handling information to uniformRowHeightsSamuel Gaist2015-08-061-0/+3
| | | | | | | | | | | | Task-number: QTBUG-10802 Change-Id: I6aa60d8fd7678f02003a229e191a5ab4f93c4b9d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | QDirModel: remove pointless user-defined QDirNode destructorMarc Mutz2015-07-201-1/+0
| | | | | | | | | | | | | | | | | | | | The clearing of 'children' is already performed by the 'children' destructor, and the presence of the user-defined QDirNode destructor inhibits the move special member functions for QDirNode. Change-Id: Ie8025e7a2c4b1a8c0b691deda0e49b517f8a6ed5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QtWidgets: mark some private types movable or primitiveMarc Mutz2015-07-133-0/+4
| | | | | | | | | | | | | | | | They are held in Qt containers or QVariant. Change-Id: Ida1b904120d4fb53a5596f1c3cbc973bd2ca315e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | widgets: add missing qheaderview_p.h to itemviews.priMarc Mutz2015-07-131-0/+1
| | | | | | | | | | Change-Id: I35ddca35ba7b3ef4f6587b6d4db6a58a60576e6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QAbstractItemView: don't hold QItemViewPaintPair in a QListMarc Mutz2015-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QItemViewPaintPair is larger than a void*, so holding it in QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by holding in a QVector instead (was already marked movable as a QPair of movable types). Change-Id: I6f4042d2df306ecf0ec576ecbc6678736268014e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix some qdoc-warnings.Friedemann Kleint2015-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/io/qdatastream.cpp:501: warning: Undocumented enum item 'Qt_5_6' in QDataStream::Version qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp:1764: warning: Undocumented parameter 'model' in QItemSelectionModel::setModel() qtbase/src/corelib/statemachine/qabstractstate.cpp:216: warning: Undocumented parameter 'active' in QAbstractState::activeChanged() qtbase/src/corelib/statemachine/qstatemachine.cpp:3262: warning: Undocumented parameter 'running' in QStateMachine::runningChanged() qtbase/src/corelib/tools/qchar.cpp:160: warning: Undocumented enum item 'Unicode_7_0' in QChar::UnicodeVersion qtbase/src/gui/image/qimagereader.cpp:1168: warning: Undocumented parameter 'enabled' in QImageReader::setAutoTransform() qtbase/src/gui/image/qimagewriter.cpp:621: warning: Undocumented parameter 'transform' in QImageWriter::setTransformation() qtbase/src/gui/itemmodels/qstandarditemmodel.cpp:1268: warning: Undocumented parameter 'tristate' in QStandardItem::setAutoTristate() qtbase/src/gui/kernel/qscreen.cpp:590: warning: Undocumented parameter 'orientation' in QScreen::orientationChanged() qtbase/src/gui/kernel/qscreen.cpp:599: warning: Undocumented parameter 'orientation' in QScreen::primaryOrientationChanged() qtbase/src/gui/text/qtextdocument.cpp:1455: warning: No such parameter 'from' in QTextDocument::find() qtbase/src/gui/text/qtextdocument.cpp:533: warning: Undocumented parameter 'option' in QTextDocument::setDefaultTextOption() qtbase/src/widgets/itemviews/qtableview.cpp:2546: warning: Undocumented parameter 'enable' in QTableView::setSortingEnabled() qtbase/src/widgets/statemachine/qkeyeventtransition.cpp:119: warning: Undocumented parameter 'key' in QKeyEventTransition::setKey() qtbase/src/widgets/widgets/qplaintextedit.cpp:1610: warning: Can't link to 'toText()' qtbase/src/opengl/qgl.cpp:4371: warning: No documentation for 'QGLWidget::event()' Remove the documentation as they are properties: qtbase/src/widgets/widgets/qfontcombobox.cpp:407: warning: Undocumented parameter 'font' in QFontComboBox::setCurrentFont() qtbase/src/widgets/widgets/qfontcombobox.cpp:403: warning: Undocumented parameter 'script' in QFontComboBox::setWritingSystem() Change-Id: If599a3ce747bbb8a3418dd973810923b87246371 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* | Bring back OS X key handling.Morten Johan Sørvig2015-07-081-2/+2
| | | | | | | | | | Change-Id: I15c8972d09db18f47d17cddb65dda5d1b829e54e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | QtWidgets: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-0614-31/+31
| | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: Ie67d235151ca8d4ef5e721c9cf4a6fd32bd167a0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-012-8/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * QFileIconEngine: Remove reference to QFileIconProviderGabriel de Dietrich2015-06-301-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keeping the reference may end up in a crash if a created QIcon outlives the QFileIconProvider and we then try to generate a pixmap. The reference is not necessary since the options are queried only when creating the icon, so they can be saved in the icon provider. Task-number: QTBUG-46755 Change-Id: I5c60887c2ed39030a2a20298ff10fd652189e4e7 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| * Replace MAC OS X with OS XNico Vertriest2015-06-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * QHeaderView - fix a logical / visual index mismatchThorbjørn Martsum2015-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | f9408317e70bc2e635a2f9baeff35d1c06227734 was unfortunately approved though it had an annoying bug. The patch had an assign of a visual index into a logical index. This patch fixes that issue. Change-Id: I9cc75e4e9701858c92e2c3e5817415041b42f8e8 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Use QVector::reserve() all over the place.Sérgio Martins2015-06-291-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Reduces internal memory fragmentation. The search criteria was: QVector::append(), QVector::push_back(), QVector::operator<<() and QVector::operator+=() calls inside for, do and while loops. Statements inside ifs and out of loops weren't considered. Change-Id: Ie5aaf3cdfac938994e6e5dfa5f51de501ed79a0c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QDataWidgetMapper: use QList::reverse_iteratorMarc Mutz2015-06-281-1/+1
| | | | | | | | | | | | | | ... now that it's available. Change-Id: I85f547b294688c97288aaeab2af213c59e856a2b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | widgets: Use QList::reserve(), reduces reallocations.Sérgio Martins2015-06-233-3/+13
| | | | | | | | | | Change-Id: I49cc03f365c77f142f62c8e77505ec09723a44d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QAbstractItemView: convert some assignments into RVO'ed initializationsMarc Mutz2015-06-201-4/+2
| | | | | | | | | | Change-Id: If4b612460166675e91906a49e03de8ad4c50739f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | itemsviews: Add 15 QList::reserve() callsSérgio Martins2015-06-085-11/+37
| | | | | | | | | | | | Change-Id: I4ed8872ecd560d51c00cb3d2b93e082c5abdd8dc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-035-12/+53
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * Improve QHeaderView::sectionsInserted performanceIvan Komissarov2015-05-281-7/+7
| | | | | | | | | | | | | | | | | | Old implementation had complexity O(oldSectionCount); replace it with O(hiddenSectionCount) algorithm. This boosts performance in case of the vertical headers for models with big row count. Change-Id: I7bb02f5579ce83fbdecf5f8c3aa7dcc0ac60dd40 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix crash due to QTreeView accessing deleted model indexes.Joerg Bornemann2015-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | QTreeViewPrivate::updateScrollBars depends on a correctly set up viewItems vector. If a delayed layout is pending, we must call QTreeViewPrivate::executePostedLayout before accessing any stored model indices. Task-number: QTBUG-45697 Change-Id: I55fcbaf81f225b26181c2cf739283740b85dd16a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Improve QListView scroll bar calculation.Christoph Schleifenbaum2015-05-101-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | When both scroll bar's policies are set to ScrollBarAsNeeded, make sure the scroll bars are shown if needed and not show if not. Even the corner case, where one scroll bar's visibility depends on the other, is handled properly. Task-number: QTBUG-45470 Change-Id: I11d6ccf7c0b51644a5ce2d5c3fc59e2e4812755d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
| * Merge remote-tracking branch 'origin/5.4' into merge5.5Allan Sandfeld Jensen2015-05-081-1/+13
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/io/qnoncontiguousbytedevice_p.h src/gui/image/qjpeghandler.cpp src/network/access/qhttpthreaddelegate_p.h tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp tests/auto/widgets/widgets/qmenubar/BLACKLIST Change-Id: I01de8c1c28efcedfd7953d05025f54802dc08ab3
| | * ItemViews: Fix acceptance of drag enter eventsChristoph Schleifenbaum2015-05-011-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always accept drag enter events if the mime type and the drop actions matches. Whether the drop can actually happen on the currently hovered index will be decided in the following drag move event. Change-Id: I27e865cb65513dfe3f57ad3f1bc8cebf4c29a692 Task-number: QTBUG-45037 Reviewed-by: David Faure <david.faure@kdab.com>
| * | QColumnView: re-enable scrolling of the preview widgetGiuseppe D'Angelo2015-05-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, each column in a QColumnView is a QAbstractItemView, *including* the preview widget's column. Unfortunately, the preview widget's column class was not overriding scrollContentsBy, so scrolling it had no effect. A more comprehensive solution would be a major refactoring of the code to make that column a plain Q(Abstract)ScrollArea, as it doesn't need QAIV's APIs at all, but I don't want to change code and risk breaking behavior. Change-Id: Ice500a8eaef13c295df4cc274b9f80d9a24c65f4 Task-number: QTBUG-11392 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | Allow horizontal scrolling with a mouse wheel for QListViewAlexander Volkov2015-05-262-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert vertical wheel events to horizontal for two cases of the items layout when vertical scrolling is impossible: 1) TopToBottom flow with wrapping 2) LeftToRight flow without wrapping Do it only for pure vertical events to avoid a mess for such devices as touchpads or Apple Mouse. [ChangeLog][QtWidgets][Important Behavior Changes] Allow horizontal scrolling with a vertical mouse wheel for QListView. Task-number: QTBUG-37007 Change-Id: Ie2525153fa7b443d27ca08cc5f5d4d7ecdb8c183 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | QMouseEvent: add constructor which takes the source as a parameterAlexander Volkov2015-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the code by passing the source of a mouse event directly to the constructor instead of setting it by QGuiApplicationPrivate::setMouseEventSource(). Change-Id: I1774cf39a211d36d3adf0ff30f3bd2fb7c5fb429 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Deprecate ItemIsTristate in favor of ItemIsAutoTristate.David Faure2015-05-071-4/+4
|/ / | | | | | | | | | | | | | | | | | | | | This makes the behavior much more clear. You can get a tristate checkbox just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed. The flag, on the other hand, enables the automatic-tristate behavior in QTreeViews (and only there), hence the new name for it. Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | Fix QTreeView ending up in wrong state when dragKatja Marttila2015-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | Changed state in MouseRelease so that QTreeView does not end up in wrong state if drag is started but not completed. Task-number: QTBUG-44773 Change-Id: I0b665d2944f2b696bc4b7e79689d110aefa3f194 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | Fix problems with extended selection after changing the model contentsFrank Reininghaus2015-03-222-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Storing the position of the first selected item in the view can lead to wrong extended selections if the contents of the model change. Future Shift-clicks will always use the previous position of the first selected item, which may not be correct any more, to calculate the current selection. To fix this problem, a QPersistentModelIndex is used to keep track of the first selected item. A new unit test is added. Moreover, one function of the QTableView unit test is changed such that it shows the view prior to performing the test. Without this change, this test may fail. That the test, which simulates mouse presses without showing the view, worked at all seems to be a coincidence, as pointed out in QTBUG-18009. Task-number: QTBUG-18009 Change-Id: I0d844fbd1a994c279a7c8ee5d9b5b9fccecd25bf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QFileIconEngine: Use closest area when resolving the actual sizeGabriel de Dietrich2015-03-141-5/+19
| | | | | | | | | | | | | | | | | | This is similar to what QPixmapIconEngine does. Change-Id: I00b9e4083fa03fa0602b8e363055a612791bd149 Task-number: QTBUG-44981 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Don't use QFileIconEngine if the platform theme won't support itGabriel de Dietrich2015-03-141-0/+11
| | | | | | | | | | | | | | Change-Id: I6ccbfc5e8bc25018231a6924be12d74955e12337 Task-number: QTBUG-44981 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Use own QIconEngine in QFileIconProviderGabriel de Dietrich2015-03-112-49/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to lazily load icons from the platform theme by reimplementing the pixmap(). Otherwise, we would instantiate pixmaps in several sizes even though we would not need them right away. Since, at least on OS X, icon sizes can go up to 128x128 pixels, we can end up saving an order of magnitude of memory on icon pixmaps alone if we only use the smallest sizes in our application. Two side modifications are included. The first allows sub- classing QPixmapIconEngine by exporting this class. The second fixes the q_ptr in QFileIconProviderPrivate which was never set. Change-Id: I91af322ded2823e475703871e607773177ae25d3 Task-number: QTBUG-41796 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-136-0/+24
| | | | | | | | | | | | | | | | | | | | | | Instead of leaving a note for Qt6 and then forget to do the actual change once again, change APIs now inside QT_VERSION >= QT_VERSION_CHECK(6,0,0) blocks. Change-Id: Ifa769904e304358a9c2accfd6c9f86eeb342f9dc Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Long live QString::asprintf()!Marc Mutz2015-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asprintf() is a GNU extension that prints into a string it allocates internally. Arguably, that's a better name for QString::sprintf() since it also allocates memory internally. The main problem with QString::sprintf() isn't that it's dangerous to use (it is), but that it's not static. It also returns a reference instead of by-value, breaking RVO. There is a comment about removing this function completely in Qt 6.0, but it remains the only printf-style function in Qt that can allocate the target string, so it's vital for logging, e.g., and the recommended replacement code (http://linux.die.net/man/3/vsnprintf) is a nightmare. So this patch adds static (v)asprintf() methods to replace it. Further patches will fix up all in-tree callers and finally deprecate the old (v)sprintf(). Test coverage is provided through the existing tests of sprintf(), which is implemented in terms of asprintf(). Arguably, the in-tree callers show that QByteArray would benefit from having an asprintf(), too, as most of the in-tree code works around its lack with calls to to{Latin1,Local8Bit}() after using the QString version. [ChangeLog][QtCore][QString] Added asprintf(), vasprintf(). Change-Id: I8510f8d67c22230653ec0f1c252c01bc95f3c386 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update copyright headersJani Heikkinen2015-02-1152-364/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-105-8/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Don't crash with invalid QModelIndex or when QTreeWidgetItem is NULL in ↵Maks Naumov2015-02-061-1/+11
| | | | | | | | | | | | | | mimeData() Change-Id: I0a9abaa05cf136eadf222d3e7d102930719b84ff Reviewed-by: David Faure <david.faure@kdab.com>