need to go soon, but in any case I will leave you then the two options you have to add the code:
* you can add just the code of the example inside the directory pyside-setup/examples you create three levels more with this name quick/customitems/painteditem/ and place the code there.
* this one is more tricky, because you will need to adopt what is being presented here: https://codereview.qt-project.org/c/pyside/pyside-setup/+/285647 and do the same for your specific case.
I recommend you the first one, so then we can try to modify the page easily afterwards
28 January 2020
29 January 2020
30 January 2020
I've previously talked about what could/should be in the doc. A main issue for me was testing. Please let me share my experience about it.
- I 'm only talking about the qml side for a pyside user. python testing is very simple and pytest-qt great
- QtTest is very good but the doc is not clear (example are two simple). It needs a complex example on how to write tst_files (but it's more qt.io than pyside problem).
- about the issue to run the tests. I tested qmltestrunner and running tests with C++. They are not equivalent. some tests are passing with c++ but not with qmltestrunner.
- So I've chosen to use C++: It's very simple. I have no knowledge in c++.it only needs 2 files:
qml_tests.pro
CONFIG += warn_on qmltestcase
TEMPLATE = app
SOURCES += \
main.cpp
RESOURCES += \
../../src/main/resources/qml.qrcand the c++ main.cpp :
#include <QtQuickTest/quicktest.h>
QUICK_TEST_MAIN(example)
- Then it needs qmake but as python user pip is your friends : pip install aqtinstall. It's a wrapper to install qt with python.
- install qt: `aqt install 5.14.0 linux desktop --outputdir Qt
- then configure test :
Qt/5.14.0/gcc_64/bin/qmake -o Makefile qml_tests.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
make -C target/qml_tests- run the tests:
./target/qml_tests/qml_tests
And that's it !!! I put all these commands in a Makefile next to install, dev, run_pytest... and it works like a charm.