ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

6 August 2021
2021-08-06×
6 August 2021
U
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?
that's a 5.15 only directory, in dev and 6.x was removed, so if you switched branches, just remove it.
C
There is an no-qt-tools but that's only for 6.x (dev)
I 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...
U
What should I remove, I didn't fully understand you
a git submodule update --init -f will probably bring that old submodule to the repo
Hi, what is the best ways to create a installable version of Qt/PySide2 application for windows?
The app has many qml file, but when I follow instruction of Pyinstaller, it does not work as well.
I succed to transform qt application based on qml, but i got some issue with Interaction between application and database.
U
OK, so now I have a working build but QMessageLogContext still doesn't has any info... I've built PySide with a --debug option. Do I also need a debug build of a Python itself?
C
Only if you want to go into cpython internals. What's the issue? (maybe you opened a jira report?)
I want to see what exactly causes the QML part of app to throw warnings, errors etc. I.e. some kind of a stack trace (at least a last line where a corresponding line of code is specified)
U
messages like QQmlExpression: Attempted to evaluate an expression in an invalid context are not very informative 😕
C
maybe a normal process to debug a qml file might work too
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
K
Anyway - @ussserrr - that page should give you some pointers that may help identify where the issue you're seeing is coming from.
U
OK, I will take a look. Thanks for your kind help
I'm looking into this issue, as it would be very helpful for anyone debugging QML in Qt for Python applications.
U
@Keithel K, but I cannot guarantee it 100%, maybe I’ll just find the solution in «the old fashioned way» 🙄
C
do you what does QT_QML_DEBUG internally? maybe we could set something similar
U
I wonder how projects like Spyder are developed… There is definetely some lack of dev tools in the Qt-Python space and Spyder is a huge app to develop just «by intuition»
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
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.
K
I'm going to see if I can manually launch the debugger outside of Qt Creator. I've never tried to do that.
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
U
Just commenting out code segments one by one to eventually locate when the error disappears :) Old but gold method
Calendar: August 2021
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog