0

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?

daisy
  • 22,498
  • 29
  • 129
  • 265

1 Answers1

1

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.

trompa
  • 1,967
  • 1
  • 18
  • 26