turn off elide in column of qtablewidget
-
@eyllanesc ok i will see if i can setup a simple example
-
@sawarsi Also before you start put a breakpoint/debug message into your code to make 100% sure your override is getting called.
-
@sawarsi Also before you start put a breakpoint/debug message into your code to make 100% sure your override is getting called.
-
@eyllanesc ok i will see if i can setup a simple example
-
@eyllanesc thanks for the help.
-
@eyllanesc ok i will see if i can setup a simple example
-
@eyllanesc one thing i did notice is that this works just fine in linux but fails on windows any hints?
-
@sawarsi one thing i did notice is that this works just fine in linux but fails on windows any hints?
-
@sawarsi As can be seen in the source code of "paint", the QStyle is used to make the painting, so the style probably does not use some option properties, a possible solution is to use another style like:
app.setStyle("fusion" );
@eyllanesc i tried all the Windows styles (Windows and Fusion) and neither worked it may be that Windows mandates ellipses. i am not sure anyway, i am going to mark this solved.
-
@sawarsi You have to override the initStyleOption method
class StyledItemDelegate: public QStyledItemDelegate { public: using QStyledItemDelegate::QStyledItemDelegate; protected: void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override { QStyledItemDelegate::initStyleOption(option, index); option->textElideMode = Qt::ElideNone; } };
@eyllanesc I admire you a lot. This is one of the best ways for an informed person to respond to a question. Anyone asking question is usually confused and an illustrative answer is the best. I notice you always go out of your way to give a practical example. Honestly if you have a class where you teach students, I would love to be one of your students.
Thank you very much.