summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-212-4/+8
|\ | | | | | | Change-Id: I35a6555e3885e489f88aa9b4b0142e1017f7a959
| * Modernize the "regularexpression" featureUlf Hermann2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * widgets: Add a QT_CONFIG(style_stylesheet) guardMikhail Svetkin2018-03-201-3/+7
| | | | | | | | | | | | | | for isWindowsStyle in QDockWidget Change-Id: Id471b91a415f1a677ced6022bdd05b7e1b72aad2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QCommonStyle: Add title bar and tool bar extension iconsFriedemann Kleint2018-03-1726-5/+61
| | | | | | | | | | | | | | | | | | | | Add larger pixmaps for the title bar and tool bar extension icons. Task-number: QTBUG-38776 Change-Id: If2514f7aa66fa46d25133165ca45318a5045d387 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Rename toolbar icons used by QMacStyle to contain "macstyle"Friedemann Kleint2018-03-173-2/+2
| | | | | | | | | | | | | | | | | | Make way for adding equivalent icons to QCommonStyle. Task-number: QTBUG-38776 Change-Id: Idcaee880dcd8727565ddf8cdb5ac5685670f9716 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-172-4/+11
|\| | | | | | | Change-Id: Id3e318f276fc56b5105561a1904cc242b663e9e4
| * QMenu: Realign submenu first action with its parent menu actionGabriel de Dietrich2018-03-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | There was an offset equivalent to all the margins we add to the action rectangles. We need to subtract it in order for both menu items, parent and sub-menu, to be aligned. This amount is given by the sub-menu's first action position relative to its popup. Change-Id: I141bbe3cfb81825a25b12e4059b93e61c29df518 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QFusionStyle: Fix compilation when qreal is floatAlexander Akulich2018-03-151-4/+4
| | | | | | | | | | | | Change-Id: I575d348915a7239a40b589012b4e9707bd15d1dd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-155-14/+15
|\| | | | | | | Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
| * Revert "Set sharedPainter correctly for QGraphicsEffect"Laszlo Agocs2018-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7257862fb2edfab0219d6cd45c83677049404f7d. It has been reported that this patch causes widgets with certain effects become invisible. Task-number: QTBUG-60231 Task-number: QTBUG-66803 Task-number: QTBUG-66387 Change-Id: I9c3c4cf2f17ac639d1aee5489b665aa1e165af16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Item views: Fix 5.11 API review findingsFriedemann Kleint2018-03-142-11/+10
| | | | | | | | | | | | | | | | | | Rename getter QHeaderView::firstSectionMovable() to QHeaderView::isFirstSectionMovable(), turn into a property and fix \since. Change-Id: Ica2ca43d22f3fd78ff63178ba75014807fc9b823 Reviewed-by: David Faure <david.faure@kdab.com>
| * widgets: Add a QT_CONFIG(messagebox) guardMikhail Svetkin2018-03-131-1/+3
| | | | | | | | | | | | | | for initResources in QApplication Change-Id: Id083edbcba4b348ef78e55c788ea94f85b6f572b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Doc: Add doc to Graphics View Flow Layout exampleNico Vertriest2018-03-131-0/+0
| | | | | | | | | | Change-Id: Id3965d099222607cee4252bbb33c6a1e9c17765a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-121-1/+1
|\| | | | | | | Change-Id: Ic193ccc3e9e3a86e15a002d599c13f35940e1eab
| * Fix ambiguous shortcut warning messageSergio Martins2018-03-111-1/+1
| | | | | | | | | | | | | | This is done in QAction::event(), not eventFilter(). Change-Id: Idc5d7864d259dcf035543c40c8e7b6acd86bde9b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-103-1/+22
|\| | | | | | | Change-Id: Ia2441257c23169f8ca6a3933b2371255e1ba64e6
| * Fix QLabel crash if buddy's lifetime is too shortSergio Martins2018-03-083-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If buddy is deleted then QLabel will still try to deliver the shortcut event to it, in QLabel::event(), and cras. Besides connecting to destroyed() which alone fixes the crash, also hardened it and guarded against dereferencing null buddy, in the unlikely event of someone adding features to QLabel. The second part is suitable for backporting to the LTS branches. Task-Id: QTBUG-66841 Change-Id: Ib6a36a9f99cee31afe1f88eb77f5b6cafb8b1086 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Make QToolTip always wrap textFilipe Azevedo2018-03-091-14/+24
| | | | | | | | | | | | | | | | | | This fix issues where long plain text where not wrapping and being unreadable. Change-Id: I64d4ce94f7460d00d1722647893bd8f70e5ea8d6 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QTreeView: speedup isFirstColumnSpanned/setFirstColumnSpannedChristian Ehrlicher2018-03-082-17/+8
| | | | | | | | | | | | | | | | | | | | | | Change container of spanningIndexes from QVector to QSet to speedup the isFirstColumnSpanned/setFirstColumnSpanned. The order of the indexes in the container is not needed and therefore QSet can be used here. This also simplifies the code a little bit. Task-number: QTBUG-66714 Change-Id: I1692ca1df751b2b8d26b607faf60ff2b94f6f964 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QItemDelegate: fix text height calculationChristian Ehrlicher2018-03-081-15/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QItemDelegate::textRectangle did not adjust the width when the item had a decoration or a checkbox. This lead to a too big width used for the layouting and therefore sometimes the calculated height was too small. This was already done for QCommonStylePrivate::viewItemSize which is used by QStyledItemDelegate before. [ChangeLog][QtWidgets][QItemDelegate] fix text height calculation when the item has a decoration or checkbox Task-number: QTBUG-16134 Change-Id: I14c47c3f2d8cc0a0b6ec2b2999e70fda213887ae Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-082-13/+29
|\| | | | | | | Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
| * QTabWidget: Do not add tabbar size during sizeHint() when it is hiddenChristian Ehrlicher2018-03-071-12/+24
| | | | | | | | | | | | | | | | | | | | | | Since Qt 5.4 the QTabBar can be automatically hidden when it has less then 2 tabs. Therefore the sizeHint should not consider the tabbars size when the tabbar is hidden. Task-number: QTBUG-64715 Change-Id: I2f248f88d9070de5354f7344c7628a78442ab499 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QHeaderView: fix inconsistent saved state, ignored during restoreDavid Faure2018-03-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that updates a section size must also update length, otherwise saveState can end up saving inconsistent state, and restoreState() goes to an early-return, not doing anything. The actual bug was fixed meanwhile because _q_sectionsChanged is called again, which recalculates length. I still see this only as a safety measure, every other code path that changes section sizes updates length right away. Change-Id: I6cc16261692d93b3640afafef600a5bdff8dca0c Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | QUndoStack: add more Q_PROPERTYsMitch Curtis2018-03-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step in being able to use the undo framework in QML. The next step would be to separate it out of Qt Widgets so that a pure Qt Quick application doesn't need to rely on it. Note that QUndoCommand is not a QObject, so we cannot expose its text member as a property until Qt 6. [ChangeLog][QUndoStack] Exposed canUndo, canRedo, undoText, redoText and clean as Q_PROPERTYs. Task-number: QTBUG-40040 Change-Id: Ida7ec03f871f0db7fdcc5b90ed200024c5cb348e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | qlineedit: Use QIcon::Active for pressed action buttonKai Uwe Broulik2018-03-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt should be using its own API in the way it's meant to be. If there's an issue with Qt's built-in styles it has to be fixed there. Otherwise this causes problems with styles, such as KDE's Breeze, which make use of both Selected and Active states for icons. However, Qt's built-in styles do not have hover effects for tool bar buttons and menu items, so there's somewhat of a conflict here which was probably the reason for the workaround used. Change-Id: Ieaed580f548caf181b1005b4e82e3f2adc1f9ce5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QAbstractSpinBox: respond to QEvent::LocaleChangeSven Pauli2018-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | Add a branch for QEvent::LocaleChange to the QAbstractSpinBox::event() handler to call updateEdit(). This will update the edit in case the locale's number features changed (decimal separator etc.). Task-number: QTBUG-65315 Change-Id: I9015b3a5bbe8e7b80f7bafa13f0f431507bc4cf7 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-053-53/+92
|\| | | | | | | Change-Id: Ifce6ddeb4dab8c672732ec6aa6c19a6c4bce447e
| * QHeaderView: make use of LayoutChangeHint in _q_sectionsChanged()Christian Ehrlicher2018-03-043-22/+61
| | | | | | | | | | | | | | | | | | When _q_sectionsChanged() is called from e.g. QSortFilterProxyModel the LayoutChangeHint is set which can be used to avoid useless work in this function. Change-Id: I034db3fcc7a5f9ea7ebc0fa3ffd7429edb154eb7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QHeaderView: fix indentation in setModel() and clear()Christian Ehrlicher2018-03-031-37/+37
| | | | | | | | | | | | | | | | | | The indentation of large code blocks in setModel() and clear() are not correct. Needed for another change to avoid whitespace changeds in there. Change-Id: I620c8c5e83e98747f5c17469738722cf976fb467 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | QTableView: Fix drawing grid for spanned cellsChristian Ehrlicher2018-03-041-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTableView draws its gridlines at width/height of the cells. This means that there is no gridline at x=0 and/or y=0. This is fine when there is a header. But when the header is invisible, an additional line at 0 must be drawn to have a boundary to the neighbor widget. When a span is drawn, the clip rect has to be adjusted in this case because x/y=0 belongs to the cell (and therefore would be clipped out). Also fix the drawing of the grid lines in RTL mode and with ScrollPerPixel. Task-number: QTBUG-22972 Change-Id: I1829770e3d5bf65421b590f7bb7354cbf222e3fb Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Qt Forward Merge Bot2018-03-022-4/+16
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-022-4/+16
| |\| | | | | | | | | | Change-Id: I42ec9e6aafc203465cbeb88af70c7af26b7df8ed
| | * ToolTip/Windows: Fix wrong size when font is modified by widget stylesheetFriedemann Kleint2018-03-011-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out a function to calculate the size and update the size when a style sheet parent is set. Task-number: QTBUG-64550 Change-Id: I3afe997085eae3cd48b7fe0a4c98582a8f572260 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| | * QHeaderView: Fix crash in layout about to changeThorbjørn Lund Martsum2018-03-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before there was a risk looking up e.g index -1 if there were no visible sections in layoutAboutToChange. Change-Id: Ic911e4292e8e8c4892fef1c0f34cf7dccaad2bac Task-number: QTBUG-65478 Reviewed-by: David Faure <david.faure@kdab.com>
| | * QHeaderView: skip dividing by 1, rather pointlessDavid Faure2018-02-281-1/+1
| | | | | | | | | | | | | | | Change-Id: I9a63810475d1f17d65e91c1f4d805a7e564ba686 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | | Show the checkmark when rendering a QAction in a QMenu using QSSSteve Mokris2018-03-011-7/+30
|/ / | | | | | | | | | | Task-number: QTBUG-66380 Change-Id: If7376430cfa021cb6eca1cbbcea6b6d0e01802bf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | When cloning QWheelEvent, also propagate the event's timestampSteve Mokris2018-03-012-0/+3
| | | | | | | | | | | | Task-number: QTBUG-63681 Change-Id: I686ea831287ac9023a3364768b6345c1e8806439 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | stylesheets cleanup to prepare for a bigger patchSergio Martins2018-02-288-72/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No behavior was changed, just cleanup so the upcoming feature can land safely, with an elegant diff. - Removed all naked qobject_casts<QStyleSheetStyle*>(), replaced them with qt_styleSheet() (which does the same, for now). - Removed a bunch of #ifdefed'out "metal hack" code. The code is disabled and enough time has passed without nobody needing it. - Removed a few "extra ? extra->style" by assigning it to a variable first. - Misc Change-Id: Ia45c38b06e2b5d2426635f730b4cb42c7ac1251d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-222-4/+32
|\| | | | | | | Change-Id: Iec636692e8b7d1fe1bc0476e49c5054a5892d639
| * QHeaderView: Preserve settings on layoutChange with empty modelChristian Ehrlicher2018-02-211-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not clear the settings of QHeaderView during layoutChange when the model is empty and the section count did not change. This will not work when a section is moved or a section is replaced with a new one during layoutChange. But since layoutChanged is also called on sorting, this patch ensures that the settings are not cleared in this case. This restores the behavior to the same as before 5.9.4. Task-number: QTBUG-66444 Task-number: QTBUG-65478 Change-Id: I39989cfd45b42e58f49d18ec014d3a941cadb6c9 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| * QHeaderView: properly restore hidden section size on layoutChanged()Christian Ehrlicher2018-02-211-3/+7
| | | | | | | | | | | | | | | | | | | | | | During (re)storing the sections within layoutChanged handling, the hidden section size was not properly stored which lead to a section size of 0 when the section was unhided afterwards. Task-number: QTBUG-66413 Task-number: QTBUG-65478 Change-Id: I0b714c7e0530a1eae82b3bb0e0dc80ed576522d0 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| * Bump copyright yearJani Heikkinen2018-02-211-1/+1
| | | | | | | | | | | | Task-number: QTBUG-65810 Change-Id: Ib6f87a126f64c2e4b2e924b97af4c2b2d10dd29e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-213-17/+35
|\| | | | | | | Change-Id: I9c90d71fde002544fd97df7e8a2690953cf9f817
| * Fix touch point positions of non-transformable QGraphicsItemsFriedemann Kleint2018-02-203-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TouchEvent::TouchPoint::pos was not updated in QGraphicsScenePrivate::updateTouchPointsForItem(). To prevent the transformation being calculated repeatedly for each touch point member, extract a function genericMapFromSceneTransform() from genericMapFromScene() returning the transformation and use that whereever multiple points are transformed. Add a test, extracting helper functionality from tst_QGraphicsItem::touchEventPropagation(). In addition, fold tst_QGraphicsScene::checkTouchPointsEllipseDiameters() from c48f4bde0044bd5b23af231f3639d0779ecbdb03 into this test, so that it is testing all transformations. Task-number: QTBUG-66192 Change-Id: If71886d2c14c4e216f7781ea2f22f1adc444e6cf Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTreeView: Remove unused variableRobert Loehning2018-02-201-1/+0
| | | | | | | | | | | | Change-Id: I1efab0cf5554485de8d14f803b165223784c313b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Use QT_CONFIG(stringlistmodel) rather than QT_NO_STRINGLISTMODELUlf Hermann2018-02-192-3/+3
| | | | | | | | | | Change-Id: Iac5b2cb63d05f1746ca1bf9eba07562d76aa7ba3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Use QT_CONFIG(proxymodel) instead of QT_NO_PROXYMODELUlf Hermann2018-02-193-14/+14
| | | | | | | | | | Change-Id: Ie01a118b2aa11fcbeaf073ee2d28ceaeffc8a6ad Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-181-0/+2
|\| | | | | | | Change-Id: I95d8a4ba3d8cedfdda63b99127abb7c57a4265e6
| * Fix compilation with QT_DISABLE_DEPRECATED_BEFORE=0x060000Marcel Krems2018-02-161-0/+2
| | | | | | | | | | | | | | Regression introduced in b254b03dc3b1cfcfc5f17158d2470e0a9a946a0e Change-Id: I77e8718cc6be79d4fbea5510e8d7cc7808a609c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-1621-79/+158
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/tools.pri Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9