Trying to build from sources rn (under Linux Mint)... Facing CMake Error: The source directory "/home/user/pyside-debug/pyside-setup/sources/pyside2-tools" does not appear to contain CMakeLists.txt. Is it for .uic files, etc? I don't really need them, can they be skipped? Or what should I include to proceed the build process?
6 August 2021
usserrI see there are folders such as /home/user/Qt/5.15.2/Src/qttools and /home/user/Qt/5.15.2/Src/qtbase/src/tools, seems like build scripts cannot find them, though...
do not remove stuff from the Qt installation, that's unrelated to your problem. Your problem is only about the pyside-setup repo :P
bayangHi, what is the best ways to create a installable version of Qt/PySide2 application for windows?
No idea sorry :/
I have never deployed python applications in that way, I know pyinstalled has many issues, that's why I tend to recommend cx_Freeze, but I'm unaware of how well it works with qml based applications.
I will try cs_Freeze.
Thank you @cmaureir
if you succeed, it would be really nice if you could submit a new tutorial on https://doc.qt.io/qtforpython/deployment.html#deployment-guides for that specific case.
Cristián 🥑a git submodule update --init -f will probably bring that old submodule to the repo
wow, works like a charm 👍
usserrmessages like QQmlExpression: Attempted to evaluate an expression in an invalid context are not very informative 😕
@cmaureir I was going to suggest to Andrey that he try the QML debugger, but, I don't know how to enable that in Python, if there is any way.
With a C++ project, you can enable QML debugging, but it requires you to provide preprocessor define QT_QML_DEBUG when building the application. Obviously you can't do that in Python.
Is there a solution for this?
https://doc.qt.io/qt-5/qtquick-debugging.html
Anyway - @ussserrr - that page should give you some pointers that may help identify where the issue you're seeing is coming from.
If we don't have support yet for it, I'll open a jira ticket on https://bugreports.qt.io/ for it.
If I don't follow up, can you bug me about it @ussserrr ?
Keith Kyzivat@cmaureir I was going to suggest to Andrey that he try the QML debugger, but, I don't know how to enable that in Python, if there is any way.
With a C++ project, you can enable QML debugging, but it requires you to provide preprocessor define QT_QML_DEBUG when building the application. Obviously yo
buff I haven't tried to be honest
usserr@Keithel K, but I cannot guarantee it 100%, maybe I’ll just find the solution in «the old fashioned way» 🙄
lol you could always port your application to C++ and test it there :D lol
Or at least the QML parts.
Keith Kyzivat@cmaureir I was going to suggest to Andrey that he try the QML debugger, but, I don't know how to enable that in Python, if there is any way.
With a C++ project, you can enable QML debugging, but it requires you to provide preprocessor define QT_QML_DEBUG when building the application. Obviously yo
from the docs, I *think* i have seen people using that with PySide, because the -qmljsdebugger=... rings a bell
Cristián 🥑from the docs, I *think* i have seen people using that with PySide, because the -qmljsdebugger=... rings a bell
Hmm It doesn't look like the debugging infrastructure is instantiated, or is the code present when QT_QML_DEBUG is not present - see qt5/qtdeclarative/src/qml/debugger/qqmldebug.h
Though I suppose if the Qt for Python shiboken wrapper libs are compiled with QT_QML_DEBUG, the necessary infrastructure would be in place.
Ok, looks like it may be possible to use now, and there's also probably some work in PySide to make this nice and convenient to enable.
The logic to define QQmlDebuggingEnabler is present (if QT_CONFIG(qml_debug) is set at Qt compile time, which I think in most cases it is), but the creation of the static QQmlDebuggingEnabler object only occurs if QT_QML_DEBUG or QT_QML_DEBUG_NO_WARNING preprocessor macro is defined in user code.
So, I think to use it in a user python app right now (if QQmlDebuggingEnabler class is wrapped by shiboken) is to construct a global variable that holds the call to qQmlEnableDebuggingHelper(bool) prior to the creation of a QQmlEngine. Since this occurs in a header file that I think is pulled in when the header for the QML engine is pulled in, I think this will happen before a QApplication is instantiated, but I'm not sure.
Фотография
click to show
click to show
Ok - so the QQmlDebuggingEnabler is wrapped, and can be instantiated in Python, but I haven't been able to get Qt Creator to actually set the breakpoints. It seems to insist that "Some breakpoints cannot be handled by the debugger languages currently active, and will be ignored." ^^
And alas, it doesn't work, but the app will run ok.
If you go to stop the debugger, it won't fully stop the application though, and you need to go over to the "Application Output" pane, and force quit the application for it to be fully stopped. I also got it to hang Qt Creator if the application itself quit.
Just found origin of errors
First, when the signal from Python side is connected to ordinar function on QML side it is called even after the backend instance destruction. It doesn't happened if connection is made to a signal on QML side.
Second, one of several DSM.StateMachines was still operating even after Python side deconstructed — the connection of a custom signal (built-in destroyed signal also seems to be ignored) to the stop slot of a state machine is sufficient enough to prevent such behavior.
remind that all this applies to version 5.15.2