oKcerG / SortFilterProxyModel

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

Support Qt in namespace #69

Closed patstew closed 4 years ago

patstew commented 4 years ago

SortFilterProxyModel doesn't currently support Qt built with the -qtnamespace configure option

oKcerG commented 4 years ago

Thank you for this PR

oKcerG commented 4 years ago

Sorry, I've rushed accepting this one. It seems that the forward declaration is not working when using a non namespaced Qt. You have to use QT_FORWARD_DECLARE_CLASS instead.

But are you sure that there is not anymore thing to do to support a namespaced Qt? Shouldn't there be QT_USE_NAMESPACE or QT_PREPREND_NAMESPACE all over the place when referencing Qt classes?

patstew commented 4 years ago

Apologies, my bad on QT_FORWARD_DECLARE_CLASS. I can add a new PR if you like? I don't think anything else is necessary, it works for me like it is. QT_USE_NAMESPACE is declared in qglobal.h already, so it's declared if any Qt header is included.