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

  • Home
  • SEARCH
  • 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 8528827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:53:23+00:00 2026-06-11T08:53:23+00:00

PyQt4 how to do if the window is minimized, call a method expand that

  • 0

PyQt4 how to do if the window is minimized, call a method expand that window

please tell me how to do it

I will be very grateful

  • 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-11T08:53:25+00:00Added an answer on June 11, 2026 at 8:53 am

    You can check the current state of a QWidget by calling its windowState() method. To change the state you pass a new state to setWindowState().

    Here’s an example app that checks every 5 seconds to see if it’s minimised. If it is then the window is restored.

    This is just as an example – checking every 5 seconds for a minimised window and restoring it would be an evil thing to do in an app ;).

    import sys
    import time
    from PyQt4.QtGui import QApplication, QWidget
    from PyQt4.QtCore import QTimer, Qt
    
    class MyWidget(QWidget):
        def __init__(self):
            QWidget.__init__(self)
    
            self.timer = QTimer()
            self.timer.setInterval(5000)
            self.timer.timeout.connect(self.check_state)
            self.timer.start()
    
        def check_state(self):
            if self.windowState() == Qt.WindowMinimized:
                # Window is minimised. Restore it.
                self.setWindowState(Qt.WindowNoState)
    
    
    if __name__ == '__main__':        
        app = QApplication(sys.argv)
        widget = MyWidget()
        widget.show()
        sys.exit(app.exec_())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to build a user interface using PyQt4. Got a dialog window that pops
I'm developing a plugin UI for an existing application using PyQt4. The window is
I want to make a PyQT4 window( QtGui.QMainWindow ) jump to the front when
I am starting to learn to use PyQt4. I've got a simple gui window
how to call a permanent xterm window and it's closed only when user close
I'm writing a linux application which uses PyQt4 for GUI and which will only
I am writing an application in Qt using python that will process a txt
I have a PyQt4 program that I froze using cx_freeze. The problem I am
I'm having problems with a New Window function in PyQt4/PySide with Python 2.7. I
just a simple question: I'm using pyqt4 to render a simple window. Here's the

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.