You can use either QTreeWidget, QTableWidget, QTreeView+QStandardItemModel, QTableView+QStandardItemModel, QTreeView+QAbstactTableModel subclass, QTableView+QAbstactTableModel subclass for what you are trying to do.
I would go with a QT*View+QStandardItemModel (tree or table doesn't matter).
The functionalities you describe are:
only some columns will be editable
Entering a value in the cents column (a logarithmic measure of frequency) will change the value in the hertz column, and vice versa
connect a slot to QStandardItemModel::dataChanged signal
There will be a button next to the table to add an additional note to the scale
connect a slot that calls QStandardItemModel::insertRows to the QPushButton::clicked signal
@michalos I'm not sure if I can help you but seems like model test code works for me.
What I did:
Added modeltest.h and cpp into my project
Added "testlib" into "QT" section of project file
Added this to modeltest.h:
#define qVariantCanConvert(_type_, _var_) _var_.canConvert(QMetaType::_type_)
Changed expressions like "qVariantCanConvert<QString> ( variant)" to "qVariantCanConvert(QString, variant)" in modeltest.h
And... my sample model failed to pass the test of course :D
I think I take your meaning. As I geared up to subclass QAbstractItemView, it also became evident how niche my new class would be. Based on this, I decided to take your advice of composing a custom widget.
If anyone should want to subclass QAbstractItemView, this is a good article to get you started.