Important: Please read the Qt Code of Conduct -

Visualization and interaction of custom objects

  • Going through the documentation of model-view programming and Qt 3D it is not completely clear how you should proceed to use Qt to visualize and interact with a custom object.

    More specifically, assume that the custom object is a planar graph that is embedded in some plane in the 3D space. This just means that every node in your graph has a 3D coordinate, and every face of the graph is some polygon in 3D. Moreover, assume edges have a type one of A, B, or C. Depending on the type an edge should be visualized differently.

    You can assume that these type of graphs are captured by a class from a third-party library, say CustomGraph.
    This class has all kind of iterators that goes over faces, nodes, edges.
    By subclassing an observer class for CustomGraph it is possible to add callbacks to data changes of CustomGraph.

    How should I use QAsbtractItemModel to make a model class that uses CustomGraph in the background.
    Or is QAbstractItemModel not really suited for this type of application.
    And how do I visualize this model using the Qt 3D framework.

    The more detailed the answer, the better of course. But I understand that I cannot expect a complete answer, so if I can get like a list of classes I need to subclass and how they interact with each other, then that's satisfactory.

    Thanks in advance

Log in to reply