Apr-02-2020, 05:40 PM
i have some problem deleting widgets from the layout:
I used the removeItem() function but the widgets are still there:
https://1drv.ms/u/s!Ag-Rb-LqQZYuiB0SfkDA...s?e=1zKCKZ
(GUI.py is the executable file)
when you are running the 'GUI.py' you need to delete or change the cmd code part:
I want to change the labels and lineedits shown in the layout when choosing different circuits from the menubar 'circuits'
the code is not complete yet. only 'C' and 'R' are available. 'C' only run the clearlayout function 'R' runs the function and add new widgets onto it.
I used the removeItem() function but the widgets are still there:
def clearlayout(layout): for i in reversed(range(layout.count())): print(layout.itemAt(i)) layout.itemAt(i).setParent(None) layout.removeItem(layout.itemAt(i)) layout.itemAt(i).show()the files are here:
https://1drv.ms/u/s!Ag-Rb-LqQZYuiB0SfkDA...s?e=1zKCKZ
(GUI.py is the executable file)
when you are running the 'GUI.py' you need to delete or change the cmd code part:
#Convert ui to py with PowerShell and reload########################################## command1='cd \\\\filestore.soton.ac.uk\\users\\jy1u18\\mydesktop\\QT' command2='pyuic5 try.ui -o first.py' powershellcmd=subprocess.Popen(['powershell.exe',command1],stdout=sys.stdout) powershellcmd.communicate() powershellcmd=subprocess.Popen(['powershell.exe',command2],stdout=sys.stdout) powershellcmd.communicate() importlib.reload(first) ######################################################################################the code is not complete yet.
I want to change the labels and lineedits shown in the layout when choosing different circuits from the menubar 'circuits'
the code is not complete yet. only 'C' and 'R' are available. 'C' only run the clearlayout function 'R' runs the function and add new widgets onto it.