Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-629

QHeaderView does not respect ElideMode on sorted column

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.1
    • 4.2.3, 5.1.0
    • Widgets: Itemviews
    • 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

        1. qtbug629_vista.jpg
          qtbug629_vista.jpg
          18 kB
        2. qtbug629.jpg
          qtbug629.jpg
          16 kB
        3. qtbug629.zip
          1 kB
        For Gerrit Dashboard: QTBUG-629
        # Subject Branch Project Status CR V

        Activity

          People

            peppe Giuseppe D'Angelo
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes