oKcerG / SortFilterProxyModel

A nicely exposed QSortFilterProxyModel for QML
MIT License
303 stars 102 forks source link

SortFilterProxyModel with PyQt #37

Closed karahman1993 closed 7 years ago

karahman1993 commented 7 years ago

How do I use this SortFilterProxyModel which is in c ++ with PyQt??

iberiozko commented 7 years ago

You can use my patch from https://github.com/oKcerG/SortFilterProxyModel/issues/25 to build as standalone plugin.

After building you get a libqmlqsortfilterproxymodelplugin.so library. You should put it (and qmldir file) into /usr/qml/QQSFPM/ or whereever your QML plugins live. Then you can do "import QQSFPM 0.2" as usual.

qmldir file:

module QQSFPM
plugin qmlqsortfilterproxymodelplugin
karahman1993 commented 7 years ago

i tried your example, I had this error "could not find the executable, please specify one" Please i am beginner, Can you Explain more ??

iberiozko commented 7 years ago

Hmm, let's try.

  1. Checkout code.
  2. Create plugin.cpp and SortFilterProxyModel.pro as in #25.
  3. qmake
  4. make
  5. You get libqmlqsortfilterproxymodelplugin.so
  6. Put it into /usr/qml/QQSFPM/
  7. Put qmldir file nearby.
  8. Profit.

Feel free to contact me on skype: iberiozko.

karahman1993 commented 7 years ago

@iberiozko i tried but it did not work!!!! so i show you my file "finale":


-finale ----finale.pro -----SortFilterProxyModel --------- SortFilterProxyModel.pro -------- -Header ------------ filter.h ------------ qmlqsortfilterproxymodel.h ------------ sorter.h -------- -Source ------------ filter.cpp ------------ plugin.cpp ------------ qmlqsortfilterproxymodel.cpp ------------ sorter.cpp -------- -Sources ------------ main.py -------- -Ressources ----------- -qml.qrc --------------- -/ ------------------------- main.qml


when i try this, i get : "qmlqsortfilterproxymodelplugin.dll in filder debug" not "libqmlqsortfilterproxymodelplugin.so" so when i put this .dll and qmldir in my folder (stage/finale) and i run my PyQt i get error "module QQSFPM is not installed). so is the bug in the architecture that I showed you ?? or another problem?? thank you

oKcerG commented 7 years ago

Duplicate of #25