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. Sortorder Linux vs. Windows
QtWS25 Last Chance

Sortorder Linux vs. Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 738 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.
  • N Offline
    N Offline
    nx7z
    wrote on last edited by
    #1

    Hello everyone!

    How does it come that if I sort my QStandardItemModel in Windows I get different results in Linux?

    For example Windows sorts my model like this:
    A, a, B, b,
    and Linux sorts like this:
    A, B, a, b,

    I use exactly the same code. Do I have to change something in Qt or Linux set some locale or change a parameter? Thats how i setup my Model:

    m_model->setSourceModel(m_baseModel);
    m_model->setDynamicSortFilter(false);
    m_model->setSortCaseSensitivity(Qt::CaseSensitive);
    m_model->setSortRole(Qt::DisplayRole);
    m_model->sort(0, Qt::AscendingOrder);
    m_model->setFilterCaseSensitivity(Qt::CaseInsensitive);
    m_model->setSortLocaleAware(true);
    

    Thanks in advance!
    Nex

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you using the same version of Qt on both platforms ?

      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
      • N Offline
        N Offline
        nx7z
        wrote on last edited by nx7z
        #3

        Yes on linux and Windows I use Qt5.92

        On Linux the application is running on a small arm buildroot Linux. Is there maybe some locale missing in linux?

        JonBJ 1 Reply Last reply
        0
        • N nx7z

          Yes on linux and Windows I use Qt5.92

          On Linux the application is running on a small arm buildroot Linux. Is there maybe some locale missing in linux?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @nx7z
          Perhaps it's just me, but you seem to be calling the sort() before the setFilterCaseSensitivity(Qt::CaseInsensitive); & setSortLocaleAware(true);. Is this truly the code you are using for the result you are showing?

          1 Reply Last reply
          3

          • Login

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