Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Python custom widget for Qt Designer
Forum Update on Monday, May 27th 2025

Python custom widget for Qt Designer

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
python3pyqt5designerwidget
2 Posts 2 Posters 1.8k 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.
  • P Offline
    P Offline
    Pierone
    wrote on 12 Jul 2017, 09:05 last edited by
    #1

    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 21 May 2018, 16:18
    0
    • P Pierone
      12 Jul 2017, 09:05

      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 Offline
      P Offline
      PJM4B
      wrote on 21 May 2018, 16:18 last edited by
      #2

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

      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