summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QCalendarWidget: fix a bug when parsing date/time formatsMarc Mutz2014-09-231-0/+1
| | | | | | | | | | | | Quoting was not reset after consuming the quoted character. This bug only manifests when a format contains two quoted characters. It's not possible to write an auto-test for this, since the format is always read from the locale. Change-Id: I39aff41f20f647c285c971b4d560f9e36d4b82fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QCalendarWidget: move all helper classes into the unnamed namespaceMarc Mutz2014-09-231-0/+4
| | | | | | | Saves 1920 bytes of text size on AMD64 / GCC 4.7 release builds. Change-Id: Ib437d285ca0555eb7a3751b53226093b71b789e9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCalendarWidget: move QCalendarTextNavigator into qcalendarwidget.cppMarc Mutz2014-09-233-114/+41
| | | | | | | | This is in preparation of a change putting all these helper classes into the unnamed namespace. Change-Id: I553b1e23b6cdbe6daa492c2dc4c26406ac580de3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix spin box with fine grained wheel eventsAllan Sandfeld Jensen2014-09-232-2/+6
| | | | | | | | | | | Only step the value in the spin box when we have accumulated one wheel tick worth of wheel delta. Also fixes the obsolete contructors of QWheelEvent so they set the non obsolete properties. Change-Id: Ic6ea4b37afa8eec85a6ca7bdc0d919bf8fb02608 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix emission of QDesktopWidget::workAreaResized().Friedemann Kleint2014-09-223-3/+12
| | | | | | | | Connect to QScreen::availableGeometryChanged(). Task-number: QTBUG-32567 Change-Id: I2097d80faa83ae062f7e149122fba26d23432e95 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Correct information about all headers being movable.Mitch Curtis2014-09-221-3/+0
| | | | | | | | | This only applies to QTreeView. 8eb3d724a92b8eeb1e96362bd6997fcee178af89 introduced this error. Change-Id: Ia8a2c387afbd19e4d98ea6f81e5ce6409d79bcd9 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Remove unused variable in QStyleSheetStyle::hasStyleRule()Maks Naumov2014-09-221-1/+0
| | | | | Change-Id: I052fcc067ffbd1d470593d16af5f2189541c6264 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix crash in QCombobox when resetting model during currentIndexChanged()Alex Blasche2014-09-211-1/+1
| | | | | | Task-number: QTBUG-20415 Change-Id: Idffc0f29cc55d834c2736ce7562dd7cfe912d327 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Respect the PM_SmallIconSize setting for icons in a menu on OS XAndy Shaw2014-09-201-1/+10
| | | | | | | | | When a platform menu is used then it would hard code the icon size to 16x16. Instead of using the hard coded value then PM_SmallIconSize should be used instead. Change-Id: I27540ebc4397501e8f57686a118c28cd7167c0a1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* a11y: Make QAccessibleButton and friends resolve role dynamicallyTor Arne Vestbø2014-09-203-38/+49
| | | | | | | | | The role may changed based on the checkable state of the button, eg, so we need to resolve the role at runtime instead of hard-coding it in the constructor. Change-Id: I78faee08189c5510ca9964b07ad94bcf5d4fa11b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Keep a source of propagated mouse eventsAlexander Volkov2014-09-191-0/+1
| | | | | | | | | Synthesized mouse events should not cause mouse events which look like they were obtained from the system. So set the source of generated events from the original event. Change-Id: I862829446ac6ef664e1b8e4a5b54ed11926a1d4b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update widget winId when screen changesDyami Caliri2014-09-191-0/+6
| | | | | | | | | When a window's screen changes it may recreate the platform window. In that case, update the winId in the widget to keep it in sync. Task-number: QTBUG-40681 Change-Id: Iec815320214832bb63952de3a5bd1340a04dacd4 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QOpenGLWidget: Play nice with empty paintGLLaszlo Agocs2014-09-181-0/+1
| | | | | | | | | | | Applications that do not override paintGL() (may happen in some test code) will not perform any GL rendering, not even clearing. This is fine, but to be safe we need to do a clear right after creating the FBO in order to prevent showing garbage. Task-number: QTBUG-38327 Change-Id: If062901bb18724f961e41856085470e37b49abbe Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add a note about winId() to QOpenGLWidget docsLaszlo Agocs2014-09-181-0/+3
| | | | | | Task-number: QTBUG-40765 Change-Id: I0dbb010bb96c6b41c67392b8846782a354481e5e Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Propagate swap interval from QOpenGLWidget to the tlwLaszlo Agocs2014-09-181-1/+15
| | | | | | | | | | | Otherwise it is impossible to set a swap interval different than the one set by QSurfaceFormat::setDefaultFormat(). Both windows and xcb will pick up the updated interval from the window on the next frame. Change-Id: I55a59f83a62d3adcea687adf28639646b576ed58 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QCommonStyle: cache the xpm QPixmapsMarc Mutz2014-09-181-17/+28
| | | | | | | | | | | | | | | | | The QPixmap(const char* const*) ctor featured prominently in the callgrind trace of tst_qmdi*, with 23% of total time spent there in tst_qmdiarea before the change. Cache the results in the QPixmapCache. That's probably a good idea for all standardPixmap()s, but none other feature prominently in any of the widgets/widgets auto-tests, so there's no immediate need to do something about it. After the change, less than 3.5% of the total time is spent on parsing XPMs. Change-Id: Idfb6ffe0d0f7a4a1f71a7c26fc9ab0f42bdbd7a8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add missing period to QHeaderView documentation.Mitch Curtis2014-09-181-1/+1
| | | | | Change-Id: Ibf3fdb4e1c149b2dbee7bf3043cec9d3e167381d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Improve documentation regarding moving item view columns.Mitch Curtis2014-09-182-0/+7
| | | | | | | | | The only way I was able to find information on this was through bug reports. Change-Id: Iac59a82fab9c216495860ad3b1efad1125130002 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix saving handle width in QSplitter::saveState()Alexander Volkov2014-09-161-1/+1
| | | | | | | | | | | QSplitter::handleWidth() returns either a style dependent value if d->handleWidth is negative or the value of d->handleWidth itself. So to preserve this choice after calling saveState()/restoreState() we should save and restore the value of d->handleWidth rather than a result of handleWidth() which is non-negative. Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Allow overriding standardIcon() in a proxy styleAlexander Volkov2014-09-165-22/+22
| | | | | | | [ChangeLog][QtWidgets][Styles] Allow overriding standardIcon() in a proxy style Change-Id: I3c7983a7e51a8b220a0ca8ead2b4d7b87a77d71b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Respect Qt::FontRole for QComboBox items.Mitch Curtis2014-09-161-3/+8
| | | | | | Change-Id: I810ae2d77109a36b457f07e4a7b0489c954279e8 Task-number: QTBUG-41131 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Do not drop the context when sharing globallyLaszlo Agocs2014-09-151-0/+6
| | | | | | | | | There is no point in recreating the QOpenGLWidget's context when it shares with all top-levels' shareContext(). Change-Id: I659a8ef6563de0cc1e833198af4dfb8c705e40d8 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix drag and drop with createWindowContainerLaszlo Agocs2014-09-151-0/+11
| | | | | | | | | Forward dnd events to the QWindow, exactly like QQuickWidget would do. This of course requires setting setAcceptDrops(true) on the container widget. Task-number: QTBUG-39213 Change-Id: I8ea49e630b071dc0aacd53f798d9b46b03502365 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Make the default value of QTreeView::indentation() be style dependentAlexander Volkov2014-09-156-4/+41
| | | | | | | | | | | | | Add a new PM_TreeViewIndentaion enum value to QStyle and get the corresponding pixel metric in QTreeView. [ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default. [ChangeLog][QtWidgets][QTreeView] Added resetIndentation(). Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Adam Majer <adamm@zombino.com>
* Fix typos in Widgets Tutorial.Mitch Curtis2014-09-121-3/+3
| | | | | Change-Id: Id4a0bef3b00f3869582e76ee45f230120189a268 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Fixed broken links introduced by "OS X" doc change.Jerome Pasion2014-09-112-10/+10
| | | | | | | | | | | | | -qtdoc repo uses "OS X" instead of "Mac OS X" and this caused broken links. -more comprehensive change still needs to be done but the new name is used in the page to maintain consistency. At least within the page or class. Change-Id: I8a5650046fc0413cbb18359b743ecd30fd62e417 Task-number: QTBUG-40759 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update QOpenGLWidget paintDevice devicePixelRatio when recreating fboDyami Caliri2014-09-101-0/+1
| | | | | | | | The QOpenGLWidget's paintDevice needs to update devicePixelRatio when changing screens. Change-Id: Iec6e7157f22ff99e04f81347cbbf70f3fc3ff424 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Expose screen change event to widgets so that they can check the dprLaszlo Agocs2014-09-103-4/+28
| | | | | | | | | | Unlike ordinary widgets, the ones that have OpenGL framebuffers must know about screen changes because the device pixel ratio may be different on the new screen. Add an internal event, ScreenChangeInternal, as the counterpart to WindowChangeInternal. Change-Id: I5e55999838e4c0284e7d9832299f7cc6b541ee3f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Add an option to share between TLWsLaszlo Agocs2014-09-101-6/+19
| | | | | | Task-number: QTBUG-41191 Change-Id: I510d1631926ed0d9e371703d22229aed92432aa6 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix garbled resize with QOpenGLWidget when using multi-sampling.Dyami Caliri2014-09-101-0/+1
| | | | | | | | If you configure QOpenGLWidget to use sampling, the 'resolvedFbo' isn't updated during resizing. This leads to garbled views. Change-Id: I9f9265520134bcf12436778773507df936c5fbb6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Windows styles: Avoid theme.rect recalculationMaks Naumov2014-09-082-2/+0
| | | | | | | | | In both cases theme.rect calculated right after the "sub & SC_ScrollBarSlider" test. Change-Id: I9fa0c4e1327e68b4184674a13e7a4bf362f8deff Reviewed-by: Adam Majer <adamm@zombino.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Improve QOpenGLWidget docs regarding fb preservationLaszlo Agocs2014-09-081-1/+17
| | | | | | | | QOpenGLWindow already has some notes regarding this. It must be mentioned in QOpenGLWidget too. Change-Id: I0af90c9410a1c44cb9dd9ce58aa0371a58c57f65 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix a conversion of coordinates of a TouchBegin eventAlexander Volkov2014-09-081-1/+1
| | | | | | | | | | | To convert coordinates to a parent's coordinate system one should translate them by an offset of a child widget relative to it's parent widget. QRect::moveCenter() doesn't translate, it sets the coordinates of the touch point's center to this offset. Change-Id: I9d823784803bd1448c0d665944090674d3ff518b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Bump version of QWidget geometry serialization to 2.0Friedemann Kleint2014-09-051-6/+6
| | | | | | | | | | It was decided not to port the handling of the saved screen size to Qt 4.8, so, bump the major version to ensure Qt 4.8 bails out. Task-number: QTBUG-38858 Change-Id: Ia870519553172cd383830d9a722b0fada180ee1b Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* GraphicsView: Fix resolvePalette() for QGraphicsItem's childrenMaks Naumov2014-09-052-3/+3
| | | | | | | Use a proper function for that. Change-Id: I166ce44b8987d522cb01bae57009b2b862851b92 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* Windows styles: Scale hardcoded-values according to DPI.Friedemann Kleint2014-09-056-72/+85
| | | | | | | | | Factor out functions to return the fixed values and scale those. Task-number: QTBUG-38993 Task-number: QTBUG-38858 Change-Id: I59c70a206eae76bf08bc2aeb5cda5a740cd3d6dc Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Windows styles: Add device pixel scaling for system metrics.Friedemann Kleint2014-09-055-297/+291
| | | | | | | | | | | | Metrics obtained from the system must be scaled down when device pixel ration scaling is in effect. Factor out functions to return the device pixel values which might still be used for drawing. Task-number: QTBUG-38993 Task-number: QTBUG-38858 Change-Id: I6b90629e4979436bbb46f8c1fa1ee2253ada7ece Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* QCommonStyle: replace a QPolygon with a QPoint[] (IV)Marc Mutz2014-09-041-10/+22
| | | | | | | | | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. This one is a bit more complicated, as the QPolygon was returned from a helper function, so I wrapped the array in a minimal std::array-like StaticPolygonF. Together, these four QPolygon -> QPoint[] changes result in ca. 4.5K text size reduction for libQtWidgets. Change-Id: I082f199d5edb7a7782173fe3748220f373edac8a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QCommonStyle: replace a QPolygon with a QPoint[] (III)Marc Mutz2014-09-041-20/+23
| | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. Change-Id: Ie1eecd376a52b73572998ba253a032deaa0daaf9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QCommonStyle: replace a QPolygon with a QPoint[] (II)Marc Mutz2014-09-041-6/+7
| | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. Change-Id: Ifdf8224ddffe06ef7848562023e372e2c32b9ad6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QCommonStyle: replace a QPolygon with a QPoint[] (I)Marc Mutz2014-09-041-10/+12
| | | | | | | | No need to allocate dynamic memory for a fixed-size point array when QPainter has a (QPoint*,int) overload. Change-Id: I50c69103bba47e9f6de4f5616e8f40fee522ddc2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Improve accelerator stripping in accessible widgetsFrederik Gladhorn2014-09-043-7/+14
| | | | | | | | | | | When we strip the & we should also report the hotkey. In addition only strip labels when they are buddys and try not to remove ampersands from all kinds of random text. This fixes https://bugs.kde.org/show_bug.cgi?id=338282 Change-Id: I401281cd9ff43b23a3923ad9909ca9c469b59506 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility: Improve line boundary helper functionsFrederik Gladhorn2014-09-041-6/+0
| | | | | | | | | These functions are supposed to make it easy for third parties (and QLineEdit) to implement the textAt/Before/AfterOffset functions. Before the functions were ignoring newlines completely and thus only somewhat useful. Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* QMdiSubWindow: Keep event filter on system menu over its lifetime.Friedemann Kleint2014-09-041-2/+1
| | | | | | | | | | | QMdiSubWindow::eventFilter() is supposed to close the sub window on a double click on the menu icon. However, it did not receive the double click event since it removed itself when the menu was hidden, which happened before the double click was delivered. Task-number: QTBUG-25179 Change-Id: I5e7fb02dda26ceab12e8b7554fc604066a0a3136 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Speed up the removal of items from a QGraphicsSceneDimitar Asenov2014-09-031-3/+22
| | | | | | | | | | | | | | | | | | | | | | | When using a linear index, all items in a scene are stored in a QList. While adding new items is a constant operation, removal requires a traversal through the entire list. This is especially problematic when the scene contains millions of items and many of them are removed, which requires a linear search for each item, resulting in a very slow operation. Moreover, this behavior is actually inconsistent with the current documentation which states for the linear index: "Adding, moving and removing items, however, is done in constant time." With this change, the list is sorted once an item needs to be removed. The item to be removed is then found using binary search. To reduce the overhead of sorting the list is not sorted from scratch. First the newly inserted items are sorted and then the two parts of the list are merged. [ChangeLog][QtWidgets][QGraphicsScene] Speed up the removal of items when using the linear index. Change-Id: I28708622605d7fb0fac656df1f9b2f2fa3136759 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* Revert "Speed up the removal of items from a QGraphicsScene"Dimitar Asenov2014-09-032-39/+7
| | | | | | | | | | | | | | | | | | This reverts commit bf2ec0183cb62034f2a4e700b7ab741371fcb106. That patch changed the way the linear index works in QGraphicsScene in order to speed up item removal. That patch occasionally rebuilt the index by recursively exploring all items in the scene, starting with the top level. Further testing revealved that in some circumstances, rebuilding the index in this way can be slow, thereby significantly slowing down the index compared to the unpatched version. The original patch only exists in the qt 5.4 branch and has not been released. Change-Id: I081dbcdcc86196ef382466c3e800a33eab9a5b79 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* Widgets: remove pointless assignmentsMaks Naumov2014-09-033-8/+4
| | | | | | | | | Assignment of a value was two times successively for same variable while the variable itself is not used between these assignments. Change-Id: I3c457e3af0505d32a64f6c8576b458cd15a951e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSwipeGestureRecognizer: Use qAbs() to check distances.Friedemann Kleint2014-09-031-1/+1
| | | | | | Task-number: QTBUG-15768 Change-Id: Idc6c6687430365a015fb2c15f4e4dcae6a687f9f Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix drawing of QLineEdit's actions when Qt::AA_UseHighDpiPixmaps is set.Friedemann Kleint2014-09-021-1/+1
| | | | | | | Task-number: QTBUG-40525 Change-Id: Iff3c1e16d9c44e1d36b8f83ca96b48bff05ab1f0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Windows XP, Vista styles: Share dynamically resolved theme functions.Friedemann Kleint2014-09-024-202/+191
| | | | | | | | | | Extract a struct containing the function pointers and derive QWindowsXPStylePrivate from it, so that both styles can use them. Remove duplicated variables. Task-number: QTBUG-38858 Change-Id: I7c2c665b5930c56ffdf33c5185720f71517d146c Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>