summaryrefslogtreecommitdiffstats
path: root/src/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Accessibility Windows: Improve MenusFrederik Gladhorn2014-04-253-8/+0
| | | | | | | | | | | | | | This would especially trigger when moving the focus between menus - after the right menu got the focus we would send another event for the QMenuBar, preventing the screen reader from reading the actually selected menu, announcing the menu bar instead. [ChangeLog][QtWidgets][QMenu] Accessibility: Menus are read by screen readers with more reliability. Task-number: QTBUG-38498 Change-Id: Ie4028120b234949380315296bf07ca53863d0ad8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Update tooltip palette when receiving a theme change notification.Friedemann Kleint2014-04-252-4/+11
| | | | | | Task-number: QTBUG-38183 Change-Id: Ia86ae698ae4afcf9d5c361f178f3ca44ae9a3ee5 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Merge remote-tracking branch 'origin/release' into stableJani Heikkinen2014-04-232-1/+12
|\ | | | | | | Change-Id: Id13b4a3803664692f32f9d57549be8a0c4a08567
| * Restore Qt 4 behavior in default double click handlerLaszlo Agocs2014-04-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert 3bb902495291c50a2f06e8e03a62a647db3e5cd4. That fix was an attempt to handle the issue that has been fixed in 5.3 by 9063edef796ad10eb9ac2229627f36d60168f0e2 and should have been reverted when the new approach, that restores Qt 4 behavior for widgets, was introduced. Task-number: QTBUG-38242 Task-number: QTBUG-36423 Change-Id: I8f8a82da22605fac90543492e9b2cd2b568544e7 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * Doc: document obsolete QApplication::setGraphicsSystem()Marc Mutz2014-04-101-0/+9
| | | | | | | | | | Change-Id: I5a87564d2dbfa5e739d1ca40db480e8e0c1b7fdf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | QMacNativeWidget: Fix background renderingGabriel de Dietrich2014-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | The widget's background is transparent, but Qt is not owning the backing store in this case, so we must make sure it gets properly cleared and flushed. Task-number: QTBUG-19840 Change-Id: I1087ce80aae3620d64a8c180129d79b5b022750b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | CMake: Include the definition of the Qt5::AccessibleFactory target.Stephen Kelly2014-04-161-0/+2
| | | | | | | | | | | | | | | | | | The file will not exist if the accessible plugin is not built. Task-number: QTBUG-37849 Change-Id: I2983d01a085b11737bf49805edab5ca33fb5174a Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | Fix crash when deleting top level windows embedded into QGraphicsProxyWidget.Friedemann Kleint2014-04-141-0/+4
| | | | | | | | | | | | | | | | | | | | Clear proxyWidget pointer in slot QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot(). Task-number: QTBUG-29684 Task-number: QTBUG-33213 Change-Id: Ibdbd52aa810ca908e3d98daa00954345e7a93a48 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* | Restrict QFontComboBox's popup width to screen widthFabian Bumberger2014-04-141-2/+5
|/ | | | | Change-Id: I5a92308beb2f245d9f031918bb8154757316ef56 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Mac: Implement unified toolbar look for QTabBarMorten Johan Sørvig2014-04-093-41/+88
| | | | | | | | | | | | | | | | | | | | | | | | | Extend the unified title and toolbar gradient to tabs in document mode that are adjacent unified tool bars. Change the updateMacBorderMetrics() function to register the tab bar geometry and visibility status with the Cocoa platform plugin. The Cocoa platform plugin will then merge this area with other registered areas if possible. Add QCocoaNativeInterface::testContentBorderPosition(). This function tests whether the given point is within the unified title and toolbar area. Use testContentBorderPosition() in QMacStyle to enable code paths that skips drawing the QToolBar bottom separator line and paints the active tab background with transparent pixels to make the background gradient visible. Change-Id: I2b70f9bb0c2c59af053a691a7df538f958783dab Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: Update unified toolbar area on toolbar hideMorten Johan Sørvig2014-04-093-5/+23
| | | | | | | | | | | | | | | | | | | | | Add setContentBorderAreaEnabled() which us used to enable or disable an area. Used together with registerContentBorderArea() this allows changing the border area geometry and enabled status independently. Add section to the QToolBar show/hide event handler which calls setContentBorderAreaEnabled(). Make sure QToolBar and QToolBarLayout uses the same identifier - the QToolBar object pointer. Rename enableContentBorderArea -> setContentBorderEnabled. The "ContentBorder" is now the entire unified toolbar area while "ContentBorderArea"s are the sub-areas covered by toolbars. Change-Id: I339f381a50856e048ae40e7ffadd6a8a510c4994 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix crash when trying to place toolbar into zero-height window.Friedemann Kleint2014-04-093-20/+32
| | | | | | | | | Change QToolBarAreaLayout::item() to return a pointer and check return values in plug(). Task-number: QTBUG-37183 Change-Id: I7029eb9739cbe603460e87d3e5493f116bdb3a89 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix crash in qt_try_modal.Friedemann Kleint2014-04-091-2/+1
| | | | | | | Task-number: QTBUG-34580 Change-Id: Idc549116fa99aa49ac7c67dcfc76d32ca71f3c76 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* QComboBox: Set the proper font after a MacSizeChange eventGabriel de Dietrich2014-04-091-0/+12
| | | | | Change-Id: I5c90817e52a3e87d9b06b2bb670d69a6953efd47 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Cocoa: Use private property to enable NSWindow child windowsGabriel de Dietrich2014-04-091-0/+1
| | | | | | | | | Enabled for QToolBar to allow it to overlap OpenGL widgets when expanding. Task-number: QTBUG-33082 Change-Id: I76dc8da52bc04eedc6d6779c48753da100ed1c9f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* QOpenGLWidget: Avoid crashing if updateGL is called before the first resizeJocelyn Turcotte2014-04-091-0/+3
| | | | | Change-Id: I9e7788334de98b35dc5d6beee97a63783a1fe267 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Forward "_q_platform_*" QWidgets's properties to QWindow.Tomasz Olszak2014-04-092-0/+7
| | | | | | | | | | | This way we can customize QPlatformWindow by using dynamic "_q_platform_" properties in corresponding QWindow. Change-Id: I987b7a17d252541fe766af6aa37a6cffb67f1807 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Mac style: Fix one-pixel offset for combo boxes in small sizeGabriel de Dietrich2014-04-081-1/+1
| | | | | Change-Id: I744c102bd086742b1052ed547e50037dddff4654 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QStyle: Add new SH_ComboBox_UseNativePopup style hintGabriel de Dietrich2014-04-072-0/+4
| | | | | | | | | | | | If the style hints it, QComboBox::showPopup() will try to show a native popup instead. This is currently undocumented and an opt-in feature (typically by using a proxy style). Works only on Mac so far. Task-number: QTBUG-32731 Change-Id: I4447e884cbd6b490f3039c7a95168698c0bed16e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QComboBox: Use native popups on MacGabriel de Dietrich2014-04-072-6/+94
| | | | | | | | | | | | | | This remains an opt-in solution bound to the usage of SH_ComboBox_UseNativePopup in a proxy style. The midterm goal is to make this option on by default, possibly in 5.4. This solution is and will remain a hint in the sense that some exotic use cases of QComboBox (e.g., when setting its view) are inherently incompatible with the native popup idea. Task-number: QTBUG-32731 Change-Id: I2a3d780795c22f9989e44325fcaf314538b1de49 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix a crash on startup with QOpenGLWidgetJocelyn Turcotte2014-04-071-1/+2
| | | | | | | | | | | After c4aabeb2b82d777bb555f836f55e1f7ae4fb4581 we now try to access q_ptr in QWidgetPrivate::setRenderToTexture. QOpenGLWidget needs to delay this call after the QObject constructor is done to make sure that setTextureChildSeen doesn't dereference q_ptr before it has been initialized. Change-Id: Icaee82c8b806f42bc7614b0ac6fe4e6026331750 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Accessibility text updates for QTextEditFrederik Gladhorn2014-04-053-0/+30
| | | | | | | | | For Mac this makes QTextEdit work nicely with VoiceOver. Task-number: QTBUG-37204 Change-Id: I1326d24ca6a932ad667ee395f62881b6ec64e892 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Improve QWidget::metric for PdmDevicePixelRatio.Morten Johan Sørvig2014-04-051-6/+9
| | | | | | | | | | | | | | Use QWindow::devicePixelRatio() which is the most accurate devicePixelRatio accessor since it can ask the platform native window directly Fall back to qApp->devicePixelRatio() if the window pointer is not valid. Task-number: QTBUG-37606 Task-number: QTBUG-38078 Change-Id: Ief1468a0c6ced07439f55329ab056883016241cc Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Compile: isChildOfQMdiSubWindow may be unused.Morten Johan Sørvig2014-04-051-0/+2
| | | | | | | [-Werror,-Wunused-function] Change-Id: Icf1e60ce3c5dadb96272453583d1cd03379eb73b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNX: Surpress manual window activation during showFullScreenFabian Bumberger2014-04-051-0/+3
| | | | | | | | | | When a window is shown, libscreen will give it keyboard focus. Requesting the activation right after the window is created (and before libscreen activated the window) causes problems on some devices e.g. Q10. Change-Id: I29f7a38990ea4259a8b0c6624f70e31d7291af00 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* Make it possible to render QtWebEngine in QOpenGLWidgetJocelyn Turcotte2014-04-041-0/+2
| | | | | | | Setup the GL context as shared with the Qt global share context. Change-Id: I199cfc7d290466d0ad99294bcffcd738b615862b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Don't assume qt_tablet_target widget exists from one event to the nextShawn Rutledge2014-04-041-10/+2
| | | | | | | | | | | | | | | | In this scenario there is a widget with a button inside, and you click the button with the tablet. The target of the event is the button, but when you click it, the parent (or ancestor) is destroyed. Commit 2bac49265efcf8faabc3756d1a3e405a3d336f68 took care of the case when the parent is a window, but it is not always a window which is being destroyed. So the approach of using a QPointer is better because it should take care of all the cases when the qt_tablet_target is destroyed during the course of a tablet event sequence. Task-number: QTBUG-36848 Task-number: QTBUG-38040 Change-Id: Ia0e861f2cb2fbc30234aa596f3a36ddd0835a9af Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* OS X: Fix QRubberBand drawing on retina displaysMorten Johan Sørvig2014-04-031-1/+3
| | | | | | | | | | | Extend the existing rect adjustment to cover the upper/left edges as well. Check for a valid rect before drawing. Task-number: QTBUG-34534 Change-Id: I156abf4fb52924c350ec24fb44eadca86b2d5339 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Steve Mokris <smokris@softpixel.com>
* Avoid double clicks confusing popupsLaszlo Agocs2014-04-031-1/+1
| | | | | | | | | | | | Setting qt_button_down on DblClick is dubious and breaks popups like menus since they won't appear correctly on every click anymore when clicking on them rapidly several times. Task-number: QTBUG-37891 Change-Id: Ic6cbbbe8b42891d2f9fa2ff66aa42bb89230d896 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Rick Stockton <rickstockton@reno-computerhelp.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Enable the depth and stencil buffers by default in QOpenGLWidgetJocelyn Turcotte2014-04-021-1/+1
| | | | | | | | | | | | | QGLWidget rendered to the default framebuffer, which had a depth and stencil buffer attached by default. Keep this behavior by adding the attachments to the FBO by default in QOpenGLWidget. Change-Id: I6f72a444eac3d8eabb7a539ad12216f1e5d2183d Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* When looking up the window hierarchy, stop at foreign windowsAlberto Mardegan2014-04-011-2/+9
| | | | | | | | | | | If the window being activated is an embedded window, the parent window will be a foreign window (usually not even belonging to the current process); we shouldn't attempt to focus it. Task-number: QTBUG-37984 Change-Id: I2ea03a86b30bbc43cde643e18e0e1d020e5f2c84 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Item views: respect selection mode when closing an editorJ-P Nurmi2014-04-011-2/+3
| | | | | | Task-number: QTBUG-31411 Change-Id: I1a52eb739e0bc2afa7227f006461916df8ecaf48 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Item views: respect focus policy when closing an editorJ-P Nurmi2014-04-013-11/+9
| | | | | | Task-number: QTBUG-31411 Change-Id: Ib0a72755c35a553653ea014672d59979a550b7ae Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Propagate textureChildSeen properlyLaszlo Agocs2014-03-311-1/+1
| | | | | | | even if setParent() is not called afterwards. Change-Id: Ie54e227c7adda2710fbd46176e9a15252aef2985 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Send touch update events to widget if there is a gesture pending for it.Friedemann Kleint2014-03-313-1/+12
| | | | | | | | | | | | Otherwise, touch update/end events were ignored and the gestures were never triggered (unless a native widget was used). Task-number: QTBUG-37759 Change-Id: I4b0145ffe535065e1458164b67bc8d9e33a4af97 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* If no screens, attempting to create a window results in clean exitShawn Rutledge2014-03-291-1/+6
| | | | | | | | | | | Asserting is only relevant for debug builds, and there were a couple of other places that a segfault would typically occur before the assert had a chance. Change-Id: I1abc82eb3ecfa91050117fab1525f4cbd82ff486 Task-number: QTBUG-37876 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Remove a duplicate code of else-if statementluyikei2014-03-291-3/+0
| | | | | | | | I found a useless else-if statement in qwidgettextcontrol.cpp. It is duplicating.Needless to say,it should be removed. Change-Id: Ic70b995196f7199e4aa5263a4937c1678b130357 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Do not rely on the list of standard font sizes for QFontDialog.Leonard Lee2014-03-281-8/+10
| | | | | | | | | | | | | QFontDialog should always show the correct size, even if the size is not available in the list of standard font sizes. Native font dialogs across common platforms show the correct size at all times. Inside init() function, the size list requires proper initialization since the initial value of size is zero. Task-number: QTBUG-10317 Change-Id: Idc9e922ac95f797ac98bbf6c885e52828c4c48fd Reviewed-by: Liang Qi <liang.qi@digia.com>
* Fix disappearing transient scrollbarsJ-P Nurmi2014-03-282-5/+19
| | | | | | | | | | | | | | | | | When a transient scrollbar is already at the end and user attempts to scroll further, the scrollbar is "flashed" to indicate that the scroll area is already scrolled to the end. This is done so that the scrollbar is first painted with a flag turned on to make it appear visible and then again with the flag turned off to make qstyle start fading it out. The previous code that relied on paint events to clear the flag was error prone, and caused the scrollbars to get stuck in an inconsistent state. This change makes sure that the flag gets cleared regardless of whether a paint event in each state is received or not. Task-number: QTBUG-37787 Change-Id: I907697c32cd4d55208a490804a221a5dd6bf7b0b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Pass events to QGestureManager from the main (GUI) thread only.Friedemann Kleint2014-03-281-9/+12
| | | | | | | Task-number: QTBUG-20946 Change-Id: I964452c1e97bd3d3a521e33abeb2f7d8cdbc89a9 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Streamline code in standard gesture recognizers.Friedemann Kleint2014-03-271-27/+8
| | | | | | | | | | Always initialize result variable, make static casts to QTouchEvent * local. Task-number: QTBUG-37759 Change-Id: Ib48034906afae8090a3be965a11f17d7d119bc5f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Make QWidget::render() work correctly with all paint devicesLars Knoll2014-03-272-23/+8
| | | | | | | | | | | | | | | | | Make sure QWidget::render takes correct code paths with all kinds of paint devices. Correctly restore the inRenderWithPainter flag. The old code would not correctly restore the flag, likely leading to inconsistencies. Remove the unused last parameter in QWidgetPrivate::render. Remove the special handling for QPrinter in the same method. Task-number: QTBUG-26564 Change-Id: Iba43269b090abd8dd88c5225b75e1ee9239d58f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QPA: Fix QPlatformTheme::Palette enum value spellingGabriel de Dietrich2014-03-211-1/+1
| | | | | | | | | We keep the old value for source compatibility, but it should probably be removed at some point as the QPA API is semi-public only. Change-Id: I06e4c9ca1d8bb878411ad79ef409d60ce2d29f4a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Mac theming: Remove obsolete private color conversion functionsGabriel de Dietrich2014-03-211-12/+0
| | | | | Change-Id: I165eea19c8e50f981a9fa48c14f0d63c40951747 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Mac theming: Set background brush for menu paletteGabriel de Dietrich2014-03-211-5/+0
| | | | | | | | We also remove overriding the background when polishing the palette in QMacStyle. This is a leftover from pre-10.5 styling. Change-Id: Icaa6d9c864ab01783d83cc02192981136c417d24 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Set unified toolbar height accurately.Morten Johan Sørvig2014-03-203-8/+44
| | | | | | | | | | | | | | | Add registerContentBorderArea() to the Cocoa native interface which allows registering multiple "unified toolbar" areas for each window. Use this function in QToolBarLayout::setGeometry() to register the area for each TopToolBarArea toolbar. Task-number: QTBUG-36700 Change-Id: I52efcc5662556bb94f25f504be3710d0491f79b9 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
* Respect scrollbar position setting on MacJens Bache-Wiig2014-03-201-4/+4
| | | | | | | | | | | This was a regression from Qt 4.7. [ChangeLog][Widgets][QScrollArea] Respect scrollbar setting for click-position on Mac. Task-number: QTBUG-36314 Change-Id: I8bdb1aec9b308b0907f5db29d3519998bc843c18 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* QFusionStyle: support transient scrollbarsJ-P Nurmi2014-03-202-32/+168
| | | | | | | | | | | | | | | | | | | | QFusionStyle doesn't make scrollbars transient by default, but the feature can be enabled with a proxy style: class MyProxyStyle : public QProxyStyle { public: int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0, QStyleHintReturn *ret = 0) const { if (sh == QStyle::SH_ScrollBar_Transient) return 1; return QProxyStyle::styleHint(sh, opt, w, ret); } }; Change-Id: Ibf169e219ad920cbe7edb06e128e09ed4d8faf96 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QPushButton: draw label using the stylesheet's font.Mitch Curtis2014-03-201-0/+8
| | | | | | | | | | | The RenderRule for the stylesheet has the correct font information, it just wasn't being set on the painter that draws the label. Task-number: QTBUG-8990 Change-Id: I7cbaffc570421db04ebf3254cb6a21a68f7b868b Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* QApplication: fix scroll phase handling for wheel eventsJ-P Nurmi2014-03-201-2/+2
| | | | | | | | Set scroll phase correctly for propagated wheel events, and do not let Qt::ScrollBegin/End steal focus when using Qt::WheelFocus policy. Change-Id: Ia38b64059d96a228c3b83c9b455db6e30dfb9a46 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>