Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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->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:)



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



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


  • Qt Champions 2019

    @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