@MintogoDeveloper
Hi, i am also following the blog post and trying to do the example he provided. But it seems i can't render anything out. Do you have some snippets of your code that can render something? Such that i can use it as reference
Thanks for the input! I think I'm going to go with QGraphicsView for the notation and use QQuickWidgets throughout the other pieces of the UI that don't need access to the entire model. I'm hoping that won't be too complicated and will give me the best of both worlds. But I do wonder: is there a specific piece of Qt Quick that's supposed to a "replacement" for QGraphicsView? It seems like the scene graph is a bit too low level, but it's also the only way to gain a lot of control and keep things mostly on the C++ side. It would be nice if the built-in QML elements are exposed via a C++ API at some point.
@seyed As I understand things, you need to get hold of the item's transform and do whatever your rendering needs to do with it for it to have effect... see https://stackoverflow.com/questions/28535528/how-can-i-get-transform-matrix-for-qquickitem . (Similarly, nothing will implement the opacity property for you... you have to bring it into your OpenGL code and use it in your fragment shader.)
It's not intended, but should work. Just remember that you get a lot of overhead from QQuickItem and QObject with this approach, these classes are not tiny.
Since editing doesnt work properly on mobile for me Im gonna add information I forgot as a reply:
Qt/QML version: 5.5, QML2
if relevant:
development OS: debian amd64
window manager: kwin
-> developing in a vm (vmware)
It's just a matter of calling:
connect(grabResult.data(), &QQuickItemGrabResult::ready, this, &MyClass::mySlot);
I haven't checked the current implementation but in any case it's a costly operation so using a shared object might also be a non-negligeable resource usage improvement.
Thanks @p3c0
Based on the documentation, QtDeclarative has already been deprecated in favor of the two new classes: Qt Quick and Qt QML. QQuickPaintedItem can be use as convenient way to port QDeclarativeItem-based classes that use the QPainter API.
I've been searching on the internet how to render text on QSG nodes but to no avail. I'm still stuck into this problem. :(
I have no idea on your issue, but I recall a method which is in Component type:
object incubateObject(Item parent, object properties, enumeration mode)
By noting "incubate" it means the object is created asynchronously, without blocking the GUI.
@p3c0 Thanks for this additional idea. The bug assignee updated and closed the bug, informing me that I should call setKeepMouseGrab(true) during the mousePressEvent handler, then the mouse events would never be stolen. It worked like a charm. Thanks again for your additional ideas. I will mark this thread as Solved.
vertexData() returns only the data in ram and not the real VBO which is stored in GPU-ram.
As soon as you mark it as dirty it gets completely copied into GPU.
Meanwhile I have implemented a direct opengl-way where I create the VBO myself.
Thanks anyway!
cu