oKcerG / SortFilterProxyModel

A nicely exposed QSortFilterProxyModel for QML
MIT License
298 stars 101 forks source link

Qt6 removed QRegExp #84

Open crziter opened 3 years ago

crziter commented 3 years ago

I were trying to use this project in a Qt6 based project but failed to compile due to missing QRegExp in Qt6.

maxwell130631 commented 3 years ago

If you add find_package(Qt6 REQUIRED Core Qml Core5Compat )

and target_include_directories(SortFilterProxyModel PUBLIC ${CMAKE_CURRENT_LIST_DIR} $<TARGET_PROPERTY:Qt6::Core,INTERFACE_INCLUDE_DIRECTORIES> $<TARGET_PROPERTY:Qt6::Qml,INTERFACE_INCLUDE_DIRECTORIES> $<TARGET_PROPERTY:Qt6::Core5Compat,INTERFACE_INCLUDE_DIRECTORIES> Qt6::Core5Compat ) you will get around that. But other errors will show up

metalMajor commented 9 months ago

Is there a working Qt 6.6 port somewhere? i tried these latest commits, but they crashed on the setSourceModel function saying that the "called object is not of the correct type". But I did the exact sample code in the readme.

Daguerreo commented 9 months ago

Is there a working Qt 6.6 port somewhere? i tried these latest commits, but they crashed on the setSourceModel function saying that the "called object is not of the correct type". But I did the exact sample code in the readme.

There are a few forks with this feature, I haven't tried those yet, however this could be the most updated: https://github.com/oKcerG/SortFilterProxyModel/compare/master...valaczka:SortFilterProxyModel:master

metalMajor commented 9 months ago

ok thanks for my use case, it's pure qml so I found this blog, and that seems much simpler to filter a simple qml list:

https://martin.rpdev.net/2019/01/15/using-delegatemodel-in-qml-for-sorting-and-filtering.html