Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.2.3, 5.1.0
-
None
-
b39bbc95f685e59744fd282b006d3fa7b247ed36
Description
When calling setTextElideMode(Qt::ElideRight) on a header view which has sorting enabled, then the elide mode is not respected. When resizing the column with the sort indicator, the ellipsis should appear when the indicator "touches" the text. This is the behavior of sorted columns in Windows Explorer, but does not happen in Qt applications.
#include <QtGui> #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) #include <QtWidgets> #endif int main(int argc, char *argv[]) { QApplication a(argc, argv); QTableWidget w(3, 3); w.setSortingEnabled(true); w.setHorizontalHeaderLabels(QStringList() << "Test1" << "Test2" << "Test3"); w.horizontalHeader()->setTextElideMode(Qt::ElideRight); w.show(); return a.exec(); }
Attachments
For Gerrit Dashboard: QTBUG-629 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
99658,6 | QHeaderView: take the sort indicator into account when eliding text | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |
99900,4 | Styles: improve SH_Header_ArrowAlignment handling | 5.4 | qt/qtbase | Status: MERGED | +2 | 0 |