import PyQt4.QtCore,PyQt4.QtGui # 获取文件路径对话框 file_name = QFileDialog.getOpenFileName(self,"open file dialog","C:\Users\Administrator\Desktop","Txt file... ...
分类:
编程语言 时间:
2017-07-21 17:17:32
阅读次数:
719
import sys from PyQt4 import QtCore, QtGui class MainWindow(QtGui.QWidget): def __init__(self, parent = None): QtGui.QWidget.__init__(self) self.setWi ...
分类:
其他好文 时间:
2017-07-19 17:57:59
阅读次数:
148
使用的的类是QtGui.QCompleterfrom PyQt4 import QtGui,QtCore str = QtCore.QStringList(['a','air','airbus'])#预先设置字典 lineEdit = QtGui.QLineEdit() lineEdit.setCo ...
分类:
其他好文 时间:
2017-06-23 22:12:37
阅读次数:
173
今天开始一个新的系列,主要是翻译并摘录QtGui中基础空间的常用方法,并做一些简单的实验程序; 我觉得这是一个炒冷饭的行为,但有时候冷饭不能不炒,不热不好吃,而且也很容易发霉。 其实到现在这种状态,对控件所提供的方法是否熟练已经不是问题,因为我们可以经常去看Manual,更为重要的是程序的框架和数据 ...
分类:
其他好文 时间:
2017-06-17 21:43:52
阅读次数:
175
1.临时变量 实例化的窗口,show之后会自动被释放。 tipWidget = QtGui.QWidget() tipWidget.show() tipWidget会闪一下就被释放了。 应该用成员变量: self.tipWidget = QtGui.QWidget() self.tipWidget. ...
分类:
其他好文 时间:
2017-06-12 12:57:17
阅读次数:
151
from PyQt5.QtWidgets import *from PyQt5 import QtCore,QtWidgetsfrom PyQt5.QtGui import *import sysclass A(QWidget): def __init__(self): super(A,self). ...
分类:
其他好文 时间:
2017-05-30 16:11:12
阅读次数:
3749
Help on class QPen in module PyQt5.QtGui:class QPen(sip.simplewrapper) | QPen() | QPen(Qt.PenStyle) | QPen(Union[QBrush, QColor, Qt.GlobalColor, QGrad ...
分类:
其他好文 时间:
2017-04-28 16:12:30
阅读次数:
514
修改几个地方 增加 import sys 将 Ui_MainWidonw(object)中的object修改成修改成QtGui.QMainWindow 在Class类下添加一个 init方法: def __init__(self): super(Ui_MainWindow,self).__init_ ...
分类:
其他好文 时间:
2017-04-25 00:40:37
阅读次数:
145
# _*_ coding:utf-8 _*_ import sys from PyQt4 import QtGui,QtCore class Example(QtGui.QMainWindow): def __init__(self): super(Example,self).__init__() ... ...
分类:
其他好文 时间:
2017-03-28 17:12:51
阅读次数:
329
一、窗口组件 1、组件的介绍 (1)、图形用户界面由不同类型的窗口和窗口组件构成 (2)、<QtGui>头文件包含窗口组件,对应Qt中的GUI模块 (3)、Qt以组件对象的方式构建图形用户界面 (4)、组件的类型 A、容器类(父组件):用于包含其它的界面组件(Qt中没有父组件的顶级组件叫做窗口) B ...
分类:
其他好文 时间:
2017-02-10 17:23:00
阅读次数:
272