Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Python custom widget for Qt Designer

    3rd Party Software
    python3 pyqt5 designer widget
    2
    2
    1569
    Loading More Posts
    • 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.
    • P
      Pierone last edited by

      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-tools

      You can download the source files at:
      https://mega.nz/#!5KZWkSDR!Ky81kaxIMSx_xzNvwCxmsC8sW9keSzIzV9yHNFxqNl8

      In C:\PYTHON\MM_Widget_Library run BuildALL.bat
      In C:\PYTHON\Line_test run test_line.py

      You 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 OrientationVertical

      It'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 stuff

      I 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

      P 1 Reply Last reply Reply Quote 0
      • P
        PJM4B @Pierone last edited by

        @Pierone Can you put you code in GitHub instead of a rar file? Its pretty awkward to unpack your code.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post