zoukankan      html  css  js  c++  java
  • Statusbar

    Main window

    The QtGui.QMainWindow class provides a main application window. This enables to create a classic application skeleton with a statusbar, toolbars, and a menubar.

    Statusbar

    A statusbar is a widget that is used for displaying status information.

    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    
    """
    ZetCode PyQt4 tutorial 
    
    This program creates a statusbar.
    
    author: Jan Bodnar
    website: zetcode.com 
    last edited: September 2011
    """
    
    import sys
    from PyQt4 import QtGui
    
    
    class Example(QtGui.QMainWindow):
        
        def __init__(self):
            super(Example, self).__init__()
            
            self.initUI()
            
            
        def initUI(self):               
            
            self.statusBar().showMessage('Ready')
            
            self.setGeometry(300, 300, 250, 150)
            self.setWindowTitle('Statusbar')    
            self.show()
    
    
    def main():
        
        app = QtGui.QApplication(sys.argv)
        ex = Example()
        sys.exit(app.exec_())
    
    
    if __name__ == '__main__':
        main()
    

    The statusbar is created with the help of the QtGui.QMainWindow widget.

    self.statusBar().showMessage('Ready')
    

    To get the statusbar, we call the statusBar() method of the QtGui.QMainWindow class. The first call of the method creates a status bar. Subsequent calls return the statusbar object. The showMessage()displays a message on the statusbar.

  • 相关阅读:
    施密特触发器
    51单片机独立键盘原理
    51单片机独立键盘原理
    hdu3085 Nightmare Ⅱ
    hdu3085 Nightmare Ⅱ
    复制一颗二叉树
    复制一颗二叉树
    判断一颗二叉树是不是完全二叉树
    判断一颗二叉树是不是完全二叉树
    求二叉树的深度及每一个节点的深度
  • 原文地址:https://www.cnblogs.com/hushaojun/p/4435413.html
Copyright © 2011-2022 走看看