from PyQt4 import QtGui

from PyQt4 import QtCore

from PyQt4.QtCore import pyqtSlot,SIGNAL,SLOT

import sys

class myTabWidget(QtGui.QTabWidget):

def tabChangedSlot(self,argTabIndex):

QtGui.QMessageBox.information(self,"Tab Index Changed!",

"Current Tab Index: "+QtCore.QString.number(argTabIndex));

def main():

app     = QtGui.QApplication(sys.argv)

tabWidget      = myTabWidget()

tabWidget.addTab(QtGui.QWidget(),"1");

tabWidget.addTab(QtGui.QWidget(),"2");

tabWidget.addTab(QtGui.QWidget(),"3");

#Resize width and height

tabWidget.resize(300,120)

tabWidget.setWindowTitle('QTabWidget Changed Example')

tabWidget.connect(tabWidget,

SIGNAL("currentChanged(int)"),tabWidget,SLOT("tabChangedSlot(int)"))

tabWidget.show()

sys.exit(app.exec_())

if __name__ == '__main__':

main()

图片如下:

pyqt tabWidget例子学习1的更多相关文章

  1. pyqt QTreeWidget例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import  * from Py ...

  2. pyqt columnView例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import  * from Py ...

  3. pyqt QTableView例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import  * from Py ...

  4. pyqt QTableWidget例子学习(重点)

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import * from PyQ ...

  5. pyqt 托盘例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.QtGui import * from PyQ ...

  6. pyqt 正则表达式例子学习

    def rex01(self): username=QtCore.QRegExp('[a-zA-Z0-9_]{2,10}') self.names.setValidator(QtGui.QRegExp ...

  7. pyqt 配置文件例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' import sys,datetime from PyQt4.QtC ...

  8. pyqt 自定义例子学习

    # -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' import sys from PyQt4.QtCore impor ...

  9. 数百个 HTML5 例子学习 HT 图形组件 – 3D建模篇

    http://www.hightopo.com/demo/pipeline/index.html <数百个 HTML5 例子学习 HT 图形组件 – WebGL 3D 篇>里提到 HT 很 ...

随机推荐

  1. (转)iOS Wow体验 - 第二章 - iOS用户体验解析(1)

    本文是<iOS Wow Factor:Apps and UX Design Techniques for iPhone and iPad>第二章译文精选的第一部分,其余章节将陆续放出.上一 ...

  2. 【css3+JavaScript】:一个优雅的对话框

    实现效果: 演示地址:http://codepen.io/anon/pen/BNjYrR ======2015/5/11====== 优化滚动条(scroll):默认的滚动条太丑,忍不住优化下 ::- ...

  3. opencv 实现进度控制

    进度控制: #include <opencv\cv.h> #include <opencv\highgui.h> #include <opencv\cxcore.h> ...

  4. Android--获取当前系统的语言环境

    private boolean isZh() {        Locale locale = getResources().getConfiguration().locale;         St ...

  5. MDM 证书申请流程(vendor及customer)

    整个流程分为两部分:vendor,customer. 一.Vendor 1.成为一个 MDM Vendor 1) 首先你须要拥有一个 Apple Enterprise account($299/年). ...

  6. eclipse 汉化

    对于: Eclipse Standard/SDK Version: Luna Release (4.4.0) 对应的网络地址:http://download.eclipse.org/technolog ...

  7. oracle 11g 64位安装32位客户端和PL/SQL

    转自:http://www.360doc.com/content/14/0602/10/4903283_382949382.shtml   这个你需要安装一个32位的oracle客户端才能使用plsq ...

  8. 关于垂直切分Vertical Sharding的粒度

    转载原文地址 http://blog.csdn.net/bluishglc/article/details/6274841 垂直切分的粒度指的是在做垂直切分时允许几级的关联表放在一个shard里.这个 ...

  9. weblogic开机启动-超简单

    1.编写weblogic启动脚本,命名为start_weblogic_server.sh,内容如下:  #!/bin/bashnohup /home/weblogic/Oracle/Middlewar ...

  10. 大家来找茬-SpringMVC中Tomcat正常启动,始终访问不了Controller,出404错

    创建了一个空的SpringMVC项目,Tomcat可以正常启动,但是运行的时候,始终进不了Controller,并且报404错误. 百度各种查,结果也是查不到原因.各个群里面各种求,各种贴源码,也没有 ...