Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. get rid of a button

get rid of a button

Scheduled Pinned Locked Moved Unsolved Qt for Python
pyside2qt for python
4 Posts 2 Posters 618 Views
  • 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.
  • iwrwrcI Offline
    iwrwrcI Offline
    iwrwrc
    wrote on last edited by
    #1

    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.

    JonBJ 1 Reply Last reply
    0
    • iwrwrcI iwrwrc

      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.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @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
      1
      • iwrwrcI Offline
        iwrwrcI Offline
        iwrwrc
        wrote on last edited by
        #3

        @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

        JonBJ 1 Reply Last reply
        0
        • iwrwrcI iwrwrc

          @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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

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

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved