Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.12 QListView text not showing when using setUniformItemSizes
QtWS25 Last Chance

Qt 5.12 QListView text not showing when using setUniformItemSizes

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 636 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PhlipVR
    wrote on last edited by PhlipVR
    #1

    Hello I'm having an issue in Qt 5.12 using QListView with QFileSystemModel. When I use setUniformItemSizes(true) on the listview some items don't show the text label but in others it looks like it is aligned outside of the item and clipped.

    The result in Qt 5.12:

    image 5.12

    The result in Qt 5.6:

    image 5.6

    Edit:
    I'm using Windows 8,1 64 bits.

    Code:

    #include <QApplication>
    #include <QFileSystemModel>
    #include <QListView>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        QFileSystemModel *filesModel = new QFileSystemModel();
        filesModel->setRootPath("");
    
        QListView *listView = new QListView();
        listView->setUniformItemSizes(true);
        listView->setModel(filesModel);
        listView->setRootIndex(filesModel->index("C:/files"));
        listView->setViewMode(QListView::IconMode);
        listView->resize(800,600);
        listView->show();
    
        return a.exec();
    }
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you provide a minimal compilable example reproducing that behaviour ?

      What OS are you running ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        PhlipVR
        wrote on last edited by
        #3

        thank you, I added the additional information

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Unfortunately this is a bug introduced in 5.12, hope to get it fixed until 5.12.2: https://bugreports.qt.io/browse/QTBUG-72869

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved