Important: Please read the Qt Code of Conduct -

"İ" problem in QSortFilterProxyModel?

  • 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->setFilterRegExp(QRegExp("DEĞİRMEN"), Qt::CaseInsensitive, QRegExp::FixedString));

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


  • 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));


  • 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?

  • Lifetime Qt Champion

    @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.

Log in to reply