summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Widgets: Use accelerated scroll when scrolled widget is overlappedBłażej Szczygieł2018-04-173-23/+81
| | | | | | | | | | | | | | | | | | | Get region of overlapped widgets and scroll only non-overlapped parts of image. Next, schedule an update for overlapped widgets region. This patch improves scrolling performance when scrolled widget has overlapped widgets. Common use cases: - faster scrolling when using "StyleHint::SH_ScrollBar_Transient", - faster scrolling of zoomed image with semi-transparent thumbnail. Accelerated scrolling with overlapped widgets is not available when scale factor is non-integer. Task-number: QTBUG-64504 Change-Id: I8337d3bc756e50f7d31cdc7979ccf86dc5c3695f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QSplashScreen: honor alignment when message contains htmlChristian Ehrlicher2018-04-151-0/+6
| | | | | | | | | | When the message contained html, the alignment was not honored and the text was drawn topLeft instead. Use a similar algorithm like it is done in qt_format_text to move the text to the correct aligned position. Task-number: QTBUG-43081 Change-Id: I570efd0f3f339b26b102ac52983887197d7d63e2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* GraphicsView: use range-based for instead of foreachAnton Kudryavtsev2018-04-154-4/+4
| | | | | | Change-Id: I8e1b50bcbffdb492dc10662150b51b0eed1e228e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* ItemViews: use range-based for instead of foreachAnton Kudryavtsev2018-04-156-8/+8
| | | | | | Change-Id: I250b3e3db4d44a622a20ca42baac819a17efdd94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Widgets: use range-based for instead of foreachAnton Kudryavtsev2018-04-158-38/+47
| | | | | | Change-Id: Id9ec2db6cfa661ff9b3b6ace9ffaa071a2d57f94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLars Knoll2018-04-122-1/+21
|\ | | | | | | Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
| * dockwidgets: Resize the rubber-band when our drop target is resizedSergio Martins2018-04-122-1/+18
| | | | | | | | | | | | | | | | Bug can be seen on the .gif attached to QTBUG-67611, the floating group window resizes, but the rubber band still has the old size. Change-Id: I7232a39574ea06fe036c75c21e7496c0f32f4632 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix grouped dock widget from shifting down when createdSergio Martins2018-04-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Animated .git attached to the bug report for easy understanding. Looks like we shouldn't set window flags after a setGeometry() and before having the window resources. If we do that, then the requested geometry won't be honoured. No idea if it can be fixable in the QPA and won't risk doing it there. Fixes the problem on macOS and Windows. On Linux it was OK, and still is. Task-number: QTBUG-67611 Change-Id: I8244b4956a5ac9afcf257bea762c2c3084b563f8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix z-order when dragging a dock widget over anotherSergio Martins2018-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | the drop target would create a floating group window, which would have higher z-order since it just had show() called on it. raise the window we're dragging when the target is mutated into group window. Bug can be seen on the .gif attached to QTBUG-67611. Change-Id: I5dad058468e24327b14d1e7f76c3ad0287d26ee8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QSplitter: some cleanupAnton Kudryavtsev2018-04-111-7/+6
| | | | | | | | | | | | | | Use nullptr instead of 0 for pointers Change-Id: I048e48eb4701c08af9d05df69d6f8a261db015cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-112-4/+5
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I0fd0adeca1590fffddd577873172f6d987a60412
| * Fix crash if dock widget gets deleted while draggingSergio Martins2018-04-101-2/+3
| | | | | | | | | | | | | | | | | | By using a QPointer. Change-Id: I16832dadc9cd8cefc4f9f276b1242c0000097b95 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QSplitter::indexOf: fix documentationAnton Kudryavtsev2018-04-101-2/+2
| | | | | | | | | | Change-Id: I2943c076879cbf229f209743b3b5c1f5fcd78302 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QSplitter: micro optimizationAnton Kudryavtsev2018-04-101-3/+1
| | | | | | | | | | | | | | Use QStringBuilder to avoid needless allocation Change-Id: I483b7c4875539580234f4254e16a6cdb7737e7b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-063-7/+10
|\| | | | | | | Change-Id: Ic811cd444e523b904211797112bba6aaec85dddd
| * QTabBar: Repaint when releasing mouse on selected tabGabriel de Dietrich2018-04-051-1/+5
| | | | | | | | | | | | | | | | Some styles, most notably QMacStyle, require this to properly reflect the pressed state. Change-Id: Ie841d97afbe3cfdfde1254a7069876a1a0af2e52 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * Improve QAbstractSpinBox::stepBy() docsMitch Curtis2018-04-051-5/+4
| | | | | | | | | | Change-Id: I28e942b6b2952205641c751e4c120cb38ae13fd6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Fix memory corruption in heightForWidth cacheHarald Brinkmann2018-04-051-1/+1
| | | | | | | | | | | | | | | | Overflowing q_firstCachedHfw caused memory to be overwritten before q_cachedHfws. Change-Id: Ibbcc72380f426550cc0569a05c54cd1acd878b33 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Add missing documentation for QUndoStack propertiesMitch Curtis2018-04-051-0/+55
| | | | | | | | | | | | | | | | | | They were forgotten in 59e9c4956cfc5163c1fc411c6c567a4c753b4e9a. Task-number: QTBUG-67457 Change-Id: I58c576598d88d3dd1fa320628ad80689d3f8b8de Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-052-2/+2
|\| | | | | | | Change-Id: I954bd6418bc862a04691240c0f1766f6ce033640
| * Check if the movie's current pixmap is null before drawing itAndy Shaw2018-04-041-1/+1
| | | | | | | | | | Change-Id: I87ed9998108961775f8f424bfbb4b957c0b03d8a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QWidget: Fix typo in Mac size propagationGabriel de Dietrich2018-04-041-1/+1
| | | | | | | | | | | | | | This amends commit f8b6d104b981ef420756c0c20f62b8013d93ae15. Change-Id: I77a48e68ec7db791b843fe4dfeddc4c6fedf6380 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTabBar: properly clean up move animationChristian Ehrlicher2018-04-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | In TabBarAnimation::updateState() the wrong parameter was used to determine if the animation has stopped or not. This lead to a call to moveTabFinished() when the animation started and not when it was finished. Task-number: QTBUG-42951 Change-Id: I213c7f5e863a9a4e33bd472de93933efebf63fc7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QTextBrowser: do not try to open file with empty filenameChristian Ehrlicher2018-04-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | When loading a resource from a href link, the link is not necessarily a local filename. In this case QTextBrowserPrivate::findFile() returns an empty filename which will create a warning when trying to open it. Task-number: QTBUG-43270 Change-Id: I39803afe3db9da0bfe2aaab86a5ebb6ed4b7c732 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QCommonStyle: use proxy pixelMetric for SE_TabBarScrollLeft/RightButtonChristian Ehrlicher2018-03-301-4/+4
| | | | | | | | | | | | | | | | | | | | When calculating the subElementRect for SE_TabBarScrollLeft/RightButton and SE_ToolBarHandle, the frameRect() was not taken from the proxyStyle. Task-number: QTBUG-66933 Change-Id: I7ae78d7050a6500f39e4741345283e1bf590e9cb Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | QAbstractSpinBox: honor QAbstractSpinBox::NoButtons in sizeHint()Christian Ehrlicher2018-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | QCommonStyle::sizeFromContents() did not check if a spinbox has buttons or not and returned a to wide width when no buttons are displayed. Task-number: QTBUG-67126 Change-Id: I9f97a31a89a0986023316b02e11017e620c0f614 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | Add missing Q_ENUM to QAbstractSpinBox::StepTypeFriedemann Kleint2018-03-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix designer startup warning: QMetaProperty::read: Unable to handle unregistered datatype 'StepType' for property 'QSpinBox::stepType' QMetaProperty::read: Unable to handle unregistered datatype 'StepType' for property 'QDoubleSpinBox::stepType' Amends 97e40a5409dd4338084fe8df2397156dccc49d6d. Change-Id: If99d118fcda0f8420bb0c3424427ac4f2c48505e Reviewed-by: Harald Nordgren <haraldnordgren@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-03-282-2/+2
|\| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_mouse.mm src/testlib/testlib.pro Change-Id: Ia0ce4243418fe6a485b0f290c67bd433b3b04ff2
| * QTableWidget: fix spelling errorRichard Moe Gustavsen2018-03-231-1/+1
| | | | | | | | | | Change-Id: Ifd6f116a214d13328ccf0d070ef4517a3b53bf25 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
| * offscreen: Check that native interface is valid before using itAndy Shaw2018-03-211-1/+1
| | | | | | | | | | | | | | | | | | If the offscreen platform plugin is used on Windows then it can end up crashing since there is no native interface. This prevents a crash from occurring when these functions are called. Change-Id: I526fc0703771fa5f85b26d182ad3b15ef1a3ada5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Fix QML integration of widgetsLars Knoll2018-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | We need to mark the object as deleted before destroying it's declarative data, otherwise all sorts of bad things can happen. This fixes the qwidgetsinqml autotest in qtdeclarative. Change-Id: I05a645ebe1ca7a50c8927e3dbd9ebb5aaf369a71 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Doc: Fix description of QStyleOptionMenuItem::tabWidthAlexander Volkov2018-03-272-4/+6
| | | | | | | | | | | | | | | | It is actually not the tab width but the width reserved for the menu item's shortcut. Change-Id: I801dff0c57256690f61c022156a80cf6ff530c43 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Allow adaptive decimal stepping for QSpinBox and QDoubleSpinBoxHarald Nordgren2018-03-225-1/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the feature of adaptive decimal step sizes for the QSpinBox and QDoubleSpinBox. By performing a calculation in QAbstractSpinBox::stepBy() we continuously set the step size one power of ten below the current value. So when the value is 1100, the step is set to 100, so stepping up once increases it to 1200. For 1200 stepping up takes it to 1300. For negative values stepping down from -1100 goes to -1200. It also works for all decimal values. 0.041 is increased to 0.042 by stepping once, and so on. The step direction is taken into account to handle edges cases, so that stepping down from 100 takes the value to 99 instead of 90. Thus, a step up followed by a step down -- or vice versa -- lands on the starting value; 99 -> 100 -> 99. Setting this property effectively disregards singleStep, but preserves its value so that it takes effect again when adaptive decimal step is disabled. Adaptive decimal step allows values to be easily set to reasonable levels. If the spin box value is 12000, changing to 13000 often makes more sense than to 12001. The feature is turned off be default, when single stepping is desired. The accelerated property allows values to be changed quickly, as well, but it is imprecise. Holding down the button makes it hard to land on an even thousand, like 12000 or 13000. Often you end up somewhere nearby and would need a second adjustment to get to an even hundred or thousand. [ChangeLog][QtWidgets] Add option of adaptive decimal step size for QSpinBox and QDoubleSpinBox. Change-Id: I9f286479b821e240c8ea05c238932fc128c582bb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | 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>