Reputation: 856
In a tableview or tablewidget of pyqt (and qt in general), if you resize column cells that have no wrap on them, the right side of the cell value will be clipped (and replaced with ellipses ...) regardless of whether the cell value is left or right aligned.
The effect is as follows:
The long and winding road. => The long and windi...
Is it possible to force the table to resize the cells while clipping the left side of the cell value, instead?
The effect I want is as follows:
The long and winding road. => ...ng and winding road.
I want this so that if I right align a line of text, and then resize the cell, I want to always see what comes at the very end of the line.
Any help would be appreciated.
Upvotes: 3
Views: 727
Reputation:
You can use setTextElideMode to set where the "..." is placed. In your case (using C++):
ui->tableWidget->setTextElideMode(Qt::ElideLeft);
Note that the elide mode affects all columns.
Upvotes: 3