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. QSortFilterProxy sorting works on Linux but fails on Windows
Forum Updated to NodeBB v4.3 + New Features

QSortFilterProxy sorting works on Linux but fails on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 204 Views 1 Watching
  • 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.
  • Seb TurS Offline
    Seb TurS Offline
    Seb Tur
    wrote last edited by
    #1

    I use MariaDB,
    when i run this code on linux all works fine, clicking on the column changes the sorting of the table rows

    I was using qt 6.8.

    Since 6.10.1 cross-compiled to Windows with MXE when i run this code on windows10 when I click on column i can see the sorting indicators changing but sorting of rows does not happen

    void MainWindow::on_PB_stany_filtruj_clicked()
    {
        if (!model_stany)
            {
                model_stany = new QSqlQueryModel(this);
                model_stany_proxy = new QSortFilterProxyModel(this);
    
                model_stany_proxy->setSourceModel(model_stany);
                model_stany_proxy->setDynamicSortFilter(true);
    
                ui->TV_stany_magazynowe->setModel(model_stany_proxy);
                ui->TV_stany_magazynowe->setSortingEnabled(true);
            }
        QString filtruj_stany;
    
    
        if (ui->RB_stany_filtruj_nazwa->isChecked())
            filtruj_stany=" TwrKarty.nazwa like :filter";
    
    
        QSqlQuery query_stany;
        query_stany.prepare("SELECT TwrKarty.twr_id,TwrKarty.kod, TwrKarty.nazwa FROM TwrKarty ");
        query_stany.bindValue(":filter", "%"+ui->LE_stany_filtruj->text()+"%");
       query.exec();
        model_stany->setQuery(query_stany);
    
    }
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote last edited by
      #2

      Please provide a minimal compilable example, without sql but a simple qt provided model and no mainwindow as this should not be needed to provide a mre

      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
      1
      • Seb TurS Offline
        Seb TurS Offline
        Seb Tur
        wrote last edited by
        #3

        i verified it, this is qt6.10 bug in windows only

        qt 6.9.3 works fine on both Linux and Windows whereas Qt 6.10 (and 6.10.1) has this bug on windows

        even more, it not only fails to sort, it also causes a crash ocasionally

        GrecKoG 1 Reply Last reply
        0
        • Seb TurS Seb Tur

          i verified it, this is qt6.10 bug in windows only

          qt 6.9.3 works fine on both Linux and Windows whereas Qt 6.10 (and 6.10.1) has this bug on windows

          even more, it not only fails to sort, it also causes a crash ocasionally

          GrecKoG Offline
          GrecKoG Offline
          GrecKo
          Qt Champions 2018
          wrote last edited by
          #4

          @Seb-Tur Is it a static build?

          1 Reply Last reply
          0
          • Seb TurS Offline
            Seb TurS Offline
            Seb Tur
            wrote last edited by
            #5

            yes it was , via mxe

            GrecKoG 1 Reply Last reply
            0
            • Seb TurS Seb Tur

              yes it was , via mxe

              GrecKoG Offline
              GrecKoG Offline
              GrecKo
              Qt Champions 2018
              wrote last edited by
              #6

              @Seb-Tur This might be due to this then : https://qt-project.atlassian.net/browse/QTBUG-141830

              1 Reply Last reply
              1
              • JonBJ JonB referenced this topic

              • Login

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