Z
Z
Zakhar Alekseenko2015-10-13 13:49:46
Qt
Zakhar Alekseenko, 2015-10-13 13:49:46

QTreeView and QSqlRelationTableModel/QTableModel?

Hello.
Faced with the following situation.
I have 4 tables Devices, Switchs, Channels, Sensors connected by foreign keys. Logically, they represent a hierarchical structure.

Device{
    Switch{
        Channel{
                Sensor1
                Sensor2
                Sensor3
            }
    }
}

It is not clear to me how I can display such a hierarchical structure using QTreeView, with the ability to edit. Is it possible to use QTableView or QColumnView to display?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-10-13
@Nipheris

In your case, I think the most flexible option is the successor from QAbstractItemModel . It is quite possible to display it using QTreeView.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question