Custom Qt Widgets with python for Qt Designer

前端 未结 3 1270
耶瑟儿~
耶瑟儿~ 2021-02-04 13:49

I am trying to write a custom widget for the Qt Designer using only Python. I was following a couple of tutorials I found online but none of them were working or anything close

相关标签:
3条回答
  • 2021-02-04 14:17

    I found this article to be your answer: https://doc.qt.io/archives/qq/qq26-pyqtdesigner.html

    But, I haven't been able to install it in Qt Designer though :D

    0 讨论(0)
  • 2021-02-04 14:24

    There are very few examples available on how to make a custom widget in pyqt. I wrote this article with a working example: Making a Custom Widget in PyQt

    0 讨论(0)
  • 2021-02-04 14:37

    Here is the answer to your question #3: How do I use promote to in Qt Designer in pyqt4?

    I am using PySide and it works the same way. This method works directly with your Python custom widget code. You do not need to write any separate plugin code.

    After you have promoted your custom widget, you can right click on it and add your signals with "Change signals/slots..."

    I would recommend putting all you widgets in a YourCostumWidgetsPack.UI file, and then when you load this file in Qt Designer, in addition to the UI you are working. It will load all your custom widget information.

    0 讨论(0)
提交回复
热议问题