As to your first question, add the line:
tbl->setEditTriggers(QAbstractItemView::NoEditTriggers);
To copy to clipboard, switch view to plain text mode
And if you want all rows to have equal size you should probably implement a delegate. ie.:
{
{
}
};
...
tbl->setItemDelegate(new ItemDelegate);
...
tbl->resizeRowsToContents();
...
class ItemDelegate : public QItemDelegate
{
virtual QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
{
return QItemDelegate::sizeHint(option, index).expandedTo(QSize(0,20));
}
};
...
tbl->setItemDelegate(new ItemDelegate);
...
tbl->resizeRowsToContents();
...
To copy to clipboard, switch view to plain text mode
or reimplement QTableView::sizeHintForRow(int row) to always return the desired height.
Bookmarks