Hi Albert,

you want to add a QTreeView and set its model to the QmitkDataStorageTableModel 
instead. See [1] for an example, which also uses an additional proxy model for 
filtering/sorting purposes. Also see [2] and [3] for more information on the 
model/view concept of Qt.

Best,
Stefan

[1] 
https://phabricator.mitk.org/diffusion/MITK/browse/master/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.cpp;2f9115cd5909c2e29c9e05ce5e0eb953b4d29740$125-155
[2] http://doc.qt.io/qt-5/modelview.html
[3] http://doc.qt.io/qt-5/model-view-programming.html


From: Albert Alises [mailto:ironicpsy...@gmail.com]
Sent: Dienstag, 27. September 2016 13:00
To: mitk-users@lists.sourceforge.net
Subject: [mitk-users] Problem with usage of QmitkDataStorageTableModel

Hello,
I have a problem/missunderstanding with the usage of the 
QmitkDataStorageTableModel. I want to add a table to my view so it shows 
certain nodes of the data storage and a property. However, when trying to 
create all the widgets from the .ui file, it detects that it cannot be created 
as it is a Q_OBJECT, not a widget.
Furthermore, when trying to create it programatically, I do not know how to add 
it to an existing Qt layout, as it apparently only accepts widgets to be added 
to a layout, not objects. How can I work my way through it to add the table to 
the GUI (via Qt Designer for instance), or programatically? I am quite lost on 
that, and casting and such does not seem to work for me.
Thank you,
Albert.
------------------------------------------------------------------------------
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to