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.

Statusbar的更多相关文章

  1. 使用Xamarin开发iOS7应用时隐藏StatusBar方法

    在iOS7之前如果需要隐藏StatusBar,比较简单,直接在AppDelegate.cs中使用如下代码就可以进行隐藏: UIApplication.SharedApplication.StatusB ...

  2. 【Windows编程】系列第六篇:创建Toolbar与Statusbar

    上一篇我们学习了解了如何使用Windows GDI画图,该应用程序都是光光的静态窗口,我们使用Windows应用程序,但凡稍微复杂一点的程序都会有工具栏和状态栏,工具栏主要用于一些快捷功能按钮.比如典 ...

  3. iOS9,导航控制器中的子控制器设置StatusBar状态失效的问题

    iOS9之前控制StatusBar的两种方式: 第一种方式:全局控制StatusBar 1. 在项目的Info.plist文件里设置UIViewControllerBasedStatusBarAppe ...

  4. ios 实现自定义状态栏StatusBar 和 导航栏navigationBar 的状态和颜色

    很多app中可以看到不同与导航栏的状态栏的颜色,他妈的真绕嘴. 一.更改状态栏颜色 (StatusBar) 就是比如导航栏是红色的状态栏是绿色的. 要实现这样的效果其实很简单,就是添加一个背景view ...

  5. 关于StatusStrip控件和StatusBar控件的小试

    今天,在网上查找资料,突然看到一个例子,但例子中提及的StatusBar控件,我发现在vs控件压根不存在,我就郁闷了,于是上网查找才知道,现在这个控件已经被StatusStrip控件给吞了,Statu ...

  6. Android应用:StatusBar状态栏、NavigationBar虚拟按键栏、ActionBar标题栏、Window屏幕内容区域等的宽高

    一.屏幕中各种栏目以及屏幕的尺寸 当我们需要计算屏幕中一些元素的高度时,或许需要先获取到屏幕或者各种栏目的高度,下面这个类包含了Status bar状态栏,Navigation bar虚拟按键栏,Ac ...

  7. [转载]ExtJs4 笔记(12) Ext.toolbar.Toolbar 工具栏、Ext.toolbar.Paging 分页栏、Ext.ux.statusbar.StatusBar 状态栏

    作者:李盼(Lipan)出处:[Lipan] (http://www.cnblogs.com/lipan/)版权声明:本文的版权归作者与博客园共有.转载时须注明本文的详细链接,否则作者将保留追究其法律 ...

  8. iOS开发中的错误整理,iOS9之后的UIWindow(TopWindow)以及UIWindow与statusBar的关系

    iOS9之后的UIWindow的问题(TopWindow),以及UIWindow与statusBar之间的联系 1.出现的问题 iOS9之后UIWindow必须要指定一个根控制器,不然会报错!iOS9 ...

  9. statusbar 样式

    1:statusBar字体为白色 在plist里面设置View controller-based status bar appearance 为 NO:设置statusBarStyle 为 UISta ...

  10. React Native组件之ScrollView 和 StatusBar和TabBarIos

    React Native中的组件ScrollView类似于iOS中的UIScrollView,其基本的使用方法和熟悉如下: /** * Sample React Native App * https: ...

随机推荐

  1. asp.net 判断日期是否为空

    if (Birthday == DateTime.MinValue) { //u can do something here } 首先确保Birthday是不可为null的日期类型.如果可为null就 ...

  2. php 获取开始日期与结束日期之间所有日期

    话不多说,源码奉上! function getDateRange($startdate, $enddate) { $stime = strtotime($startdate); $etime = st ...

  3. Tasker to create toggle widget for ES ftp service -- Send Intent

    To perform this mission, Tap the tab "tasks" of Tasker, create a task as below.Task: (ES F ...

  4. PHP中的 变量 与 常量 详解

    几乎所有的编程语言都会涉及到变量和常量这两个概念,PHP也不例外.本节将介绍PHP语言中的变量和常量的应用方法. 一.什么是变量和常量 在程序执行的过程中,变量存储的值可以随时改变,而常量存储的值是不 ...

  5. SET XACT_ABORT ON 数据库事务

    转载:http://www.cnblogs.com/rob0121/articles/2320932.html SET XACT_ABORT ON SET XACT_ABORT ON分为两种: 1.总 ...

  6. powerdesigner反向SQLServer2008数据库生成物理数据模型

    方法一:通过数据库脚本生成物理数据模型 具体步骤如下图所示:

  7. [翻译] ClockView 时钟

    ClockView 时钟 https://github.com/nacho4d/ClockView Overview ClockView is s simple class that will sim ...

  8. VirtualBox 快捷键

    VirtualBox 的 Host 键是哪一个? 默认的 Host = Right Ctrl 组合键,意思是键盘上两个 “Ctrl”中右边的那个.键盘上是没有 “Right”这个键的,刚开始不明白,后 ...

  9. 什么是C++虚函数、虚函数的作用和使用方法

    我们知道,在同一类中是不能定义两个名字相同.参数个数和类型都相同的函数的,否则就是“重复定义”.但是在类的继承层次结构中,在不同的层次中可以出现名字相同.参数个数和类型都相同而功能不同的函数.例如在例 ...

  10. 第一章 EL表达式常见用法

    el最常用的几种使用场景: 从配置文件中读取属性 缺失值情况下,配置默认值 el内部字符串使用String的方法 三目运算符 正则表达式 注入系统属性(system properties) 调用系统原 ...