aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qquickwidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reinitialize in QQuickWidget properly after hide and showLaszlo Agocs2014-08-141-22/+29
| | | | | | | | | hide() followed by a show() results in totally broken QQuickWidgets due to not initializing scenegraph again. Task-number: QTBUG-40710 Change-Id: Id3cded2917d20c165b5885f3f2195d5c4566de89 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add QQuickWidget::setClearColor()Laszlo Agocs2014-08-131-0/+19
| | | | | | | | | | | | | | And make qquickviewcomparison able to demonstrate how to create a partially transparent QQuickWidget. Avoid also recreating the QQuickView/QQuickWidget multiple times when switching between the radio buttons. [ChangeLog] Added QQuickWidget::setClearColor() in order to support semi-transparent QQuickWidgets. Change-Id: I319ad4afbe909530274d09f2a7fcff23730d6ebd Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Finish render() support for QQuickWidgetLaszlo Agocs2014-08-111-6/+10
| | | | | | | | | The enablers are already in. Now we just need to use the virtual in QQuickWidgetPrivate and test it. Task-number: QTBUG-39562 Change-Id: I1faf5a0a244ba4169fb8f9b0dae657304038b60e Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Rename QQuickRenderControl::stop() to invalidate()Laszlo Agocs2014-08-071-6/+6
| | | | | | | To be consistent. Change-Id: Ia78bf4a27e8ccb1a4f0a44865e810f1070c39e5d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use the renamed qt_gl_global_share_contextJocelyn Turcotte2014-08-051-2/+2
| | | | | Change-Id: I438c33a1dc83fd0cd1ec08bb4e4a1257a3216ca2 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix segfault on certain resize patterns in QQuickWidgetLaszlo Agocs2014-07-071-1/+8
| | | | | | | | | | Resizing to an empty size followed by another resize leads to sync() without having the context and the render control intialized. This is wrong. Task-number: QTBUG-39858 Change-Id: I5908723272165a656d192644cceb16ed253e6d3b Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Add grabFramebuffer() to QQuickWidget and use it in the autotestLaszlo Agocs2014-07-011-0/+15
| | | | | | | | | | | | | | This introduces the need for a grab function in QQuickWidget. The render control has one already so there is no reason for not exposing this in QQuickWidget too. This also means that a relatively meaningful autotest can be now be added. [ChangeLog][QtQuick] Added QQuickWidget::grabFramebuffer() for capturing the content into a QImage. Task-number: QTBUG-37589 Change-Id: I5ca8192c0ef8dab4f076a4db27b64aebe3359bb8 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Make QQuickRenderControl publicLaszlo Agocs2014-06-241-13/+14
| | | | | | | | | | | | QQuickRenderControl allows rendering Qt Quick 2 scenes into framebuffer objects which can then be used in arbitrary ways in Qt-based or 3rd party OpenGL renderers. [ChangeLog][QtQuick] Introduced QQuickRenderControl as a public API. Task-number: QTBUG-37944 Change-Id: I84262243b261b35cefdf67ec6bba8127a0f29275 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devSimon Hausmann2014-06-131-21/+52
|\ | | | | | | | | | | | | Conflicts: src/quickwidgets/qquickwidget.cpp Change-Id: Id4b080aea713df68608847bb82570231e37ce536
| * Set StrongFocus on QQuickWidgetLaszlo Agocs2014-06-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Make text input functional out of the box. Both QGraphicsView and QDeclarativeView (QQuick1) do this so there is no reason to do this differently for QQuickWidget. For QQuickWindow and QQuickView the issue does not exist in the first place, they will accept the focus by default. Task-number: QTBUG-39605 Change-Id: I74f01b85342df51aa3c0e80baf58ba1619c63438 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Drag&Drop support for child items in QQuickWidgetPaul Olav Tvete2014-06-101-1/+6
| | | | | | | | | | | | | | | | This is a quick-fix. The real issue is that QWidget and QWindow reacts differently when a QDragEnterEvent is rejected. Change-Id: I3e3e50610c14acfaada9c1b243b88cfe9eae54b2 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Add support for multisampling in QQuickWidgetLaszlo Agocs2014-06-061-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a multisampled fbo when the requested format has samples > 0. Resolving happens after each rendering of the scene. The blit to the temporary non-multisampled fbo could be avoided, in theory, by sending the fbo instead of the texture id down the stack and performing a blit directly to fbo #0. This however involves a number of potential issues, for example due to the non-sharability of FBOs between contexts. Hence it is left as a future exercise. Task-number: QTBUG-39187 Change-Id: Iae98b969bcbc3bb57e6d73288496f5428913c826 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix QQuickWidget offscreen surface format and creation orderLaszlo Agocs2014-06-051-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create the QOffscreenSurface together with, and after, the QOpenGLContext. This is essential to get a surface that is compatible with the context and is in line with the QOffscreenSurface usage recommendation from the docs. Otherwise, if the offscreen surface gets created first, without knowing what _actual_ format (e.g. EGL configuration) the context will use, the result is an incompatible surface and context on systems that offer a different set of configurations for window and pbuffer surfaces. This fixes QQuickWidget on EGL implementations that offer both 16 and 24 bit pbuffer configs, but only 24 (or 32) bit window configs. Task-number: QTBUG-39474 Change-Id: I43925d2b25e28d26d172ce9d22651c25b281b832 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| * Detect and warn when using QQuickWidget as a native childLaszlo Agocs2014-06-051-0/+6
| | | | | | | | | | | | | | This is not supported. Change-Id: I19ed485ee629baa4f3631770ab0c730e0ef6748e Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-06-041-20/+41
|\| | | | | | | | | | | | | | | | | | | | | | | | | The merge conflict is about the removal of "d1" from the register set on ARM, but that was already done in dev in commit ddb33ee9ba9e1344caa9be5dbf4b534c3ede692e The change in src/quick/scenegraph/coreapi/qsgrenderer.cpp with commit 2414f1675eab163b22dcc4e8ded80ed04d06369b was reverted to what it was before, per Laszlo's advice. Conflicts: src/qml/jit/qv4isel_masm.cpp Change-Id: I7bce546c5cdee01e37853a476d82279d4e72948b
| * Make QQuickRenderControl usable (still private)Paul Olav Tvete2014-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | QQuickRenderControl needs a QQuickWindow in order to function. This required the use of a private QQuickWindow constructor, meaning that only friend classes of QQuickWindow could use QQuickRenderControl. This change adds a factory function, QQuickRenderControl::createOffscreenWindow(). Task-number: QTBUG-38996 Change-Id: I92f6f1f60045934f3dd33c300352247852463c73 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Destroy the FBO in QQuickWidget while a context is currentLaszlo Agocs2014-06-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When creating the new FBO, it will try to restore the previous FBO after initialization. The internal tracking of the current FBO goes horribly wrong when a QOpenGLFramebufferObject is destroyed with no context current. In 5.4 the problem is solved by removing the tracking altogether. Here QQuickWidget is fixed to play nice and destroy QOpenGLFramebufferObject always with the context current. Task-number: QTBUG-39389 Change-Id: Ic6917696ed61f284d661a578c9c7f2e0673c412d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Fix QQuickWidget cleanup and invalidation sequenceLaszlo Agocs2014-06-031-16/+24
| | | | | | | | | | | | | | | | | | Make sure the context/surface are still alive and current while destroying the render control. Task-number: QTBUG-39034 Change-Id: I6ff0069985a9121a63025bfb165493b3f003391d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * QQuickWidget: Support drag and dropPaul Olav Tvete2014-05-271-1/+14
| | | | | | | | | | | | | | | | Relay drag/drop events to the offscreen QQuickWindow. Task-number: QTBUG-39167 Change-Id: Iaf59fb899d16ac96fc94f1df8c3a939e9bd0f92f Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Avoid direct GL calls in QuickLaszlo Agocs2014-05-231-2/+2
|/ | | | | Change-Id: I9b8673fb3292c9d5ad2f9e8e63f56dc661699be6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Don't crash on AndroidPaul Olav Tvete2014-05-211-1/+7
| | | | | | | | | | | | | If the platform plugin does not support the features needed for QQuickWidget, then don't try to use it. This is a minimal change to stop applications from crashing: it does not give the application a way to find out if QQuickWidget is supported, since that would mean new API, which we can't do in a patch release. Task-number: QTBUG-38268 Change-Id: I975a03b105b1d5c21a1d8ae440a5802ce8c1967b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Focus event fix for QQuickWidgetPaul Olav Tvete2014-05-211-0/+14
| | | | | | | | | | Relay focus in/out events to the offscreen QQuickWindow, and also make the offscreen window believe it has the focus when the render window has it. Task-number: QTBUG-39033 Change-Id: Ib50b134e635833ad3813693ca272f04607c525b8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Follow QOpenGLContext API renamingLaszlo Agocs2014-04-251-1/+1
| | | | | | Task-number: QTBUG-38564 Change-Id: Ice1170339f7d650fcb6accfccf325471629343d6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Getting the render window of an offscreen windowPaul Olav Tvete2014-04-241-5/+19
| | | | | | | | | | When using a QQuickWidget, the QQuickWindow is hidden and the contents are displayed in another window. Some components need to query the actual window, e.g. when positioning a popup. Task-number: QTBUG-38116 Change-Id: I34452be2179ccc9e216e4d89264dc700e0cf42a0 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use global context sharing from QtGui instead of QSGContextJocelyn Turcotte2014-04-041-2/+2
| | | | | | | | | This removes QSGContext::sharedOpenGLContext and replace its uses with QOpenGLContextPrivate::globalShareContext, which is also going to be used by QOpenGLWidget and QQuickWidget. Change-Id: I1e296c3e6832f717caaf31ba7d7b27c06249219b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: Add a module page for Qt Quick WidgetsTopi Reinio2014-03-281-1/+18
| | | | | | | | | | | | Although the documentation is part of Qt Quick, a separate module page with a \qtvariable command is still needed to have correct information about which module to link against. Task-number: QTBUG-37272 Change-Id: Ie00e9418be4feec299cb36c526ca366504c89008 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix some documentation errors.Friedemann Kleint2014-03-241-2/+2
| | | | | Change-Id: I5d4b3e26742202c4b634d0001fd3658c7263c50a Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* QQuickWidget: Fix SizeViewToRootObjectPaul Olav Tvete2014-03-191-13/+9
| | | | | | | | | There were two problems: 1) QWidget does not have a default size of (0,0) or (1,1), but uses WA_Resized. 2) event() would eat timer events without checking the timerId. Change-Id: I355acbb10d3d5073e117c29de18bb94857881141 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Set correct FBO size for devicePixelRatio != 1Morten Johan Sørvig2014-03-191-1/+1
| | | | | Change-Id: I3cc584e8ff980cd4328639a5e98241713a13cb04 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Add surface format to QQuickWidget.Laszlo Agocs2014-03-181-3/+51
| | | | | Change-Id: Id72a042588e37832a0d3757bad935c531ef8275a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Move Qt Quick Widgets example and document itTopi Reinio2014-03-141-1/+1
| | | | | | | | | | | | | | | Because QtQuickWidgets is part of Qt Quick module documentation, its examples need to also be moved under the examples/quick directory structure. This change moves the example, creates minimal documentation for it, and adds a link to it from the QQuickWidget class reference. Task-number: QTBUG-37272 Change-Id: Iffb67849f150b9aaf0edaef5852364e93f7752b8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Consolidate context creation failure handling in Quick.Friedemann Kleint2014-03-131-1/+44
| | | | | | | | | Add QQuickWidget::sceneGraphError() equivalent to QQuickWindow::sceneGraphError(), move message formatting code to QQuickWindowPrivate. Change-Id: I18cd4d7e0f6ee1011c29375218dc6a044b0d2cf2 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWindow cleanup: Remove forceRendering flagPaul Olav Tvete2014-03-121-5/+3
| | | | | | | | | | | forceRendering was introduced for QQuickWidget, but QQuickWidget now has full control of when the rendering functions are called. It makes more sense to not call the QQuickRenderControl functions, than to set a flag on QQuickWidget that decides whether those functions have any effect. Change-Id: I69819b13000120c04cecd1a467c08e8df9330df8 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Doc: Fix issues in QQuickWidget documentationTopi Reinio2014-03-111-14/+19
| | | | | | | | | | Fix qdoc warnings, do some editing and cross-link between QQuickWidget and QQuickView class references. Task-number: QTBUG-37272 Change-Id: I48d3a01e7c6315be329e24a5c5f7635697629316 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QQuickWidget: handle resize to empty sizePaul Olav Tvete2014-03-101-0/+14
| | | | | | | | | | | Resizing to an empty size needs to be handled as if the widget was hidden. Restoring to a non-empty size is like a show, except that we are rendering synchronously. Task-number: QTBUG-37046 Change-Id: I572e4763c4a28bfe7347868e109acca5b357db50 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QQuickWidget: handle windowChangePaul Olav Tvete2014-03-071-4/+25
| | | | | | | | When the toplevel window changes, QQuickWidget needs to recreate the context so it is compatible with the new window. Change-Id: Ic7c3410061a33f223e20e3d1f93437917abcff18 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWidget: make sure to use the proper GL formatPaul Olav Tvete2014-03-071-19/+12
| | | | | | | | | | We cannot be sure that the toplevel widget has the correct GL format, and we do not want to force depth and stencil buffers on surfaces that do not need them. Therefore, we have to create an offscreen surface for the FBO. Change-Id: I7dfc3a6f84bf79125f3ab811a204972e95e245a3 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* QQuickWidget: handle hide and show events properlyPaul Olav Tvete2014-02-281-4/+13
| | | | | | Task-number: QTBUG-37062 Change-Id: I3763385168eaa0ccd009ada563f56ea0251029a5 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Add double-click to QQuickWidgetUlf Hermann2014-02-251-0/+15
| | | | | | Task-number: QTBUG-36935 Change-Id: I498561f6bbd5a9b279034d16ef5ae4fb36607ed3 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add touch and wheel events to QQuickWidgetLaszlo Agocs2014-02-211-1/+30
| | | | | Change-Id: Idb444cbc62491469230c5a1f624d71cf20bce492 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix missing depth and stencil buffer in QQuickWidgetLaszlo Agocs2014-02-211-2/+12
| | | | | Change-Id: I34f2015d63d3052b401a82bb4ac7340af94dca8c Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Avoid extra platformwindows with QQuickWidgetLaszlo Agocs2014-02-211-8/+24
| | | | | | | | | | | | QQuickWidget is nice but does not work on platforms like eglfs because it always creates a (hidden) platform window for the QQuickWindow. This is now fixed by avoiding calling create() on the window and using the toplevel window of the QQuickWidget instead. Change-Id: Ia552f7a16d8b913fb798fde04b9304c6d037a46c Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Update QQuickWidget docs and changelogLaszlo Agocs2014-02-201-5/+15
| | | | | Change-Id: I853295f31cf9367a8e11157c9ef0764174c614cf Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Properly export QQuickProfilerUlf Hermann2014-02-171-4/+0
| | | | | | | | | We want to access the profiler from quickwidgets as well as from quick itself. Also, use better syntax for includes in qquickprofiler_p.h Change-Id: Ifee04bae84521e8f028e7e2d272824449338b88a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Introducing QQuickWidgetLars Knoll2014-02-171-0/+785
Renders into an FBO, and provides a texture that is composed by the QPA/widget kernel compositor. Also introducing QQuickRenderControl, which is private API for now. Change-Id: I710c16e1506124a17f91e87344496471803a448b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>