Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9257239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:08:18+00:00 2026-06-18T12:08:18+00:00

I have a layout in a class inherited from QtGui.QWidget window. Lets say I

  • 0

I have a layout in a class inherited from QtGui.QWidget window. Lets say I have three labels and a button , and when I click on a button , one of the Labels disappear. This spoils my QtGui.QWidget because the other two labels automatically resize. I wouldn’t want that to happen. I want my labels to be placed as before , with only the third label disappearing.
Any tips?

Simplified version of my code:

class a(QtGui.QWidget):
    def __init__(self):
        //Everything needed is done
        self.UI()

    def UI(self):
        layout = QtGui.QGridLayout(self)
        self.label1 = QtGui.QLabel('Label1')
        label2 = QtGui.QLabel('Label2')
        label3 = QtGui.QLabel('Label3')
        layout.addWidget(self.label1 , 0 , 0)
        layout.addWidget(label2 , 1 , 0) 
        layout.addWidget(label3 , 2 , 0)
        button = QtGui.QPushButton('Hide')
        button.clicked.connect(fun)

    def fun(self):
        self.label1.hide()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:08:19+00:00Added an answer on June 18, 2026 at 12:08 pm

    You can place label1 widget inside a QFrame with no frame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following layout : And following code : public class MailSenderActivity extends
I have class that extend FragmentActivity in it I add fragment to layout as
I have a CustomButton class (extends LinearLayout ) where I inflate a layout which
I have a class that extends android.app.Dialog, the layout is done in an xml
I have a basic layout page template: --- layout: default --- <header class="sidebar"> {{
I have developed a server control inherited from WebControl that wraps any number of
I have an activity inherited from ListActivity and using AndroidAnnotations. While .onListItemClick works fine,
I've got a strange issue. I have a class that inherits from RelativeLayout .
I have a webform that inherits the layout from a Site.Master file. Everytime I
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.