Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. setSortCaseSensitivity doesn't work
Qt 6.11 is out! See what's new in the release blog

setSortCaseSensitivity doesn't work

Scheduled Pinned Locked Moved General and Desktop
qsortfilterproxsetsortcasesensqtcaseinsensiti
5 Posts 2 Posters 2.7k Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have no idea why, but with this code the table sorting is still case sensitive

    QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    proxyModel->setFilterFixedString(ui->lineEdit_search->text());
    proxyModel->setFilterKeyColumn(1);
    proxyModel->setSourceModel(model);

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      in this code you're not sorting but filtering.
      Where do you sort your data??

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      ? 1 Reply Last reply
      0
      • M mcosta

        Hi,

        in this code you're not sorting but filtering.
        Where do you sort your data??

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @mcosta

        Yes, i need to filter the model.I have lineEdit and want this input to filter the data

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by mcosta
          #4

          What kind of model is model? QAbstractTableModel ?

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          ? 1 Reply Last reply
          0
          • M mcosta

            What kind of model is model? QAbstractTableModel ?

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            @mcosta
            QSqlQueryModel

            1 Reply Last reply
            0

            • Login

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