Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is it a bug to use QGraphicsItem with QMultiMediaWidgets?
Forum Updated to NodeBB v4.3 + New Features

Is it a bug to use QGraphicsItem with QMultiMediaWidgets?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.0k Views 2 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.
  • R Offline
    R Offline
    richie18
    wrote on last edited by richie18
    #1

    My code below can not run normally. I use Python3.6.5, PyQt5.9.2/PyQt5.11.2.

    import QMultiMediaWidgets
    from PyQt5.QtWidgets import QGraphicsObject, QGraphicsPathItem
    
    
    class MyGraphicsObject(QGraphicsObject):
    
        def __init__(self, parent):
    	super(CableLine, self).__init__(parent)
    	self.line = QGraphicsPathItem(self)
    

    MyGraphicsObject is added to the QGraphicsScene. Code above will exit abnormally, process finished with exit code -1073741819 (0xC0000005).

    If i comment first line, code run normally.
    If i change code:

    self.line = QGraphicsPathItem(self)
    

    to:

    self.line = QGraphicsPathItem()
    self.line.setParentItem(self)
    

    code also run normally.

    What is the reason?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What is the relation with QMultiMediaWidgets ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        What is the relation with QMultiMediaWidgets ?

        R Offline
        R Offline
        richie18
        wrote on last edited by
        #3

        @SGaist There is no relationship between QGraphicsItem and QMultiMediaWidgets.
        They are implemented in two different child widgets. When not loading widget which contain QGraphicsItem, widget contain QMultiMediaWidgets can be loaded.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then show the full code that exhibit that behaviour.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply
          0
          • SGaistS SGaist

            Then show the full code that exhibit that behaviour.

            R Offline
            R Offline
            richie18
            wrote on last edited by
            #5

            @SGaist If i have time, may be i can try to code an example to reproduce the problem. The program‘s exit code is 0xC0000005

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Is that specific to only that application or does it happen with other applications you build with PyQt ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @richie18 said in Is it a bug to use QGraphicsItem with QMultiMediaWidgets?:

                The program‘s exit code is 0xC0000005

                There are many many possible reasons for error code 0xC0000005 (for example, accessing a null pointer). The error code alone doesn't tell us anything useful.

                Try to see if you can get any useful info from a debugger. (I don't have experience with debugging Python crashes, sorry)

                @richie18 said in Is it a bug to use QGraphicsItem with QMultiMediaWidgets?:

                If i comment first line, code run normally.
                If i change code:

                self.line = QGraphicsPathItem(self)
                

                to:

                self.line = QGraphicsPathItem()
                self.line.setParentItem(self)
                

                code also run normally.

                I'm guessing the bug is actually in a different part of your code. These lines might be unrelated.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                1

                • Login

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