aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemsmodule.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-02 21:38:20 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-03 10:12:40 +0000
commit84fb780d830764bcaa53478a5c5c464865897640 (patch)
tree35531692fdec60091feca3e51d8e9da05510f661 /src/quick/items/qquickitemsmodule.cpp
parent3551093f426ef7bbc222b543f573d5d341a43d8e (diff)
Introduce RendererInfo
Modeled after OpenGLInfo, RendererInfo.api is an easy to use attached property that reports the current graphics API as long as the item is associated with a window that has the scenegraph initialized. Applications should not worry about this in general since they should target one given API, however tests, examples and some advanced use cases will find this handy. RendererInfo is also a great place to expose other properties in the future. Change-Id: Ie3411b8820fc4b74efd1b1d0143e936886f62d74 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickitemsmodule.cpp')
-rw-r--r--src/quick/items/qquickitemsmodule.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index fa01c8c563..5f5809b6f2 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -80,6 +80,7 @@
# include "qquickanimatedsprite_p.h"
# include "qquickopenglinfo_p.h"
#endif
+#include "qquickrendererinfo_p.h"
#include "qquickshadereffect_p.h"
#include "qquickshadereffectmesh_p.h"
#include "qquickdrag_p.h"
@@ -292,9 +293,10 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickTextInput, 7>(uri, 2, 7, "TextInput");
qmlRegisterType<QQuickTextEdit, 7>(uri, 2, 7, "TextEdit");
- qmlRegisterType<QQuickShaderEffect, 2>(uri, 2, 8, "ShaderEffect");
-
qmlRegisterUncreatableType<QQuickMouseEvent, 7>(uri, 2, 7, nullptr, QQuickMouseEvent::tr("MouseEvent is only available within handlers in MouseArea"));
+
+ qmlRegisterType<QQuickShaderEffect, 2>(uri, 2, 8, "ShaderEffect");
+ qmlRegisterUncreatableType<QQuickRendererInfo>(uri, 2, 8,"RendererInfo", QQuickRendererInfo::tr("RendererInfo is only available via attached properties"));
}
static void initResources()