[PySide] Problem promoting a custom widget in QtDesigner

henry.wede at yahoo.com henry.wede at yahoo.com
Tue Oct 24 05:41:34 CEST 2023


 Hello,
After a couple frustrating days with the QGraphicsView and QGraphicsScene, I have most of the hard stuff done.  Or so I thought...  I need to deal with scaling the scene when the size of the window changes.  I found a working example at this link:
https://stackoverflow.com/questions/63543338/resizing-qgraphicsscene-when-layout-changes
The bottom example on that page does what I need it to do.  Except that it lays out the widgets manually and I use QtDesigner for everything because the applications can become large and it is much easier.  So then I looked into promoting my QGraphicsView into a custom widget.  That is when I hit a wall.
After making the change in QtDesigner, it looks like this:



At the bottom of the UI file it seems to have the correct filename and class name for the custom widget.  And the class seems to be "inserted" correctly.




But when I run the program, it displays a rather unhelpful message and reverts back the normal widget


The attached files should duplicate what I have described.

Can somebody please tell me how to promote these widgets properly?
Thank you in advance,Henry 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QtDesigner Image.png
Type: image/png
Size: 93849 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UI File 01.png
Type: image/png
Size: 7544 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UI File 02.png
Type: image/png
Size: 11823 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DOS Window Error Message.png
Type: image/png
Size: 6795 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0007.png>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ResizingGraphicsView.py
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestSVG_Smaller.py
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0003.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SVGTest.ui
Type: application/octet-stream
Size: 3857 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20231024/06642ca6/attachment-0001.obj>


More information about the PySide mailing list