Changing editor size in QStyledItemDelegate



  • Hi,
    I have a QStandardItemModel with QStyledItemDelegate. Because the records include pictures the rows are quite high and the editors (QLineEdit, QTextEdit, QComboBox) don't look too good. Is it possible to change the size of these editors somehow? Especially their height.
    Thank you.


  • Qt Champions 2016

    Hi
    Can you try in
    In
    ::createEditor(QWidget *parent,
    const QStyleOptionViewItem &option,
    const QModelIndex &index) const
    ....
    StarEditor *editor = new StarEditor(parent); // Create editor
    editor->resize( option.rect.width(), option.rect.height() )
    ....



  • I think reimplementing sizeHint in the delegate should be enough


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.