get rid of a button
-
I have a button in my gui that I can't recognise its origin
This one in right!
My .py file for interface that I generated after designing the interface in qtdesigner is kind of long to share, also the problem now is that i added some codes manually in the .py file, which made it for me difficult to re-open the interface using qt designer.
is there any quick way to find which code is responsible for that button?Any help would be appreciated.
-
@iwrwrc said in get rid of a button:
also the problem now is that i added some codes manually in the .py file, which made it for me difficult to re-open the interface using qt designer.
You're not supposed to do this. If you want to use Designer you should stick with using its saved
.ui
file and then eitherpyuic5
preprocess it to a.py
file or use dynamicloadUi()
. What are you going to do in the future if you do want make a redesign of the UI?is there any quick way to find which code is responsible for that button?
Not really, without more work than it will take to track down. Since it;s at the top left, my guess is that you have somewhere a
QWidget(self)
(could be any widget type) which you do not then calladdWidget()
on to actually add to a layout. I think those "unpositioned" widgets show up at top left corner of parent. -
@iwrwrc
There are better ways of doing this than your approach. You have chosen to sacrifice the ability to re-edit the design at any future date. Up to you, it's not what I would have done.You have quoted
QWidget(self)
I don't know why, and my suggestion that the most likely might be an "unpositioned" widget declared like this but never added still remains. And of course it might have something to do with whatever you did to
QTabWidget
/QTabBar
.