I use QStandardItem::setTextAlignment()
to make sure elements displayed in center, but when you double click on a item, aka editing mode, it is still displayed at the left most position.
So, how can I make editing mode work as display mode?
I use QStandardItem::setTextAlignment()
to make sure elements displayed in center, but when you double click on a item, aka editing mode, it is still displayed at the left most position.
So, how can I make editing mode work as display mode?
It seems more a problem with the delegate than with the QStandardItem.
Editing a QString, the default delegate editor factory returns a QLineEdit.
Afaik, that is the default behaviour of a QLineEdit and if you want to change it you will have to create your own lineedit class and your own delegate.