First test with QDataWidgetMapper to connect controls to the items in the connection list is working.

This commit is contained in:
Eelke Klein 2017-01-14 22:03:58 +01:00
parent f5eab84c24
commit c235169304
6 changed files with 256 additions and 84 deletions

View file

@ -65,13 +65,25 @@ int ConnectionListModel::rowCount(const QModelIndex &parent) const
return m_connections.size();
}
int ConnectionListModel::columnCount(const QModelIndex &/*parent*/) const
{
return 2;
}
QVariant ConnectionListModel::data(const QModelIndex &index, int role) const
{
QVariant result;
if (role == Qt::DisplayRole) {
if (role == Qt::DisplayRole || role == Qt::EditRole) {
int row = index.row();
result = makeLongDescription(m_connections.at(row));
int col = index.column();
// if (col == 0) {
result = makeLongDescription(m_connections.at(row));
// }
//else {
//result = QString("other col");
//}
}
return result;
}