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. "İ" problem in QSortFilterProxyModel?
QtWS25 Last Chance

"İ" problem in QSortFilterProxyModel?

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

    Hi,
    I use QSortFilterProxyModel and want to filter according to string in column 3.
    It works OK except "İ" or "i" in Turkish language!
    Code is below:

    proxyModel->setSourceModel(modelTableDetay);
    ui->tVDetay->setModel(proxyModel);
    
    proxyModel->setFilterRegExp(QRegExp("DEĞİRMEN"), Qt::CaseInsensitive, QRegExp::FixedString));
    
    proxyModel->setFilterKeyColumn(3);
    
    

    Is there any way to change filter language codec? How can I solve this?...

    Regards,
    Mucip:)

    MucipM 1 Reply Last reply
    0
    • MucipM Mucip

      Hi,
      I use QSortFilterProxyModel and want to filter according to string in column 3.
      It works OK except "İ" or "i" in Turkish language!
      Code is below:

      proxyModel->setSourceModel(modelTableDetay);
      ui->tVDetay->setModel(proxyModel);
      
      proxyModel->setFilterRegExp(QRegExp("DEĞİRMEN"), Qt::CaseInsensitive, QRegExp::FixedString));
      
      proxyModel->setFilterKeyColumn(3);
      
      

      Is there any way to change filter language codec? How can I solve this?...

      Regards,
      Mucip:)

      MucipM Offline
      MucipM Offline
      Mucip
      wrote on last edited by
      #2

      Hi,
      I solved like below. But I think it's dirty solution but worked... :(

      proxyModel->setFilterRegExp(QRegExp(ui->lEKriter->text().replace("İ","*"), Qt::CaseInsensitive, QRegExp::WildcardUnix));
      

      Regards,
      Mucip:)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Snorkelbuckle
        wrote on last edited by
        #3

        I have a possible line of research for you, but I apologize I'm not an expert, but the RegExp doc says it is fully compliant unicode, so maybe your string needs to be in unicode format?

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

          @snorkelbuckle said in "İ" problem in QSortFilterProxyModel?:

          so maybe your string needs to be in unicode format?

          That's the reason I would guess - the string is not properly encoded since either the source code is not utf-8 or the compiler does not understand it. Therefore only use ascii in your code and translate the rest with linguist.

          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