Python Forum
How to loop through all QLineEdit widgets on a form
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to loop through all QLineEdit widgets on a form
#1
Hello everyone,

Greetings from Brazil! Does anybody know a quick and easy way to loop through all QLineEdit widgets on a form and clear them? Thanks for your time and help. I really appreciate it.


This is how I am currently doing it:

    myform = {ui.lineEdit_name, ui.lineEdit_email, ui.lineEdit_pwd, ui.lineEdit_mktg, ... etc.}
    for fields in myform:
        fields.clear()
Best regards.
Reply


Messages In This Thread
How to loop through all QLineEdit widgets on a form - by JayCee - Apr-02-2020, 05:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] QLineEdit Caret (Text Cursor) Transparency malonn 5 2,888 Nov-04-2022, 09:04 PM
Last Post: malonn
  How to accept only float number in QLineEdit input ism 5 28,628 Jul-06-2021, 05:23 PM
Last Post: deanhystad
  Simple printing the text for a QLineEdit thewolf 16 8,022 Mar-06-2021, 11:37 PM
Last Post: deanhystad
  PyQt5: How to retrieve a QLineEdit by its name ? arbiel 4 7,971 Oct-21-2020, 02:35 PM
Last Post: arbiel
  Two QlineEdit box, which interrelated GMCobraz 1 2,444 Aug-14-2020, 07:15 PM
Last Post: deanhystad
  [PyQt] Dynamically add and remove QLineEdit's GMCobraz 3 7,212 Jun-23-2020, 07:01 PM
Last Post: Yoriz
  prompt for input in qlineedit GMCobraz 3 3,254 Jun-22-2020, 01:51 PM
Last Post: GMCobraz
  [PyQt] display content from left to right in QComboBox or QLineEdit mart79 2 2,349 May-30-2020, 04:38 PM
Last Post: Axel_Erfurt
  [PyQt] How to clear multiple Qlineedit in a loop mart79 6 7,814 Aug-15-2019, 02:37 PM
Last Post: Denni
  How to validate multiple QLineEdit widgets without addressing them separately? mart79 3 4,293 Aug-08-2019, 12:50 PM
Last Post: Denni

Forum Jump:

User Panel Messages

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