summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwindowcontainer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtWidgets: Fix static method invocationsFriedemann Kleint2019-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Apply fixits by Creator and results of manual search focusing on QCore/Gui/Applicaton(Private) methods and variables to prepare for splitting out some classes. Task-number: QTBUG-69478 Task-number: QTBUG-76497 Task-number: QTBUG-76493 Change-Id: Iaf468166793e0cabb514b51c827b30317bf45a2d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Destroy QWindowContainer's fake parent window when not neededTor Arne Vestbø2018-11-281-0/+2
| | | | | | | | | | | | Keeping the fake parent window around in a created state means we're wasting system resources such as native platform views/windows, and makes it harder to debug the lifetime of these resources. The fake window will be re-created if re-parented into at a later point. Change-Id: Ib82560e7e565af19d58afe121fd087669a6ffb95 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QWindowContainer: Fix warning triggered by QT_ASCII_CAST_WARNFriedemann Kleint2018-11-281-1/+1
| | | | | | | Amends 52bd707f0d6a585c2f5da9565834eb91f1d3dbc8. Change-Id: Icc42edc7a943099b36bfa92fe7cd1a92db344991 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Improve logging of QWindowContainer operationsTor Arne Vestbø2018-11-231-0/+6
| | | | | | | | By explicitly identifying the fake window created for the window container. Change-Id: Id67a6e22588d04e68f5ede09bc078bb387c12e0b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-291-1/+1
| | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix build with -no-feature-graphicsviewPaul Olav Tvete2018-04-251-0/+1
| | | | | | Change-Id: Idddd353695d2a24ed90c29f557abfedf11d82fbc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-041-2/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/corelib/global/qglobal.h src/corelib/tools/qcryptographichash.cpp src/corelib/tools/qcryptographichash.h src/corelib/tools/qmessageauthenticationcode.cpp src/plugins/platforms/windows/qwindowswindow.h tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
| * Fix crash when reparenting window containerPaul Olav Tvete2017-09-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowContainer assumed that a widget could never change from native to non-native. This is not a fact when the window container is reparented to toplevel and back. In this case, usesNativeWidgets would be stuck at true, and parentWasChanged() would go down the native widget path, triggering an assert. The solution is to always recalculate the usesNativeWidgets bool. Task-number: QTBUG-63168 Change-Id: I88178259878ace9eb5de2ee45ff5e69b170da71c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-1/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| * Convert features.mdiarea to QT_[REQUIRE_]CONFIGStephan Binner2017-09-111-1/+3
| | | | | | | | | | Change-Id: I6d2ec035a218869aa6595f5848de94ce491d3124 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-061-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
| * Convert features.scrollarea to QT_[REQUIRE_]CONFIGStephan Binner2017-09-041-1/+1
| | | | | | | | | | Change-Id: Ifc7b0a6b025c282234b4aeaf23daecff8a558236 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-021-0/+8
|\| | | | | | | Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
| * Make QPlatformSurface events work with QWindowContainerLaszlo Agocs2017-02-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Embeddeding a QWindow via QWidget::createWindowContainer() fails to deliver the SurfaceAboutToBeDestroyed event. This breaks any OpenGL or Vulkan based QWindow that releases resources upon this event, and is particularly critical with Vulkan where the only way to do properly ordered swapchain - surface cleanup is via this event. In the non-embedded case close() eventually ends up in an explicit destroy() in QWindow. In the embedded case destroy() only gets called from ~QWindow. This then silently breaks since the subclass' reimplemented event() virtual is not getting called anymore. To remedy the problem, simply add an explicit destroy() to QWindowContainer. Task-number: QTBUG-55166 Change-Id: I1671e8f4d39f6c44e19eca7b9387f55fe3788294 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Enable QWindowContainer on AndroidLaszlo Agocs2017-02-271-0/+13
|/ | | | | | | | | | [ChangeLog][Platform Specific Changes][Android] QWidget::createWindowContainer() is now supported on Android for embedding OpenGL-based QWindows into widget UIs. Task-number: QTBUG-59175 Change-Id: I84d3703bcd44c63b1fdfe6772b7f3de9d5c18ddf Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* fix build with various QT_NO_* definesNick Shaforostoff2016-08-261-3/+6
| | | | | | | Done-with: Andriy Gerasika <andriy.gerasika@gmail.com> Change-Id: I90883a491dbddb005c3d756c339e42285d50e437 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-0/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QtWidgets: includemocsMarc Mutz2016-03-181-0/+2
| | | | | | | | | | | | | | | | A very simple way to save ~3KiB in test size and 440b in data size on GCC 5.3 Linux AMD64 release builds. Change-Id: I6619148cc497116b9772a00e1bc30d573a2b2534 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-021-2/+9
|\| | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/plugins/platforms/cocoa/qcocoahelpers.mm src/tools/qlalr/cppgenerator.cpp Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
| * QtWidgets: Allow to cover up the window container by another widgetBłażej Szczygieł2016-01-281-2/+9
| | | | | | | | | | | | | | | | | | | | When the window container already has a window handle, allow embedded windows to use this handle as a parent. This change will allow proper window stacking and clipping. Task-number: QTBUG-50477 Change-Id: I8d656ecb99e0c42ae7a7ac461e5e5b5d801f5493 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtWidgets: use Q_UNLIKELY for every qWarning() (2)Marc Mutz2015-11-251-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qWarning(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. This change contains the changes to the accessible/, effects/, kernel/, styles/ and itemviews/ subdirs. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In QWidgetPrivate::setWindowModified_helper(), as a drive-by, I swapped the evaluation order of an &&-expression (newly wrapped in Q_UNLIKELY) to be more readable and more efficient (cheaper check first) at the same time. In qDraw* (qdrawutil.cpp), simplified boolean expressions (sometimes by skipping re-checking conditions already checked in a previous guard clause). Change-Id: I58be22be0a33522c2629a66c2f6c795771a99f3f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Avoid triggering OpenGL initialization for RasterSurfaceJohn Lindgren2015-10-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | Application that do not require OpenGL need a way to opt-out of GLX/EGL calls completely. The initialization can be expensive and what is more, some systems may not have functional GLX at all (some VMs are known to crash when trying to get FBConfigs for the window). QApplication already has AA_ForceRasterWidgets, which causes the use of plain RasterSurface everywhere instead of RasterGLSurface. Combined with a trivial check in the xcb backend to skip all the Xlib+GLX/EGL path, the attribute will allow apps to ensure that no GLX/EGL calls are ever made. This however implies a change in QWindowContainer: the embedded window must use the same initialization path as the parent otherwise we will end up with a BadMatch. QWindowContainer can do this transparently to the applications, unless the QWindow is already created. Change-Id: I846af7edb8b92b9836cdbd93c6a5eec5a6147a49 Task-number: QTBUG-46765 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QWindowContainer: Restrict check for negative position to child windows.Friedemann Kleint2015-02-031-1/+1
| | | | | | | | | | | Otherwise, the code triggers for top level windows in setups with multimonitors where the primary screen is on the right and the left monitor has negative coordinates. Task-number: QTBUG-43879 Task-number: QTBUG-38475 Change-Id: Ied3ee6dc59bd784e11db22031d2090cc6f42ef8b Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-2/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * Make QWindowContainer handle drag'n'dropAllan Sandfeld Jensen2014-08-201-0/+8
| | | | | | | | | | | | | | | | | | | | Drag'n'drop events were not propagated by a the QWindowContainer to the embedded QWindow. This patch makes the widget accept the events and pass them on Task-number: QTBUG-40603 Change-Id: I97320fbcad27f7c6aa48c95c90bb42dda634764e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix build with QT_NO_MDIAREASérgio Martins2014-08-121-2/+5
| | | | | | | | | | Change-Id: I456fea53f641476ea63cbe170cc65811c92eb290 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | 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>
* Widgets going "undercover" should also undercover the QWindowJan Arve Saether2014-04-301-2/+9
| | | | | | | | | | | | | | | Sometimes Qt wants to hide a widget without calling setVisible(false). This is usually done by setting the widgets geometry outside the parents clip rect (and usually by setting its y coordinate to a sufficiently negative y coordinate). QSplitter uses this when it needs to collapse its children. Previously the QWindow was just moved straight above the QWidget it was hosted in. Task-number: QTBUG-38475 Change-Id: I154dd4d13f108c3d34c64eadb41dd6b477dc5c4e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Normalize signal & slot signatures in connectionThiago Macieira2014-02-221-1/+1
| | | | | | | | | | | Profiling showed that Qt Creator spent 2% of its load time normalizing signals and slots. By pre-normalizing everything, we ensure that there is no runtime cost. Profiling after this commit and the others in this series shows that the cost dropped down to zero. Change-Id: Ifc5a2c2552e245fb9a5f31514e9dd683c5c55327 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Make QWindowContainer accessibleFrederik Gladhorn2014-02-051-1/+5
| | | | | Change-Id: I93451b8842648db0815c96d64d319daecb45f0de Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-11-201-3/+16
|\ | | | | | | | | | | | | Conflicts: configure Change-Id: I0d31f23483ea67c4cac5af16014366e1ba5ac093
| * Fix crash when windowcontainer is used in a dockwidgetGunnar Sletta2013-11-201-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | The dockwidget's toplevel window would be a parent of the container's window when floating. When plugged back into the mainwindow the dockwidget's window is destroyed and the container's window along with it. Added a function toplevelAboutToBeDestroyed to unparent the containers window before this happens so parentWasChanged will work correctly. Change-Id: I06679cfb3a8fa3834c0db0be5973c012b8277275 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Clear focus from active widget when windowcontainer gets focus.Gunnar Sletta2013-11-191-0/+5
|/ | | | | | Task-number: QTBUG-31853 Change-Id: If0d29ee0a125464b32be99332502473b7c626bb0 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Better QWindowContainer by not relying on native widgets.Gunnar Sletta2013-10-221-23/+150
| | | | | | | | | | | | | We change the behavior slightly from the initial implementation in 5.1. Forcing the use of native child widgets is causing massive performance issues so instead, we attach the embedded QWindow directly to the root window. The only exception is QScrollArea and QMdiArea which still enforces native windows for the entire parent chain to make clipping and stacking work. Task-number: QTBUG-34138 Change-Id: If713637bd4dce630552ace2f8ad6b2e86c063721 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-191-1/+1
| | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introducing QWidget::createWindowContainer()Gunnar Sletta2013-01-251-0/+218
A QWidget that can embed a QWindow. This can be used to embed a QWindow/QOpenGLContext based window or a full QQuickView. Change-Id: I8415b5ae38562fc00b46150fa70b56fd9b19a80c Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>