What kind if items do you create as graphics items?
It might be possible to just make custom declarative items and create all items from QML.
So currently you have a QDeclarativeView as an item in your QGraphicsScene?
Cheers,
_
What kind if items do you create as graphics items?
It might be possible to just make custom declarative items and create all items from QML.
So currently you have a QDeclarativeView as an item in your QGraphicsScene?
Cheers,
_
Grids and Ellipses are created as graphics item and in future vendor company will also create some items as graphics Item.What kind if items do you create as graphics items?
In Qt 4.8.2 we used QDeclalativeItem to create some objects in QML and added it to QGraphicsScene. But now in Qt 5.7 how will we create it?It might be possible to just make custom declarative items and create all items from QML.
No, We are not using QDeclarativeView. We used QQuickWidget to access Item form QML file and added it to QGraphicsScene.So currently you have a QDeclarativeView as an item in your QGraphicsScene?
Should be trivial to create these as custom QDeclarativeItems
Ah, ok, very hacky.
If you use a QDeclarativeView instead then you can use the same approach when moving to a QQuickWidget.
Well, that's not possible since Qt5 QQuickItems are not QGraphicsItems.
QtQuick is rendered with an OpenGL based scene graph.
As far as I understood your setup you have these options:
1) Remove the usage of QML
2) Keep using QGraphicsView and just use QQmlEngine with custom types to create QGraphicItem based objects in QML
3) Move the Qt4 version to use QDeclarativeView and custom QDeclarativeItem and then port that almost unchanged to QtQuickWidget and custom QQuickPaintedItems.
Cheers,
_
The QML engine (in both Qt4 and Qt5) can essentially create instances of any class that is derived from QObject (directly or indirectly).
So for example if you have a class that derives from QGraphicsObject you should be able to register that with the QML engine's type system and then use in QML like any of the "built-in" types.
http://doc.qt.io/archives/qt-4.8/qde...mlRegisterType
http://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterType
Cheers,
_
Bookmarks