Python Forum
Auto populate dictionary with names/values of QT widgets
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto populate dictionary with names/values of QT widgets
#2
I would do things in reverse. Use the dictionary to automatically build the GUI. Or maybe a list to build them both? I would make a list of fields automatically extracted from the word documents and use that to automatically build the dictionary and GUI program

Widgets are not iterable, but you can ask for the child widgets of a widget, and that gives you an iterator. I posted this a while back as a way to clear all the line edit widgets in a form.
for w in form.findChildren(QLineEdit):
    w.clear()
Reply


Messages In This Thread
RE: Auto populate dictionary with names/values of QT widgets - by deanhystad - Mar-23-2021, 02:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] populate a QListWidget devilonline 1 1,640 Apr-10-2023, 02:52 AM
Last Post: deanhystad
  [PyQt] [Solved]Populate ComboBox with for loop? Extra 3 2,178 Jul-31-2022, 09:01 PM
Last Post: Extra
  Problems getting tk Combobox contents to populate properly dford 4 3,874 Jan-08-2022, 02:39 PM
Last Post: dford
  [PyQt] How to populate a treeview on a GUI with a dictionary mart79 1 8,300 Aug-05-2019, 01:30 PM
Last Post: Denni
  populate list with images and be able to select them ricardons 0 2,149 Jan-11-2019, 03:45 PM
Last Post: ricardons
  Hardest time getting DataFrame to populate Tree Widget WuchaDoin 4 7,423 Oct-15-2018, 08:29 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020