aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qquickwidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash when grabbing a QQuickWidget before it is shown.Friedemann Kleint2015-12-151-6/+7
| | | | | | | | Do not access null share contexts. Task-number: QTBUG-49929 Change-Id: I1c88563df71dd6c5d186b6f2ae147614fcc6ded9 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QQuickWidget: Update position of offscreen window in show().Friedemann Kleint2015-12-151-0/+1
| | | | | | | | | | The position of the offscreen window needs to be exact as it is used for popup menus by the Quick Controls. Updating the position in show amends the situation. Task-number: QTBUG-49097 Change-Id: I416021d6632ede45b1f9dc6b35a3ff15394566ee Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Make QQuickWidget update inside a proxy widgetLaszlo Agocs2015-12-081-1/+8
| | | | | | | | | | | | | Performance will be bad but this allows having simple scenes in a QQuickWidget embedded into a QGraphicsView (ouch). This kind of setup is strongly discouraged but QWidget already has the readback-based fallback for render(), so we only need to add the update re-routing to the proxy widget. Task-number: QTBUG-49724 Change-Id: I1c80cb0a7b401327304ec7b92c77dc654d843b33 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Create proper offscreen surface the first timePaul Olav Tvete2015-11-271-3/+5
| | | | | | | | | | | Make sure the context is correct the first time we create the offscreenSurface, so we don't have to destroy it immediately afterwards and create a new one. This causes problems with some (probably buggy) drivers. Task-number: QTBUG-48440 Change-Id: I4790e1b02738fc84aca201430548934d8054e2b2 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-1/+6
|\ | | | | | | | | | | | | Conflicts: src/quick/util/qquickimageprovider.cpp Change-Id: I7ca4e49468b5ba697208287be4684e42b9900023
| * Doc: added documentation to undocumented functionsNico Vertriest2015-11-021-1/+6
| | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I219375d405fbfb53611c0138698e955d9cd5d821 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | QQuickWidget: Emulate visibility for offscreen windowUlf Hermann2015-11-161-0/+30
| | | | | | | | | | | | | | | | | | The "visibility" and "visible" properties are exported to QML and should return useful values. Task-number: QTBUG-49054 Change-Id: I3c474885653c4b57659b02f183293e3186edc972 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-1/+6
|\| | | | | | | | | | | | | Conflicts: src/quickwidgets/qquickwidget.cpp Change-Id: I3e2326bc86a9d3adaafbe3830b75ce9afa81c45b
| * Assert that context exists in QQuickWidgetPrivate::renderRobert Loehning2015-09-221-0/+2
| | | | | | | | | | | | Task-number: QTCREATORBUG-15040 Change-Id: I401aec030840175efda2e2f0ec60569ce9c46b02 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Don't try to render directly without context in showEventRobert Loehning2015-09-221-1/+4
| | | | | | | | | | | | | | | | | | | | Partially reverting db525935ccd64d2c5c674f8a66dbe7096d754e9f Task-number: QTCREATORBUG-15040 Change-Id: I6ced42a3d00bb1c419b2b0d4729bc4f5f3cf8bc7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Fix up flawed TranslucentBackground usage in docs and examplesLaszlo Agocs2015-09-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the qtbase fixes, start doing things correctly in the QQuickWidget examples too. Remove the checkbox and use a --transparent command line argument (like in hellogl2). In addition --transparent --no_render_alpha can be used to verify the most problematic case: when alpha is present and the backingstore contains semi-transparent pixels in places where the underlying QOpenGLWidget is opaque. Here the result must still be an opaque pixel. This was previously ensured by a glColorMask call, now replaced by glBlendFuncSeparate in QPlatformBackingStore. Task-number: QTBUG-47276 Change-Id: Ia040f899405f73e95e957becee5df43683af9c39 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QQuickWidget: do not render when there is no fbo due to no sizeLaszlo Agocs2015-09-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | It is not invalid to have a widget with a 0,0 size. The FBO logic already handles this: no FBO is created in this case, it will be done on a subsequent resize. However, we can still get to render() which is not currently prepared to handle this case. Correct this. Task-number: QTBUG-47588 Task-number: QTBUG-48059 Change-Id: Idd674c536847e5f293fec5a40aa3038600473c27 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | QQuickView/QQuickWidget::errors(): fix crashJ-P Nurmi2015-09-031-1/+1
| | | | | | | | | | | | Change-Id: Ie37ed5fac642931b658d2b738ddd45d23cda54c6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-041-5/+7
| | | | | | | | | | | | | | | | | | This will allow us to remove the instance() methods and create the services from factories in plugins. Also, it allows us to remove the isDebugging member from QQmlEnginePrivate. Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Extract minimal abstract interfaces from debug services.Ulf Hermann2015-08-041-2/+2
| | | | | | | | | | | | | | | | We will access the services' functionality through those interfaces once they live in their own plugins. Change-Id: I0a0d7e73c07cb874b3b507cc4a9d304588c87bca Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Avoid multisampled contexts in QQuickWidgetLaszlo Agocs2015-08-041-1/+10
| | | | | | | | | | | | | | | | | | | | Like with QOpenGLWidget, not requesting a multisampled context unnecessarily avoids crashing with Mesa/Intel/EGL (f.ex. in the qquickviewcomparison example when enabling multisampling). Task-number: QTBUG-47509 Change-Id: Ia22110332f639a238cfb3b2c36916f65c00a7bbc Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* | Extract minimal interface from QQmlDebugServer and use it.Ulf Hermann2015-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | This will allow us to move QQmlDebugServer into a plugin. The new QQmlDebugServer is the interface exposed to connection plugins. The interface exposed to services is renamed to QQmlDebugConnector, as technically it doesn't have to be a "server". Change-Id: Id508b8c0a6960228e889f45a437b73060392db39 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove static proxy methods from QQmlDebugServiceUlf Hermann2015-07-291-2/+3
| | | | | | | | | | | | | | | | | | They all internally map to one-liners and just add to binary size and complexity. Especially, the most used one, isDebuggingEnabled(), simply checks if there is a QQmlDebugServer::instance(). Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-301-1/+8
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/quick/items/qquickitemsmodule.cpp tools/qml/main.cpp Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
| * Redirect the default FBO correctly with QQuickWidgetLaszlo Agocs2015-06-031-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similarly to QOpenGLWidget, functions like QOpenGLFramebufferObject::bindDefault() should bind the QQuickWidget's FBO, not 0, while rendering the scene graph. This becomes particularly important on platforms with surfaceless context support. Here offscreen surfaces are not backed by any surface. Therefore any OpenGL operation accessing the current draw framebuffer with FBO 0 bound may potentially crash, as there is no draw framebuffer at all. The distance field glyph cache exhibits this issue when running with EGL on Mesa: glViewport crashes when we render via QQuickWidget and the current framebuffer is reset to 0. The problem goes away when the code changed is to use bindDefault() - as it should have anyhow - and QQuickWidget is enhanced to communicate the "default" framebuffer to QOpenGLContext, just like QOpenGLWidget does. Task-number: QTBUG-46415 Task-number: QTBUG-43269 Change-Id: I35fe375a0870dadecc4a074dfdec122c6a4c92ab Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-041-3/+13
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/quick/items/qquickitemsmodule.cpp src/quick/items/qquicktext.cpp src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/tst_qquickwindow.cpp Change-Id: I90ecaad6a4bfaa4f36149a7463f4d7141f4a516a
| * Fix flickering when QQuickWidget becomes visibleJoni Poikelin2015-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | QQuickWidget used short delay before rendering. This caused black area to flash on the widget briefly. Instead of scheduling redraw, render scene immediately. Task-number: QTBUG-46387 Change-Id: I342d96a1aaef3244190221807b0d816815697623 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Create contexts and pbuffers with the correct screen in QQuickWidgetLaszlo Agocs2015-05-121-2/+12
| | | | | | | | | | Change-Id: I8e9db998eee0af5f62c1384f2dcb2028254cc642 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-1/+46
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlbinding.cpp src/qml/jsruntime/qv4arraybuffer.cpp src/qml/jsruntime/qv4functionobject.cpp Change-Id: Ic752e9dfd69b282093651c9234c110a49762f06d
| * Support sRGB for text with QQuickWidgetLaszlo Agocs2015-04-161-0/+21
| | | | | | | | | | | | | | | | | | Otherwise we get visually different results with QQuickWindow and QQuickWidget on OS X. Task-number: QTBUG-42861 Change-Id: Icbf6f6e980129f5de73a88e7be7bef4f592e875e Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Match the offscreen windows position to the QQuickWidget position.Christian Strømme2015-04-131-1/+25
| | | | | | | | | | | | | | | | | | | | The position of the offscreen window would always be set to 0,0, making it impossible to get the actual position of the scene. With this change, it will be possible for child windows or items in the scene to correctly calculate their global position. Change-Id: Ibd3ff03880209047776e86ad889b40cbf79c3e6e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-131-1/+20
|\| | | | | | | | | | | | | | | Conflicts: src/quick/util/qquickpixmapcache.cpp tests/auto/quick/qquickwindow/BLACKLIST Change-Id: Ie81612f2884f8ea508c48ba2735ec54ea1c2eca5
| * QQuickWidget: expose the underlying QQuickWindowGiuseppe D'Angelo2015-03-271-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | There's a number of APIs (such as all the scenegraph-related signals) that are currently missing from QQuickWidget. Instead of duplicating every API in QQuickWidget, simply expose the underlying offscreen QQuickWindow. Task-number: QTBUG-45260 Change-Id: I1a89fe600ce675963ea24ee6dd56d6ca4fea9cd2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Fix flushing QQuickWidgetLaszlo Agocs2015-03-261-1/+1
| | | | | | | | | | | | | | | | Like it was done for QOpenGLWidget. Task-number: QTBUG-45106 Change-Id: I69c11f53f781f57ceebb9b7ed95a2753bff31492 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-171-1/+2
|\| | | | | | | Change-Id: I6033aba359ac551f450ad517d20a0986bf4655f6
| * Add missing flush for multisampled QQuickWidgetLaszlo Agocs2015-03-091-1/+2
| | | | | | | | | | | | | | | | | | Otherwise we might be using a half-ready texture when performing compositing. The issue was very visible on OS X at least. Task-number: QTBUG-39917 Change-Id: I71326cb99567f458a6ca7a2cad322a315ee6674f Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | QQuickView/QQuickWidget: Improve diagnostics message for non-QQuickItem root ↵Robin Burchell2015-02-231-5/+2
| | | | | | | | | | | | | | | | | | | | fallback case. We don't want to recommend qmlscene, and QtQuick1 is being deprecated, so there's no need to spell it out anymore either. Change-Id: Ia4b87d1a4b3afdae9ea9c13a89ac5cb78c85f06d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | QQuickView/QQuickWidget: Improve diagnostics for using a QWindow as a base ↵Robin Burchell2015-02-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | item in a scene. The current message is rather confusing, as it was aimed at users porting from QtQuick 1 -- but it is perfectly possible to get a non-QQuickItem root in a QQuickView scene right now with QtQuick 2 only. Change-Id: Ibd800f8a817c874af5eaa1746567ee289988fd01 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | QQuickView/QQuickWidget: Report an error if rootObject ends up null.Robin Burchell2015-02-231-0/+7
|/ | | | | | | | | | | | This can happen when trying to use a non-QQuickItem item as the root item in a QQuickView, for instance, a Window or ApplicationWindow item. This generates a warning (correctly), but does not set an error state on the view, so automated tooling and the like does not know that the scene was not successfully loaded. Change-Id: I1dc4191ef07187e9b1929995aedb01c155b0957c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Update copyright headersJani Heikkinen2015-02-121-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. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Implement dnd support in QQuickWidget differentlyLaszlo Agocs2015-02-111-15/+36
| | | | | | | | This way subclasses can reimplement functions like dragEnterEvent(). Task-number: QTBUG-43821 Change-Id: I24bd14de8aab5ab741bc36330b4dcf7c83dedbf6 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Input method support for QQuickWidgetPaul Olav Tvete2014-12-111-0/+8
| | | | | | | | | | Make sure QGuiApplication::focusObject() returns the QQuickItem that has focus, and forward input method events. Task-number: QTBUG-42677 Change-Id: Ic07f93a2529c3dde67272b489bdc61fd25582a69 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Remove unnecessary doneCurrent in QQuickWidgetLaszlo Agocs2014-10-231-2/+0
| | | | | | | | | Excessive makeCurrent - doneCurrent pairs should be avoided. We already do this in QOpenGLWidget and the QPlatformBackingStore composition code. Remove the doneCurrent from QQuickWidget too. Change-Id: I6f998d381c33880c470f34d7c8462b6ed8cd8ae9 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix disfunctional QQuickRenderControl with multiple screensLaszlo Agocs2014-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | Having a retina and non-retina screen connected resulted in getting no output from QQuickRenderControl and QQuickWidget on the non-retina screen. This is caused by the fact that Quick is blindly calling QWindow::devicePixelRatio(). This approach is wrong when using QQuickRenderControl since the QQuickWindow does not have an actual native window and so devicePixelRatio() merely returns some default value which will definitely be wrong for one of the screens. The patch fixes the problem by introducing QQuickWindow::effectiveDevicePixelRatio(), which, via QQuickRenderControl::renderWindowFor, supports the redirected case too. Task-number: QTBUG-42114 Change-Id: I057e01f0a00758dde438fc9b10af3a435b06bb0b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Recreate the fbo on screen change in QQuickWidget when neededLaszlo Agocs2014-09-231-29/+33
| | | | | | | | | | | | Move the rendering code out into a separate function since it is now called from three places. Like in QOpenGLWidget, the FBO may need to be recreated with a different size in case the window is moved onto a screen with a different device pixel ratio. Change-Id: Iaaa42a06dab9e02710b0a7dafb0ea8c018b69ec2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add a note about winId() to QQuickWidgetLaszlo Agocs2014-09-171-0/+5
| | | | | | | | | This unfortunate function causes the creation of a native window which is very wrong. Task-number: QTBUG-40765 Change-Id: Ia08138cf35c240c883c63a66a54f949b86ccc2d2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Select specific features to be recorded when profiling QMLUlf Hermann2014-09-111-7/+7
| | | | | | | | | | | | Some features, like the memory profiler, create huge amounts of data. Often enough, we're not actually interested in all the data available from the profiler and collecting it all can lead to excessive memory consumption. This change enables us to optionally turn various aspects of QML profiling off. Task-number: QTBUG-41118 Change-Id: I7bb223414e24eb903124ffa6e0896af6ce974e49 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Enhance QQuickWidget docs regarding transparencyLaszlo Agocs2014-09-101-4/+20
| | | | | | | Provide a section similar to the one in the QOpenGLWidget docs. Change-Id: Ibe161f5b6e1b6654e78b522f44ba21b89fc85abe Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* QQuickWidget: Keep the offscreen quick window size in syncLaszlo Agocs2014-08-291-7/+9
| | | | | | | | | | | | | | | The resizing logic has some faults: The size change is not always communicated to the offscreen QQuickWindow. When hiding and showing a QQuickWidget we may return early from the resize event handler, skipping the geometry change for the offscreen window. This is wrong. To make sure the sizes always match, set the geometry together with the FBO creation instead. This is much more robust and guarantees that the FBO size and the QQuickWindow size will not be out of sync. Task-number: QTBUG-40517 Change-Id: I61ef3ad2d23dff4280dbf03b57c03c1aeda8dc91 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix not having a context when making a QQuickWidget visible againLaszlo Agocs2014-08-271-9/+7
| | | | | | | | | | | | | | | | If we hit the size-is-zero path, the condition that got recently introduced (if fakeHidden && d->context) is not really sufficient. It could be that d->context is valid but the scenegraph is invalidated (i.e. offscreenWindow->openglContext() is null). This case has to be handled the same way. Therefore, the function is now simplified to perform polish & sync in one place. Task-number: QTBUG-40794 Change-Id: Ia54f25fbdc199a0b88501a2d89edb5cee5411972 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Avoid creating fbo with zero size in QQuickWidgetLaszlo Agocs2014-08-221-0/+5
| | | | | | | Get rid of incomplete attachment warnings on Android. Change-Id: I7da546861b1814677b0c8ae110416f69bbbb7edc Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix flicker when showing QQuickWidgetLaszlo Agocs2014-08-141-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This also reintroduces the change from commit 14b4747b17d522fe57f3a5f21738c5a89323b5e2. Due to some bizarre merge issue that change has disappeared from qquickwidget.cpp and its history. It is there in the main log, though. The new fix depends on this older one, so the combined one fixes the following three issues: 1. Polish and sync cannot be skipped when we are rendering for the first time. 2. Recreating the fbo twice when the widget is shown. Calling createFramebufferObject() is not necessary in this case since createContext() will trigger this anyhow due to scenegraphInitialized(). 3. Avoid recreating the fbo when the size is the same as before. Some platforms are keen on sending resize events with the same size. These should be ignored. What's worse, some platforms (cocoa) generate a resize on exitting (Cmd-Q) and not ignoring the resize at that stage is dangerous since the scenegraph is already invalidated. Task-number: QTBUG-40710 Task-number: QTBUG-40505 Change-Id: I2e897acc68fa68233563a1db63ffb6c5d0baad73 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Propagate the accepted flag back in QQuickWidget mouse handlersLaszlo Agocs2014-08-141-0/+4
| | | | | | Task-number: QTBUG-40784 Change-Id: Ieff4b38358f241aebeb16ec877e05179b01cc004 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QQuickWidget: resolve samples also when rendering is triggered from resizeLaszlo Agocs2014-08-141-1/+6
| | | | | | | | The normal update path did the resolving properly. However when we re-render due to a resize, it was not done at all. Change-Id: I3d55be111a4338e8f3dbb1081972f47daca53b35 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>