Congratulations to our 2022 Qt Champions!

[Solved] How to subclass QTableView when using the UI editor of QtCreator

  • Hello folks:

    I've a QAbstractTableModel subclass working with a QTableView... so far so good.

    Now I would like to implement a "Drag and Drop" capability to my QTableView and here's where the problem arose for me, because I need to subclass QTableView but I've used the UI editor of QtCreator for my design, therefore the UI editor has created the QTableView for me, so right now I don't know what to do to achieve what I need.

    Thanks in advance guys.

  • In Qt Designer (or the design tool of Qt Creator) you can promote it to a custom widget. The "Using Custom Widgets with Qt Designer":/doc/qt-4.7/designer-using-custom-widgets.html doc has a detailed guide.

  • Thanks for your quick, concise and right answer. I did it exactly as you suggested and it works like a charm.

    Thanks again Volker.

Log in to reply