Statusbar、Menubar、Toolbar合集
In the last example of this section, we create a menubar, a toolbar and a statusbar. We also create a central widget.
#!/usr/bin/python
# -*- coding: utf-8 -*- """
ZetCode PyQt4 tutorial This program creates a skeleton of
a classic GUI application with a menubar,
toolbar, statusbar and a central widget. 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): textEdit = QtGui.QTextEdit()
self.setCentralWidget(textEdit) exitAction = QtGui.QAction(QtGui.QIcon('exit24.png'), 'Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(self.close) self.statusBar() menubar = self.menuBar()
fileMenu = menubar.addMenu('&File')
fileMenu.addAction(exitAction) toolbar = self.addToolBar('Exit')
toolbar.addAction(exitAction) self.setGeometry(300, 300, 350, 250)
self.setWindowTitle('Main window')
self.show() def main(): app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_()) if __name__ == '__main__':
main()
This code example creates a skeleton of a classic GUI application with a menubar, toolbar, and a statusbar.
textEdit = QtGui.QTextEdit()
self.setCentralWidget(textEdit)
Here we create a text edit widget. We set it to be the central widget of the QtGui.QMainWindow
. The central widget occupies all space that is left.
Figure: MainWindow
Statusbar、Menubar、Toolbar合集的更多相关文章
- 掘金 Android 文章精选合集
掘金 Android 文章精选合集 掘金官方 关注 2017.07.10 16:42* 字数 175276 阅读 50053评论 13喜欢 669 用两张图告诉你,为什么你的 App 会卡顿? - A ...
- 最新最全的 Android 开源项目合集
原文链接:https://github.com/opendigg/awesome-github-android-ui 在 Github 上做了一个很新的 Android 开发相关开源项目汇总,涉及到 ...
- SQL Server技术内幕笔记合集
SQL Server技术内幕笔记合集 发这一篇文章主要是方便大家找到我的笔记入口,方便大家o(∩_∩)o Microsoft SQL Server 6.5 技术内幕 笔记http://www.cnbl ...
- 【Android】开发中个人遇到和使用过的值得分享的资源合集
Android-Classical-OpenSource Android开发中 个人遇到和使用过的值得分享的资源合集 Trinea的OpenProject 强烈推荐的Android 开源项目分类汇总, ...
- [Erlang 0122] Erlang Resources 2014年1月~6月资讯合集
虽然忙,有些事还是要抽时间做; Erlang Resources 小站 2014年1月~6月资讯合集,方便检索. 小站地址: http://site.douban.com/204209/ ...
- [Erlang 0114] Erlang Resources 小站 2013年7月~12月资讯合集
Erlang Resources 小站 2013年7月~12月资讯合集,方便检索. 附 2013上半年盘点: Erlang Resources 小站 2013年1月~6月资讯合集 小站地 ...
- SQL用法操作合集
SQL用法操作合集 一.表的创建 1.创建表 格式: 1 CREATE TABLE 表名 2 (列名 数据类型(宽度)[DEFAULT 表达式][COLUMN CONSTRAINT], 3 ... ...
- Python学习路径及练手项目合集
Python学习路径及练手项目合集 https://zhuanlan.zhihu.com/p/23561159
- Lucene搜索方式大合集
package junit; import java.io.File; import java.io.IOException; import java.text.ParseException; imp ...
随机推荐
- 【8.28校内测试】【区间DP】
感受到了生活的艰辛QAQ...这才是真正的爆锤啊...(因为t1t3还没有理解所以只能贴t2叻QAQ 区间DP...爆哭把题理解错了,以为随着拿的东西越来越多,断点也会越来越多,出现可以选很多的情况Q ...
- Scrapy 轻松定制网络爬虫(转)
网络爬虫(Web Crawler, Spider)就是一个在网络上乱爬的机器人.当然它通常并不是一个实体的机器人,因为网络本身也是虚拟的东西,所以这个“机器人”其实也就是一段程序,并且它也不是乱爬,而 ...
- Tasker, Android系统增强神器
Tasker是一个让系统根据用户定制的”配置文件”(Profiles),在特定的”背景”下(Contexts),执行指定”任务”(Tasks)的软件, 除此之外,它还提供”可供点击”的(Clickab ...
- Si4355 低电流 Sub-GHz接收器
Silicon Labs 的 Si4355 是易于使用的.低电流.Sub-GHz EZRadio® 接收器.覆盖所有主要波段,结合了即插即用的简单性和需要处理各种不同应用的灵活性.紧凑的 3 mm x ...
- IDA 显示函数名称技巧
http://blog.csdn.net/safedebug/article/details/17061735v
- CMoLineMgr
#ifndef __E3GLOGOBJECTDB_H__ #define __E3GLOGOBJECTDB_H__ #include "PubCommon\Singleton.h" ...
- sqlserver获取指定数据库的描述
SELECT 字段名= convert(varchar(100), a.name), 表名= convert(varchar(50), d.name ), 类型= CONVERT(varchar(50 ...
- servlet匹配路径时/和/*的区别(转)
本文转自https://blog.csdn.net/rongxiang111/article/details/53008829 一.<url-pattern>/</url-patte ...
- ArcGIS for Android 点击选择
public void onSingleTap(float arg0, float arg1) { //selFeatureLayer.selectFeature(5); Point p = mMap ...
- HttpClient使用例子
HttpClient client = new HttpClient(); String url = http://localhost:8080/ana/workFlowOaInterface.do? ...