Hello,

I have a class derived from QTableView, the constructor of which is:
Qt Code:
  1. my_table_view::my_table_view(QWidget* parent)
  2. : QTableView(parent)
  3. {
  4. setSelectionMode(QAbstractItemView::SingleSelection);
  5. setModel(new my_model(this));
  6. setItemDelegate(new my_delegate(this));
  7. verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
  8. horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
  9. }
To copy to clipboard, switch view to plain text mode 

For column 1, my_model returns a QString
Qt Code:
  1. QString pslist;
  2. for (...) {
  3. pslist += (i->first.c_str());
  4. pslist += '=';
  5. pslist += (i->second.c_str());
  6. pslist += '\n';
  7. }
  8. return pslist;
To copy to clipboard, switch view to plain text mode 
which yields the cell containing a list of strings.
That cell/columnl is one with the most height out of the 3 columns in the table.

Double clicking on that cell, my delegate creates an editor:

Qt Code:
  1. QWidget* my_delegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
  2. {
  3. const int row = index.row();
  4. if (row<0)
  5. return 0;
  6.  
  7. switch(index.column()) {
  8. ///
  9. case 1: {
  10. QWidget* widget = ;////
  11. widget->setAutoFillBackground(true);
  12. return widget;
  13. }
  14. ///
  15. default:
  16. return 0;
  17. };
  18. }
To copy to clipboard, switch view to plain text mode 

This returned widget is trivial. It has a QGridLayout taking care of 5 QLabels in front of 5 QLineEdits.
When I double click on the cell, the widget is created and returned.

The tableview ctor set the resizing mode of the horizontal header to resize to contents.
Because the row was sized according to the display widget (coming from QString), the edit widget (with the QLabels,QLineEdits) doesn't display nicely.

Can I resize the row of the table view after the delegate has created the widget to edit the cell ,so that the row holds enough space to display the edit widget properly?

Regards,