aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Visualization modes for rendering.Gunnar Sletta2014-01-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways of setting this right now. One is to set it on startup using an environment varible. QSG_VISUALIZE= "batches" - Visualize batchtes in the renderer. Merged batches are drawn with solid color and Unmerged batches are drawn with a diagonal line pattern. Few unique colors means good batching. Unmerged batches are bad if they contain many individual nodes. "clip" - Visualize clipping as red areas on top of the scene. "overdraw" - Visualize all items in 3D to highlight overdraws. This mode can also be used to detect geometry outside the viewport to some extent. Opaque items are rendered with a green tint while translucent items are rendered with a red tint. The bounding box for the viewport is rendered in blue. Opaque content is easier for the scenegraph to process and it can also be faster to render on some hardware. "changes" - Changes in the scenegraph are visualized with a flashing overlay with a random color. Changes on a primitive is visualized with a solid color while changes in an ancestor, such as a matrix or opacity changes is visualized with a pattern. The second way to set the visualization mode is to set it at runtime through QString QQuickWindowPrivate::customRenderMode. This "API" is string based so it is not tied to the batch renderer and in theory can support other custom renderers. The visualized elements do not respect clipping and rendering order is arbitrary. Change-Id: I31efbe53fc905145bf48080ede3e36945cb60dcf Reviewed-by: Michael Brasser <michael.brasser@live.com>
* QQuickWindow: Make sure popups receive key events on MacGabriel de Dietrich2014-01-151-0/+2
| | | | | | Change-Id: Ifaf96e567e735d9a837eaef798061bf08fc4a752 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix touch to mouse synthesis/propagation.Robin Burchell2013-12-131-0/+1
| | | | | | | | | | | | | Having mouse events synthesised from both QtGui and internally in QtQuick is not a great way togo about things, especially when QtGui doesn't have the same degree of knowledge as QtQuick about the items in the scene. Thus, we now accept all events inside QtQuick to block QtGui synthesis, which should fix a significant amount of edge-case touch breakage/bad behavior. Change-Id: I14e1c87761c8f43160049b5e6f9da15b4e5edbb7 Done-with: Martin Jones <martin.jones@jollamobile.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* QQuickWindowPrivate: implement clearFocusObjectRichard Moe Gustavsen2013-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Ref change: cfa85c7 (qtbase) Implement QQuickWindowPrivate::clearFocus() to enable platform plugins to remove focus from the focus object when the virtual keyboard closes. On mobile platforms line edits etc are not supposed to be drawn with focus and blinking cursors unless the virtual keyboard (or another keyboard) is open. With the new virtual QWindowPrivate::clearFocus() the platforms can remove focus without deactivating the whole window. The old implementation on iOS deactivated the whole window when the keyboard was closed. But this was unfortunate, especially in QtQuick, since a qquicktextinput would not get active focus unless the window was active. But the platform would not activate the window unless the keybaord was open. So, a classic chicken - egg problem. Change-Id: I62e652a3cd85f1313713c5d086d9537cc2f9826f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-1/+1
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Animators - Render thread animation systemGunnar Sletta2013-09-211-0/+2
| | | | | | | | | | | | This introduces 6 new QML types for animating state in the scene graph when the UI thread is blocked. The QObject property being animated is updated after the animation completes. It works also with the "windows" and "basic" render loops, but offer litte benefit then compared to in the "threaded" case. Change-Id: Ic19e47c898c0b8bd53e457db922b3c9c457c8147 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Expose drag threshold in MouseAreaJens Bache-Wiig2013-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | In several cases such as for creating a Slider, it is useful to have a 0 pixel threshold in order to initiate a drag operation. We have previously hardcoded this to a platform dependent (usually 10 pixel) value for MouseArea. Note that we have no way of indicating the version/revision number in a grouped property for documentation at the moment. In addition we deliberately had to remove the REVISION from the property because it is blocked by QTBUG-33179. However, since this is not a user-creatable type it should not cause any issues in practice. This patch adds MouseArea.drag.threshold in order to improve on this. Change-Id: Ia4871e64fab39e30c4494f00be99ad38cdd630df Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Allow QtQuick private headers to be used with QT_NO_KEYWORDS.Jocelyn Turcotte2013-09-121-1/+1
| | | | | | | | | | | This is necessary for the QtWebEngine module. This also adds an empty nokeywords test using the same mechanism as qtbase/tests/auto/tools/moc/no-keywords.h to find conflicts at compile time. Change-Id: I9df541720797dd61f078178c2af68ead18ff8bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add support for external drag and drop in Quick items.Chris Meyer2013-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dragType enums with values of None, Automatic, Internal (default). Setting to Automatic allows startDrag to be called automatically. Setting to Internal (default) retains old behavior. Add mimeData to Drag item to enable external drags. Call startDrag to start drag manually or change from internal drag to external drag. Added events dragStarted and dragFinished that get invoked from startDrag. Mime data must be specified in the mimeData property as mime-type / data pairs. Moved QQuickDrag from qquickmousearea* files to qquickdrag* files to reduce header interdependencies that caused linking errors in other modules and also to improve code organization. Allow DropArea to receive and process external data. Introduced new variable containsDrag to QQuickDropAreaPrivate. This replaces mimeData which was previously being used to determine if a drop operation was currently occurring. The problem was that mimeData was being externally destructed. Also introduced accessor methods for getting color, html, image, text, and urls out of the drop. This facilitates dropping of external data of those types onto a DropArea. Added example quick/externaldraganddrop. Task-number: QTBUG-27498 Change-Id: I1420df7c161ea3399e49a23305273e106baa246f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Get rid of the first half of QQmlGuard usageLars Knoll2013-07-051-1/+0
| | | | | | | | | QQmlGuard was being used as a more performant replacement for QPointer. QPointer got now fixed in Qt 5.0, making this class obsolete. Change-Id: I77eef066c4823af4b074ef32d4d78dbd67c36cd0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Set incubation controller when a Window{} is loaded via QQmlApplicationEngineAlan Alpert2013-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This was the one convenience that was lost when transitioning templates from QQuickView + Item{} to QQmlApplicationEngine + Window{}. As the default window incubation controller was tied to the first window's frameSwapped, we could easily run into a situation where a secondary window required incubation while the first window was idle. This would then starve the incubation controller. Instead make it so that the renderloop emits "timeToIncubate" once it is done with a renderpass over all windows, so the incubator gets to run once and exactly once per vsync when animating. The incubator logic was also flawed in that it could post a lot of events to itself as a result of incubatingObjectCountChanged and thus starve system events while processing incubation requests. Now we start a timer and don't start it again until we have completed an incubation pass. Task-number: QTBUG-31203 Change-Id: Iea9e2c81efb46bb7875c70ccda0cdc4b3b3e58e7 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Added QQuickWindow::setDefaultAlphaBuffer()Shawn Rutledge2013-05-301-0/+2
| | | | | | | | | | | | | | All QQuickWindows will render using the same OpenGL context, so for a window to support transparency, the OpenGL context needs to be created with support for transparency from the very start. Therefore the application needs to call setDefaultAlphaBuffer() before creating windows. There are some relevant comments in QTBUG-20768 although the bug itself is not the same use case (it was already OK as long as the first window had a translucent color, because of setAlphaBufferSize in QQuickWindow::setColor()). Change-Id: I92e111c1a62c0d510821b646fd334e52254f8f57 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add QQuickWindow::closing signal, and ability to ignore the eventShawn Rutledge2013-05-081-0/+17
| | | | | | | | | | | An application can implement onClosing() and set closeEvent.accepted = false to delay the closing (for example to prompt the user to save changes). Depends on change I9abed47fca02a002b78727f98d678a824854adfc in qtbase. Task-number: QTBUG-31019 Change-Id: Icfd4a03ecef3621bdbbee2e2c3157b897a9b6524 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Remove dead code.Gunnar Sletta2013-04-171-3/+0
| | | | | | | | | | | | | | | The renderWithoutShowing was a piece of functionality that we experimented on long ago and it never quite worked and has it currently only adds bloat. It would be sensible to be able to render a window without showing it on screen, such as for testing purposes, but then it should be done through proper public API and thouroughly supported cross platform. Change-Id: I6bea7335f769c038a8167bad77c2dba171359be9 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* a nested Window automatically becomes transient for its parentShawn Rutledge2013-04-101-0/+6
| | | | | | | | | | | | | | | | If you declare Window { Window {}} or Window { Item { Window {}}} the inner window will automatically become transient for the outer one. The transient relationship must be set before the inner window becomes visible though, so declaring visible: true doesn't always work, depending on initialization order. It's OK if you assign visible (or call show()) later on when the user needs to see the transient window for the first time. Also added documentation. Change-Id: I888c3b9da6d44d11516227c085bcc12a5ccb5e81 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Focus reasonCaroline Chao2013-03-071-2/+2
| | | | | | | | | | | | | When trying to do for example text handling it becomes obvious that focus handling is not proper. A mouse click focus should de-select text, while a window change should preserve the selection. Re-introduce focus reason. Change-Id: I3322c976437cba68938d7c9188e549bdb499fa5a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Complete rewrite of threaded render loop.Gunnar Sletta2013-01-181-2/+2
| | | | | | | | | | | | | | | | This change starts using the superior implementation of the scene graph render loop which has been worked on in the scenegraph-playground project for a while. It uses a far more straightforward locking/sync paradigm compared to the existing one and is less deadlock and error prone. It also enables the scene graph thread to run on its own when the GUI thread is blocked, enabling threaded animations. This changes also introduces a naming change inside Qt Quick from "Window Manager" -> "Render Loop" as that fits better to what the code does. Change-Id: I1c2170ee04fcbef79660bd7dae6cace647cdb276 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix bug where a tap over stacked mouse areas generates a double clickDaniel d'Andrada2013-01-091-0/+1
| | | | | | | | | | | | | You have two mouse areas, one on top of the other. 1 - You tap the top one. 2 - That top mouse area receives a mouse press event but doesn't accept it Expected outcome: 3 - the bottom mouse area gets clicked (besides press and release mouse events) Bogus outcome: 3 - the bottom mouse area gets double clicked. Change-Id: I10cac52b5e8edea781fe88e70c4092eb38bcf763 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Compile with QT_NO_WHEELEVENT.Volker Krause2012-12-191-0/+2
| | | | | | | | Change-Id: I2fbe6f45ba50e3db75bd02cfca47ddabfcd5fc49 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove interim compatibility measuresAlan Alpert2012-10-161-2/+2
| | | | | | | | Also update some variables in qtdeclarative which failed to update rootItem->contentItem. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d3 Reviewed-by: Alan Alpert <416365416c@gmail.com>
* Allow grabbing windows rendered without showing for testing.Balazs Kelemen2012-09-281-0/+2
| | | | | | | | | | | To make QQuickWindowPrivate::setRenderWithoutShowing more useful for autotesting we can allow grabbing such windows. This is safe if the platform window have been created and the window has a valid size. Change-Id: I8b9a2aaeb93935f662b75ef29651730b890441d5 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix resolution of cursor when items are overlapping.Andrew den Exter2012-07-261-0/+7
| | | | | | | | | | | | If MouseArea with cursorShapes are overlapping then cursor shape of the foremost item under the mouse cursor should be shown, but because the hover events are delivered to the foremost items first the opposite is occuring. This makes QQuickWindow responsible for correctly setting its own cursor instead of relying on items to work it out amongst themselves. Change-Id: Iedf144c583dfa3d1ff441e19db9601b5e171902a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-0/+224
QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>