Qt for Python Developers
-
The best book for developers and beginners who want to learn Qt for Python!
- Python, Qt, and C++ with examples.
- QML and Qt Quick with examples.
- PyQt and PySide with examples.
- Graphics, Graphical Effects, and Multimedia.
- Working with Databases (SQL, NoSQL).
- Signals, slots, and event handlers with examples.
- Threading and Multiprocessing in examples of large-scale constructions.
Only by these following links is available the original PDF book "Hands-on Qt for Python Developers" of original Author, and only here for $3 (Crypto is available):
https://volodymyr14.pythonanywhere.com/cv
or:
https://workwith.pythonanywhere.com/buy_book -
This book, at first, for beginning programmers and python developers who want to start with PyQt and PySide.
Try this:
#Install gdb and python-dbg for your working python version (3.9 here)
$ sudo apt-get install gdb python3.9-dbg#To top of the app_file.py
import sys
sys.settrace#Run gdb
$ gdb python3
(gdb) run /path/to/your/app_file.py
...
(gdb) backtrace
... -
Thanks for your reply, Volodymyr! I do get a backtrace, like this one:
#0 0x00007fffbc3e2366 in QGraphicsScene::clearSelection() () at /opt/devpy39dbg/lib/python3.9/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6 #1 0x00007fffbc3c6047 in QGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent*) () at /opt/devpy39dbg/lib/python3.9/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6 #2 0x00007fffbc955090 in Sbk_QGraphicsItemFunc_mousePressEvent () at /opt/devpy39dbg/lib/python3.9/site-packages/PySide6/QtWidgets.abi3.so #3 0x00005555557979e7 in cfunction_vectorcall_O (func=<built-in method mousePressEvent of GRPoint object at remote 0x7ffee793b960>, args=0x7ffee50bf750, nargsf=<optimized out>, kwnames=<optimized out>) at Objects/methodobject.c:512 #4 0x000055555567e365 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=9223372036854775809, args=0x7ffee50bf750, callable=<built-in method mousePressEvent of GRPoint object at remote 0x7ffee793b960>, tstate=0x5555559ae8e0) at ./Include/cpython/abstract.h:118
In this case, I understand that this happens inside the mouse event handler of a custom graphics item of the class GRPoint. But there are thousands of them on the scene, so it not yet possible to focus on the root cause.
What does one have to do to be able to step into the
clearSelection
call? If I try to inspect the local variables, it doesn't work:(gdb) info locals No symbol table info available.
-
@ralienpp said in Qt for Python Developers:
What does one have to do to be able to step into the
clearSelection
call?You would need to have the actual Qt (C++) source files available which were used to compile the Qt you are using, whether you got that from somewhere already compiled or compiled it yourself. (I'm thinking
/opt/devpy39dbg/lib/python3.9/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
was fetched already compiled?) And you may need to have that as a Debug build rather than a Release build, which it may not be. -
Please, provide a code or file that you have a segmentation fault.
-
Only by these following links is available the original PDF book "Hands-on Qt for Python Developers" of original Author, and only here for $3 (Crypto is available):
https://volodymyr14.pythonanywhere.com/cv
or:
https://workwith.pythonanywhere.com/buy_book
Ask a question in this topic. -
Please, post here any issues related to book.