summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QWidgetWindow: The alien widget should be from the window's hierarchyGabriel de Dietrich2015-12-211-1/+1
| | | | | | | | | This partially reverts commit 025d6a778ceb377e688f1. Change-Id: I7b964b0d598abe46137c22177fe2b5dcca5bb812 Task-number: QTBUG-49831 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Call setFocus() if it is a QAxHostWidget which is in a new active windowAndy Shaw2015-11-231-2/+4
| | | | | | | | | | | | The change 8c0f47cfae17a39137dec47aa0b9f3f9bedad introduced a problem where if the widget was being reparented had a valid HWND then it would cause the focus to change inside the already active window. Therefore we need to limit the times it does this to the case where we know it needs to be done which is the ActiveQt case. Change-Id: Ia85f5136661142b25952e0ebf66f8a43d9500d58 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Do not leak textures from the backing storesLaszlo Agocs2015-11-231-11/+35
| | | | | | | | | | | | | | Neither the default nor the eglfs-specific backingstore release the OpenGL textures that are in use when render-to-texture widgets are involved. The result can be fatal on embedded devices that run out of GPU memory at after showing and closing dialogs and popups a certain number of times. Task-number: QTBUG-49363 Task-number: QTBUG-49399 Change-Id: Ia7471b037f147bcca0a4f1db5808ca348e230547 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Minor optimization to QWidgetPrivate::naturalWidgetFont()Konstantin Ritt2015-11-051-6/+10
| | | | | | | | When inheritedMask is 0, the font inherits just everything; in this case `inheritedFont.resolve(baseFont)` could be replaced with `baseFont`. Change-Id: Ic3ed8ef174493544ada32037e7bdded46eb4bd43 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Support device pixel ratio in QWidget graphic effectsDavid Edmundson2015-09-041-1/+4
| | | | | | Change-Id: Ie20bd30328ae353ace82fbeee5808546f0568703 Reviewed-by: Christoph Cullmann <cullmann@kde.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Prevent QGestureManager crash.Morten Johan Sørvig2015-09-022-2/+5
| | | | | | | | | | | | | | | Use QPointer to prevent dereferencing stale pointers stored in m_gestureTargets. Add null pointer tests in addition to the Q_ASSERTs on the pointers returned by m_gestureTargets.value(). The intention is to assert in debug mode but keep going in release mode. Change-Id: Icdef8cc02040bddc88f4bcb268e9ca0ac252557d Task-number: QTBUG-46264 Reviewed-by: Pawel Kurdybacha <pawel.kurdybacha@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Fix unnecessary enter leave eventsJorgen Lind2015-08-201-2/+2
| | | | | | Task-number: QTBUG-45565 Change-Id: I92c1dc0a14440259349eeae40372221dbc3c548f Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Doc: remove type() reference from QApplication and QGuiApplicationJulien Brianceau2015-08-181-2/+1
| | | | | | | | QApplication::type() is gone since Qt 5.0. Task-number: QTBUG-28093 Change-Id: I8700c69a42271e8b99f3e86a5014c8abf7711f53 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Fix link to QQ articleAndy Shaw2015-08-071-1/+1
| | | | | Change-Id: I04d373778b243fdeb281c98e292359996639c95e Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix crash when mixing widgets with QtQuick 1 and Qt Quick 2Simon Hausmann2015-08-061-4/+7
| | | | | | | | | Apply the fix from commit 313a74cc4a9a5d200b2059d3d8767fe1a274c50d also to the QWidget and the QGraphicsObject destructor. Task-number: QTCREATORBUG-10273 Change-Id: I47983b49cc4d9b75a2e1ee838e13403bc4b95a59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Fix the internal compositing flag for QOpenGL/QuickWidgetLaszlo Agocs2015-07-281-2/+2
| | | | | | | | Compositing stays active for the window even when all such widgets get destroyed. Task-number: QTBUG-46937 Change-Id: Ib4acc90689151fd7de234806c4b5c0c472c13a5c Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Clear qt_tablet_target only when all buttons are released.Friedemann Kleint2015-07-271-1/+1
| | | | | | Task-number: QTBUG-46694 Change-Id: Ie95a452dfffd6685dd2a32068872dc18f727c288 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Fix action shortcuts for QToolButtonPaul Olav Tvete2015-07-231-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverting change 4db5d3ccd17d448b59db491e2f261892f31fec74, since it introduced two separate regressions: 1. QToolButton would prefer text() over iconText() 2. Actions with a mnemonic would create a shortcut when added to a tool button. There is a fundamental problem here, which is impossible to solve correctly: A menu item with the text "Short&cut" will create a mnemonic, i.e. it will be triggered by pressing 'c' when the menu is open. However, a button with the text "Short&cut" will create a shortcut that is triggered by Alt+C as long as the window has focus. Also, iconText() is used for tool tips, so it should not contain shortcut related '&'s. This patch attempts to find a sensible compromise: 1. If the text is set through QAction::setText(), QToolButton will not create a shortcut, and will not display an underline. 2. Using QAction::setIconText("Short&cut") will create the shortcut. 3. Tooltips will not show any extra '&'s when generated from text(), but when using setIconText() directly, any '&' characters used to create shortcuts will also be visible in the tooltip. Task-number: QTBUG-23396 Task-number: QTBUG-47306 Change-Id: Ieea2fc569807c862ca462349bf91922a4029700f Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Doc:added doc to undocumented functionsNico Vertriest2015-07-221-0/+49
| | | | | | Task-number: QTBUG-36985 Change-Id: Ic358682b276d67ef804f727bcf14191718613469 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Don't complain about non-matching Qt versions in qwidget.cppThiago Macieira2015-07-171-1/+8
| | | | | | | | | | Commit 5bf67f5f41ab110eb41ab74f2a87e649735af435 did it for qobject.cpp, but I missed qwidget.cpp (I hadn't realized the test existed there too). Change-Id: Ib056b47dde3341ef9a52ffff13eeceafcfc64893 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Switch to new not deprecated apiAndreas Holzammer2015-06-301-5/+1
| | | | | | | | | | | | SPI_GETPLATFORMTYPE is deprecated as of Windows Embedded Compact 2013, SPI_GETPLATFORMNAME is a full replacement. Use this instead because it produces deprecation messages and slows down execution. Task-number: QTBUG-46916 Change-Id: I7f162b488dd0b1aa256c47a9e76358df101e3d0f Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* Replace MAC OS X with OS XNico Vertriest2015-06-305-13/+13
| | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-272-5/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoafiledialoghelper.h Manually fixed src/testlib/qtestcase.cpp to return the right type. Change-Id: Id1634dbe3d73fefe9431b9f5378846cb187624e4
| * Inline QSpacerItem::sizePolicy()Marc Mutz2015-06-102-5/+2
| | | | | | | | | | | | | | | | There's zero reason not to do it, esp. given how small a QSizePolicy is. Change-Id: I88b92bb27e6341b60a2cb3f2ddcc232f25f03ca8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix incorrect warning message in QOpenGLWidgetLaszlo Agocs2015-06-221-1/+1
| | | | | | | | | | Change-Id: I3b99894171a3e63b75a14357a1be0c0dd1f45e93 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Fix global coordinate mapping for child widgets in QGraphicsView.Friedemann Kleint2015-06-211-22/+24
| | | | | | | | | | | | | | | | | | | | | | Move the code path handling widgets embedded in QGraphicsProxyWidget into the loop moving up the parent hierarchy. Add child widget to test. Task-number: QTBUG-41135 Change-Id: Ibd86413faaa927145a85a2f5864f162979135053 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QSwipeGestureRecognizer: Allow for small direction changes.Friedemann Kleint2015-06-071-10/+14
| | | | | | | | | | | | | | | | | | | | When trying to do a straight right/left/up/down swipe, a minimal change in the other direction caused to the gesture to be canceled. Introduce a threshold for checking such to prevent this. Task-number: QTBUG-46195 Change-Id: I3e199f2ec0c81d23a16073b1f5b8fff004958239 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | fix usage of wince scopeOswald Buddenhagen2015-06-052-2/+2
|/ | | | | | | Fix style issues along the way. Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Avoid QWidget dependency in QtGuiLaszlo Agocs2015-06-011-1/+1
| | | | | | | | It's not a real dependency as all we need is to store a pointer, but better not to use the name QWidget at all. Change-Id: I30ef1dd44ac7e42c1b9c84675f94088b8c516076 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Clip QOpenGLWidget and QQuickWidget correctlyLaszlo Agocs2015-06-011-1/+2
| | | | | | | | | | | | | Introduce support for the widgets' clipRect(). Right now render-to-texture widgets in scroll areas placed close to each other result in broken (non-existent) clipping. Similarly, stack-on-top widgets fail to clip when placed inside a scroll area. This is now corrected and the qopenglwidget example is enhanced to utilize a scroll area. Task-number: QTBUG-45860 Change-Id: I859a63d61a50d64ba9e87244f83c5969dce12337 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Emphasize the need for calling setDefaultFormat early on OS XLaszlo Agocs2015-05-291-0/+6
| | | | | | Task-number: QTBUG-46067 Change-Id: I0fe6e7ba309306a8fc471424b30eed4491bd39e7 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix a crash in tst_QTouchEvent::deleteInRawEventTranslation().Friedemann Kleint2015-05-221-2/+3
| | | | | | | | | | | | The test deletes a widget in QEvent::TouchBegin. This is part of a series of patches to revive the test; it is currently not run since tests/auto/gui/kernel/qtouchevent/qtouchevent.pro is missing CONFIG += testcase. Task-number: QTBUG-46266 Change-Id: I65c0a431ff1807133438764dd8b3c16bb9cb6743 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* Don't propagate single touch events only from touchpads on OS XAlexander Volkov2015-05-211-2/+4
| | | | | | | | | | This way the tests that send fake touchscreen events can work. Change-Id: I997ef015d0096249c4549dbd21b99d0248e0c987 Task-number: QTBUG-46111 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Unclutter debug operators of gestures.Friedemann Kleint2015-05-201-17/+33
| | | | | | | Use the helpers in qdebug_p.h to suppress class and enum names. Change-Id: Ib71f0a1e5b3c22f44d68a7930fef38384f037204 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix typo and formatting in QWidget font documentation.Mitch Curtis2015-05-181-2/+2
| | | | | Change-Id: I6dea7f1aa2827dbc4c4068184690c80a36ef2be6 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Fix division by zero crash when restoring screen settingsKati Kankaanpaa2015-05-131-3/+2
| | | | | | | | | | | | The restoredScreenNumber was used before it's existence was checked, which caused 'division by zero' if the screen has been removed after storing the screen number. The check if restoredScreenNumber exists was moved to happen before restoredScreenNumber is used for the first time. Change-Id: Iada0e8c5cbb6d8ca88df171dbee045be249f50cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Create contexts and pbuffers with the correct screen in QOpenGLWidgetLaszlo Agocs2015-05-122-0/+3
| | | | | | | | It won't be functional otherwise with GLX when the QOpenGLWidget is targeting a separate X screen. Change-Id: Ibe5b89023f833039bb67d94b78b173de2e021ac9 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Merge remote-tracking branch 'origin/5.4' into merge5.5Allan Sandfeld Jensen2015-05-082-4/+5
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix finding the closest active touch point for the pressed touch pointAlexander Volkov2015-04-162-4/+5
| | | | | | | | | | | | | | | | | | | | | | Currently pressed touch point is added to the list of active touch points in Gui module. It must be excluded from consideration when we traverse the list. Task-number: QTBUG-43255 Change-Id: Idddab093b1f6a79122cf18fad7f43bfc93ce7eea Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QSizePolicy: improve docs of retainSizeWhenHiddenMarc Mutz2015-05-071-3/+4
| | | | | | | | | | | | | | | | Fixed markup and grammar. Change-Id: Ie2427965f905135572fd1f81e4a6d7514dea7022 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Give QSizePolicy its own .cppMarc Mutz2015-05-075-113/+124
| | | | | | | | | | | | | | | | | | | | | | Previously, implementation was spread between qlayout.cpp and qlayoutitem.cpp and the docs between those two files and qsizepolicy.qdoc. Move everything into a new qsizepolicy.cpp. Change-Id: Id15c2c13572b7b8863be596603100f388eafea07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Minor optimization to QWidgetPrivate::setFont_helper()Konstantin Ritt2015-05-011-1/+1
| | | | | | | | | | | | | | There is no sense in comparing fonts with different resolve_mask-s. Change-Id: Icfdaf494fce8a59b7138d96fdf7354cc0514ca6a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Fix FPE in QApplicationPrivate::dispatchEnterLeave() due to invalid cursor ↵Friedemann Kleint2015-04-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | position. QGuiApplicationPrivate::lastCursorPosition is initialized to qInf(), qIn(). Under some circumstances, this is passed to dispatchEnterLeave() which causes an FPE in QPointF::toPoint(). Move the invocation of QPointF::toPoint() to the if-branch handling the enter list, which already fixes the FPE. To be extra sure, clamp to QWIDGETSIZE_MAX. Task-number: QTBUG-45501 Change-Id: I2d1407415e6360196730d23ee319d1ee6981d1f5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Enable checking for whether the system palette was explicitly setHarald Hvaal2015-04-201-0/+1
| | | | | | | | | | | | | | | | | | | | In order to obey a palette set globally on QApplication, an application attribute for checking if it's set at all is added. Task-number: QTBUG-39800 Change-Id: I26b965e6e18e0e1ca4df03cf343b3527df3636b2 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Guard QWidget::setStyleSheet() against invocation from destructor.Friedemann Kleint2015-04-091-0/+2
| | | | | | | | | | | | Task-number: QTBUG-45178 Change-Id: I3670d9cd9645155318b595d1324a3b3caf2352f6 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Avoid leaking the QPlatformTextureListLaszlo Agocs2015-04-081-0/+1
| | | | | | | | | | | | Task-number: QTBUG-45395 Change-Id: I8fbdc5136d7d15b9c131d6b91186a1bf2645e4d4 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Fix debug stream operators.Friedemann Kleint2015-04-011-1/+2
| | | | | | | | | | | | | | | | | | | | - Use QDebugStateSaver to restore space setting in stream operators instead of returning dbg.space() which breaks formatting on streams that already have nospace() set. - Fix some single character string constants. Change-Id: I0fe86bb1adbdd4a76ab6d2f8c19e063b45ddcf3b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-16/+1
|\| | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| * Fix use of the window geometry specificationAlexander Volkov2015-03-271-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now we applied the geometry in QWidget::setVisible() by calling QWidget::move() and QWidget::resize(). But these methods are unreliable when the window is created but not visible yet. For example, specifying the window position by "-geometry +0+0" will take no effect. Apply the geometry directly to QWindow in QWindow::setVisible(). QWidget will update its geometry after the response of the window system. Besides it allows to specify the geometry for QML applications. Task-number: QTBUG-44713 Change-Id: I9a0e110e81e569c81da802729707fec104fef887 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Fix incorrect FBO bindings with QOpenGLWidgetLaszlo Agocs2015-03-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLContext::defaultFramebufferObject() knows nothing about QOpenGLWidget and QQuickWidget. The problem is that this function (and others that rely on it) is expected to give the widget's backing FBO in paintGL() and friends. To overcome this, we have to provide a way for such widgets that indicate what is the expected "default fbo". Task-number: QTBUG-43269 Change-Id: I43f439f8609382b9f7004707ab0ef9f091952b4f Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Remove compression of posted input method events.Friedemann Kleint2015-03-301-4/+1
| | | | | | | | | | | | | | | | Input method events contain attributes, etc. and cannot be compressed. Change-Id: Ib9a2a80f1efec53f9d843684f8227e1f2e245853 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | Add a section about QOpenGLWidget alternativesLaszlo Agocs2015-03-251-0/+17
| | | | | | | | | | | | | | | | | | QOpenGLWindow with createWindowContainer() can be an option for desktop-only apps in some special cases. Document this. Task-number: QTBUG-45192 Change-Id: I7c59b7d04d6c0fe58ffe93ac72b204103bef2f4c Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Don't replay mouse press event which closes a popup on X11Alexander Volkov2015-03-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | Add a new style hint to QPlatformIntegration: ReplayMousePressOutsidePopup. Return false for it in the xcb plugin. This commit restores the behavior which was in Qt 4. Task-number: QTBUG-34814 Change-Id: I19fee762395a51475cc67b52b368c70679ca736b Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Use glFinish() in QOpenGLWidget unless glFlush() is known to be enoughLaszlo Agocs2015-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver used on the Odroid-XU3 does not like doing just glFlush() before accessing the texture in another context. There is no guarantee that glFlush() is enough to sync access to resources between contexts, so start using glFinish() as the default, except on common desktop hw + iOS where flush is enough and presumably more efficient. To unify the code pathes, remove the separate flushes and do it only once, before the backingstore compositor indicates that it is about to access the textures. This should improve performance a bit, esp. when doing multisampling since we flush only once then. A helper function is added to the internal QOpenGLExtensions because it is highly likely that QQuickWidget will need the same. Task-number: QTBUG-45106 Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QWidget: render() in correct resolution on retinaTimur Pocheptsov2015-03-231-1/+4
| | | | | | | | | | | | | | | | | | Factor in the target devicePixelRatio when setting the size (and devicePixelRatio) on the target pixmap. Task-number: QTBUG-41682 Change-Id: I16a85cf7ba0adb6d6c05e9de4fd44ff5533b5f60 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>