Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Qt for Python Developers
Forum Updated to NodeBB v4.3 + New Features

Qt for Python Developers

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 3 Posters 723 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Volodymyr14V Offline
    Volodymyr14V Offline
    Volodymyr14
    wrote on last edited by
    #1

    The best book for developers and beginners who want to learn Qt for Python!

    1. Python, Qt, and C++ with examples.
    2. QML and Qt Quick with examples.
    3. PyQt and PySide with examples.
    4. Graphics, Graphical Effects, and Multimedia.
    5. Working with Databases (SQL, NoSQL).
    6. Signals, slots, and event handlers with examples.
    7. 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

    PyQt/PySide

    1 Reply Last reply
    0
    • ralienppR Offline
      ralienppR Offline
      ralienpp
      wrote on last edited by
      #2

      Does the book contain a chapter with debugging techniques for dealing with segmentation faults?

      1 Reply Last reply
      0
      • Volodymyr14V Offline
        Volodymyr14V Offline
        Volodymyr14
        wrote on last edited by Volodymyr14
        #3

        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
        ...

        PyQt/PySide

        1 Reply Last reply
        0
        • ralienppR Offline
          ralienppR Offline
          ralienpp
          wrote on last edited by
          #4

          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.
          
          JonBJ 1 Reply Last reply
          0
          • ralienppR ralienpp

            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.
            
            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @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.

            1 Reply Last reply
            0
            • Volodymyr14V Offline
              Volodymyr14V Offline
              Volodymyr14
              wrote on last edited by
              #6

              Please, provide a code or file that you have a segmentation fault.

              PyQt/PySide

              1 Reply Last reply
              0
              • Volodymyr14V Offline
                Volodymyr14V Offline
                Volodymyr14
                wrote on last edited by
                #7

                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.

                PyQt/PySide

                1 Reply Last reply
                0
                • Volodymyr14V Offline
                  Volodymyr14V Offline
                  Volodymyr14
                  wrote on last edited by
                  #8

                  Please, post here any issues related to book.

                  PyQt/PySide

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved