hi, is there any way to "debug" a qml file? I don't know why my GridLayout isn't taking all the space in a StackLayout..., or change the background for those Layouts to "check" if the problem is the layout, or the elements inside the layout
good question, I really haven't done any 'real application' with QML but you could do some things with Qt Creator, or having some specials modules https://doc.qt.io/qt-6/qtquick-debugging.html
dit = QtCore.QDirIterator(':', QtCore.QDirIterator.Subdirectories)
while dit.hasNext():
print(dit.next())
Works! This is pretty interesting! There is LOAAAADS of trolltech stuff inside!
Видео WhatsApp Video 2022-01-05 at 15.03.30.mp4 · 4.1 MB · click to show
Hello Dears,
I'm facing with a very annoying bug in my application. Let me give some details about it ;
I'm using a touchscreen and my application only have one button to pop-up a Qdialog. You can access the code from this link.
https://gist.github.com/barissacikara/24efb7e29148f35334b1bfee56cae13d
The bug is : after sometime qt stop accepting any touchevent in my application however clicking from mouse seems working.
I'm tried with both Pyside2 and Pyside6 and
I'm using Xubuntu 20.04
do you guys have any idea about this bug ?
on PySide2 : i have this warning : qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1759, resource id: 8786722, major code: 40 (TranslateCoords), minor code: 0
and on pyside6 i have this warning also :
mmm not sure, but something that got my attention:
- Even if addWidget takes ownership of the objects, please either make btn a class attribute, self.btn or set a parent when initializing it btn = QPushButton("Click Me", parent=self)
- Decorate the slots with the @Slot decorator
Yes. We discussed this a while back. There is an object you need to instantiate (that automatically happens for a C++ project) before qml debugger can work. Then you can attach to your app from Qt Creator.
Here's the magic you need to add to your python entrypoint file:
At the top add this import:
from PySide2.QtQml import QQmlDebuggingEnabler
Then in your if __name__ == "__main__":, instantiate a QQmlDebuggingEnabler - doesn't matter that it doesn't get used, so you will need to shut up pylint if you use that.:
debug = QQmlDebuggingEnabler() # pylint: disable=unused-variable
Then, when you launch your app, pass
-qmljsdebugger=port:10002,block on the command line. (Do make sure that QApplication receives sys.argv, or this will have no effect)
Then, when you launch the app, it will pause waiting for the debugger when the QML engine starts. — Then in Qt Creator, in the debug menu, choose the Debug->Start Debugging->Attach to QML Port menu item. Match the port defined above (10002), pick a Qt Kit that matches what is used in the PySide version you're using (better, create a kit that points into the site-packages/PySide2(/6) dir (I think that will work) - then it will use the exact build. I think it uses it just to access the qml dir to find the QML files - but not entirely sure.
K
@kushal - I first read that as Trumpa heh.. OpenPGP key creation UI seems better to me than what was on my mind.