aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qquickcanvas.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Say hello to QtQuick moduleKent Hansen2011-12-021-2644/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Initial window implementationAlan Alpert2011-11-291-0/+36
| | | | | | | | | Includes adding a color property on QQuickCanvas. Note that most Window related properties come from the QWindow inheritance. Task-number: QTBUG-19799 Change-Id: I00f6c90a1e2a5c85d787793d6edac2cd7d5309ab Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fixed assert during QQuickCanvas::hideEvent().Kim Motoyoshi Kalland2011-11-241-17/+3
| | | | | | | | Also fixed a memory leak in the non-threaded renderer so that it is on par with the threaded one. Change-Id: Ie3111730a9d10085c83f7aafceda240419b722cd Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Get rid of unused inputMethodQuery and inputMethodEvent functions in ↵Joona Petrell2011-11-241-38/+0
| | | | | | | | | | | | QQuickCanvas * in Qt5 input method events and queries are meant to be sent directly to QInputPanel::inputItem() instead of the focused QWindow * protected inputMethodEvent was actually never called by QWindow::event() like it called other specialized event functions Change-Id: I68cced106808098c320841d6a17a0cc170a8369f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Copy QSGEngine functions to QQuickCanvas.Gunnar Sletta2011-11-181-1/+181
| | | | | | | | | | | | Long term we intend to remove the QSGEngine class all together so this is the first step. It duplicates some of the logic but doesn't break anything. Also including an example on how to use it in examples/declarative/openglunderqml Change-Id: I69ed93ec5fa1b5c4c746169306d38f8d6ce80477 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Change destruction order to avoid accessing deleted GL resourcesKent Hansen2011-11-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a crash when a QQuickCanvas containing a Text item is destroyed. 202127f860208c21145e05685bc54219e1655dbd in qtbase fixed a resource leak with QOpenGLMultiGroupSharedResource; resources were not cleaned up correctly when the associated GL context (group) was destroyed. This exposed a bug where QSGDefaultDistanceFieldGlyphCache (used for Text items) relied on that leakage. In particular, the glyph cache stores a pointer to a GL resource that it doesn't own (m_textureData). If the GL context is deleted and there are no other contexts in the group, the group and its resources will be deleted. Subsequently, if the glyph cache accesses the resource pointer when the Text node is destroyed (via QSGDefaultDistanceFieldGlyphCache::releaseGlyphs()), we crash. The GL context is deleted when QQuickCanvasPlainRenderLoop is destroyed. By moving the deletion of the render loop object to the end of QQuickCanvas destructor, the canvas nodes get a chance to clean up the resources they use _before_ the resources are deleted. Task-number: QTBUG-22754 Change-Id: Ie8de19a139b4631a16203e63e731feed3d8d64cf Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Improved comments on threaded renderer a bitGunnar Sletta2011-11-161-3/+3
| | | | | Change-Id: I1ee3879bde219e0008d70117dbfdd14f7da31f18 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Fixed deferred deletion of objects in the render thread loop.Kim Motoyoshi Kalland2011-11-161-1/+3
| | | | | | | processEvents() does not process DeferredDelete events. Change-Id: Iee8491b7c63a26af8e36f777d872115ab1b64763 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Removed annoying warning about threadingGunnar Sletta2011-11-141-7/+0
| | | | | | | Task-number: QTBUG-21707 Change-Id: I7ea7c53f39e2474093d628b5a75a435353b87b87 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed assert during QML shutdownGunnar Sletta2011-11-141-0/+6
| | | | | Change-Id: I680af9ccb417d3162277b5740a129ecd77feee7f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Don't clobber unified timer settingsAlan Alpert2011-11-141-1/+3
| | | | | Change-Id: Iee43b566180471e08d655a4d2af72e9586227532 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Delete nodes in the render thread at shutdownAaron Kennedy2011-11-091-0/+29
| | | | | | | This fixes a crash on OS X and possibly other platforms. Change-Id: Ie8fc451b526d12d46133ef560c04e88c0b142b9a Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Only issue non-threaded renderer warning onceAaron Kennedy2011-11-031-3/+7
| | | | | Change-Id: Id278fa28080d829763c907423089897728b01baa Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Cursory docs for QQuickCanvas and QQuickViewAlan Alpert2011-11-031-1/+33
| | | | | Change-Id: I6955164715b07fc11a00466b5a5a1818d97fb9b5 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Workaround windows not gaining focus on mac.Andrew den Exter2011-11-011-3/+9
| | | | | | | | | | | Delaying giving focus to the rootItem until the canvas window gains focus doesn't work if the window never gains focus. So give focus to the rootItem immediately so text input continues to work while QTBUG-22415 is being resolved. Task-number: QTBUG-22409 Change-Id: I1bdb13485219d0c2a2f8bdcb3e0972444e3813f2 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Add MultiPointTouchArea element.Michael Brasser2011-10-251-8/+9
| | | | | Change-Id: I3a4f774cd96ab7f5d08e85c965f59e1416f02e0e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix item focus following canvas focus.Andrew den Exter2011-10-241-7/+14
| | | | | | | | | Restore canvas focus handling so that active item focus is added and removed as the canvas focus changes. Task-number: QTBUG-17320 Change-Id: Ief60f35da2f3a563f397ce026ca6fea289a200c4 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Rename Qt Quick-specific classes to QQuick*Kent Hansen2011-10-211-0/+2399
The QSG (SceneGraph) prefix is too generic for Qt Quick(2)-specific classes. All the classes and files in the declarative/items directory have been renamed. In particular, for classes that are currently public, the renaming is as follows: QSGView --> QQuickView QSGCanvas --> QQuickCanvas QSGItem --> QQuickItem QSGPaintedItem --> QQuickPaintedItem The header files have been renamed accordingly (e.g. qsgview.h --> qquickview.h). Change-Id: Iac937fff81db20bb639486a793c3aeb5230b038c Reviewed-by: Kent Hansen <kent.hansen@nokia.com>