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. QFormBuilder was unable to create a custom widget of the class 'QVideoWidget'
Forum Update on Monday, May 27th 2025

QFormBuilder was unable to create a custom widget of the class 'QVideoWidget'

Scheduled Pinned Locked Moved Unsolved Qt for Python
pyside2qt for python
11 Posts 3 Posters 3.0k Views
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    Can you import and create a QVideoWidget if you do it only with code ?

    By the way, which version of PySide2 are you using ?

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

    P 1 Reply Last reply
    1
    • SGaistS SGaist

      Hi and welcome to devnet,

      Can you import and create a QVideoWidget if you do it only with code ?

      By the way, which version of PySide2 are you using ?

      P Offline
      P Offline
      publicname40828
      wrote on last edited by publicname40828
      #3

      @SGaist , thank you for your reply, my lack of understanding of this issue has put my project on a screeching halt

      creating through code:

      testVideoWidget = QVideoWidget
      print(testVideoWidget)
      

      results in:
      <class 'PySide2.QtMultimediaWidgets.QVideoWidget'>

      it seems to work when written in python, but promotion still doesn't

      checking version in pip:

      Requirement already satisfied: pyside2 in /usr/local/lib/python3.8/dist-packages (5.15.2)
      Requirement already satisfied: shiboken2==5.15.2 in /usr/local/lib/python3.8/dist-packages (from pyside2) (5.15.2)
      

      so, looks like v5.15.2 for pyside2

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

        Then I think you may have found a bug.

        You should check the bug report system to see if there's something related already. If not please open a new report providing a minimal project that shows the issue.

        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
        1
        • P Offline
          P Offline
          publicname40828
          wrote on last edited by
          #5

          i wasn't able to find a similar bug, so i posted as suggested:
          https://bugreports.qt.io/browse/QTCREATORBUG-25271

          thank you for pointing me in the right direction

          1 Reply Last reply
          0
          • P Offline
            P Offline
            publicname40828
            wrote on last edited by publicname40828
            #6

            The bug report was closed with the following message:
            "We don't ship a custom widget for QVideoWidget, so this is to be expected."

            is there anything I can do from here?
            is there some way to create it in code and embed it into the form in a specific location?

            without a FOSS QVideoWidget I have to move the entire project to another platform, it completely invalidates my using pyside2 for the project as i want to provide this in a FOSS way the pyqt5 license won't allow, and i'm also not willing to buy a license to provide something free

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

              You should provide a minimal project on the bug report that reproduces that behaviour.

              And explain the steps to reproduce it.

              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
              • P Offline
                P Offline
                publicname40828
                wrote on last edited by
                #8

                i was unable to provide a project example for the following 2 reasons:

                1 - loading any form.ui containing the promoted widget causes the bug, so creating a new pyside2 project in qt-creator is the only requirement

                2- widget promotion ui only allows one widget for each name, so comparing between pyqt5 / pyside2 versions of QVideoWidget seems impossible without some workaround, which lead me to enclose the image snip


                however, in the mean time i've figured out how to neatly embed QVideoWidget declared in python within an existing UI outside of qt creator

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

                  Lets take a step back, I may have misunderstood what is going on:

                  • What step did you use to create the original file that works with PyQt5 but not PySide2 ?
                  • Is it only a bug in Qt Creator or does it also fail at run time ?

                  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
                  1
                  • P publicname40828

                    The bug report was closed with the following message:
                    "We don't ship a custom widget for QVideoWidget, so this is to be expected."

                    is there anything I can do from here?
                    is there some way to create it in code and embed it into the form in a specific location?

                    without a FOSS QVideoWidget I have to move the entire project to another platform, it completely invalidates my using pyside2 for the project as i want to provide this in a FOSS way the pyqt5 license won't allow, and i'm also not willing to buy a license to provide something free

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #10

                    @publicname40828 said in QFormBuilder was unable to create a custom widget of the class 'QVideoWidget':

                    is there some way to create it in code and embed it into the form in a specific location?

                    Please answer @SGaist's questions first. But taking a further step back, in answer to this question you do not have to be able to put a widget on a Designer form or make it work with Promote to use it. Before you say you might abandon the whole Qt approach, are you aware that you can indeed create desired widget type at runtime even if you cannot see it/do so at design-time?

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      publicname40828
                      wrote on last edited by
                      #11

                      thank you each for your responses


                      @SGaist said in QFormBuilder was unable to create a custom widget of the class 'QVideoWidget':

                      • What step did you use to create the original file that works with PyQt5 but not PySide2 ?
                      • Is it only a bug in Qt Creator or does it also fail at run time ?
                      1. making a new project in qt-creator using python auto-generates the code for PyQt5, then i switched the imports to PySide2, and changed the uic method of loading UI for the QUiLoader method. everything else remains completely untouched, and 100% of everything else seems to be perfectly functional without producing any error
                      2. the application will continue to run and function perfectly normal, but the widget won't appear. it's more of an 'ignore' than a 'fail'. from the bug report responses it seems maybe there just -isn't- a QVideoWidget for PySide2?

                      @JonB said in QFormBuilder was unable to create a custom widget of the class 'QVideoWidget':

                      you do not have to be able to put a widget on a Designer form or make it work with Promote to use it. Before you say you might abandon the whole Qt approach, are you aware that you can indeed create desired widget type at runtime even if you cannot see it/do so at design-time?

                      i am aware, it's what i spoke of in this quote, though the way i worded it could have been more clear and could lead to confusion.

                      @publicname40828 said in QFormBuilder was unable to create a custom widget of the class 'QVideoWidget':

                      however, in the mean time i've figured out how to neatly embed QVideoWidget declared in python within an existing UI outside of qt creator

                      i declared the QVideoWidget in python providing the ui as a parent (in arg), then used setGeometry to make it fit the exact location of the widget that was made in the form.ui. this is the only Widget that isn't working for me in the transition from PyQt5 to PySide2 so migrating the project will no longer be necessary, and being able to get the exact geometry in a glance in qt-creator made it a relatively quick fix

                      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