Hi All!
How can I set some widget in QTreeWidget header? I need to place in header QLineEdit and QDoubleSpinBox. I tried this code, but this not work.
Qt Code:
  1. QTreeWidget *tree = new QTreeWidget( this );
  2. tree->setColumnCount( 5 );
  3.  
  4. QLineEdit *edit = new QLineEdit( tree->header() );
  5. QDoubleSpinBox *spin = new QDoubleSpinBox( tree->header() );
  6.  
  7. tree->header()->setIndexWidget( tree->model()->index( 0, 0 ), edit );
  8. tree->header()->setIndexWidget( tree->model()->index( 0, 1 ), spin );
To copy to clipboard, switch view to plain text mode