Error with customsortfiltermodel example
-
I 'm trying to run the customsortfiltermodel example.
But I get the error: filterwidget.h:5:10: error: 'QRegExp' file not found
How can I fix it?(Qt Creator 6.0.2)
-
Hi,
Are you using Qt 6 ?
QRegExp has been deprecated in Qt 5 and removed in Qt 6, so if the example has not changed then it was missed during the porting to QRegularExpression. -
@Panoss said in Error with customsortfiltermodel example:
@SGaist Qt Creator 6.0.2
Based on Qt 6.2.2 (MSVC 2019, 64 bit)What can I do?
This is your Qt Creator information not the Kit you are currently using.
You can open a bug report against the documentation on the bug report system.As for your use case, adapt the code to use QRegularExpression.[edit: wrong example link used SGaist]
-
@SGaist said in Error with customsortfiltermodel example:
so if the example has not changed then it was missed during the porting to QRegularExpression.
No, just the link is wrong - here the one for Qt6: https://doc.qt.io/qt-6/qtwidgets-itemviews-customsortfiltermodel-example.html
-
@Christian-Ehrlicher it works!
Thank you guys!