Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved get rid of a button

    Qt for Python
    pyside2 qt for python
    2
    4
    371
    Loading More Posts
    • 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.
    • iwrwrc
      iwrwrc last edited by

      I have a button in my gui that I can't recognise its origin
      6ced2bd1-2857-4a18-89c6-38ffcc95555d-image.png
      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.

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @iwrwrc last edited by JonB

        @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 either pyuic5 preprocess it to a .py file or use dynamic loadUi(). 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 call addWidget() on to actually add to a layout. I think those "unpositioned" widgets show up at top left corner of parent.

        1 Reply Last reply Reply Quote 1
        • iwrwrc
          iwrwrc last edited by

          @JonB said in get rid of a button:

          QWidget(self)

          I had to use manual modifications on my generated .py because I wanted to use QTabBar instead of QtabWidget,

          and QTabBar is not found in Qt Designer

          JonB 1 Reply Last reply Reply Quote 0
          • JonB
            JonB @iwrwrc last edited by JonB

            @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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post