Python custom widget for Qt Designer
-
I have develop , for windows desktop, a Python Qt Designer custom widget (running!) in
the following environment:Python 3.6.1 installed in C:\Python36
PyQt5 installed using pip3 install pyqt5
Qt Designer installed using pip3 install pyqt5-toolsYou can download the source files at:
https://mega.nz/#!5KZWkSDR!Ky81kaxIMSx_xzNvwCxmsC8sW9keSzIzV9yHNFxqNl8In C:\PYTHON\MM_Widget_Library run BuildALL.bat
In C:\PYTHON\Line_test run test_line.pyYou can see new widget by running
C:\Python36\Lib\site-packages\pyqt5-tools\designer.exe
(see PYTHON_MM_Widget.jpg)Selecting T_line, right in the Property Editor appear
defined properties:
ColorON Color_OFF OrientationVerticalIt's easy to add new properties in the code
of type int, str (= string), float.
For each property, it will appear in the Qt Design Property Editor
a new line with the assigned name and the ability to edit the content.--- THE PROBLEM ----
I would like to add a new property (STATIC!), enumerative type or list.
I would like to a new property that allows to choose one of the options.
Showing a drop down menu, a combo, or similar stuffI tried to use:
NewProp = pyqtProperty("QList", NewProp, setNewProp)
NewProp = pyqtProperty("QListWidget", NewProp, setNewProp)
NewProp = pyqtProperty("StringList", NewProp, setNewProp)without success.
Can anybody help me?
Thanks