本文整理汇总了Python中PyQt5.QtWidgets.QTextBrowser.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QTextBrowser.resize方法的具体用法?Python QTextBrowser.resize怎么用?Python QTextBrowser.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QTextBrowser
的用法示例。
在下文中一共展示了QTextBrowser.resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Example1
# 需要导入模块: from PyQt5.QtWidgets import QTextBrowser [as 别名]
# 或者: from PyQt5.QtWidgets.QTextBrowser import resize [as 别名]
class Example1(QWidget):
def __init__(self):
super().__init__()
self.initUI()
self.s=[]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 40))
self.setGeometry(300,250,360,400)
self.setWindowTitle('Instructions')
self.toshow = QTextBrowser(self)
self.toshow.resize(270,300)
self.toshow.move(30,20)
self.toshow.setText('good')
# self.toshow.setText('\n'.join(self.s))
self.show()
def showIns(self):
self.toshow.setText('\n'.join(self.s))
示例2: Example
# 需要导入模块: from PyQt5.QtWidgets import QTextBrowser [as 别名]
# 或者: from PyQt5.QtWidgets.QTextBrowser import resize [as 别名]
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
self.comlist=[]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 40))
# grid = QGridLayout()
# self.setLayout(grid)
# names = ['NOT', 'AND', '0', '1',
# 'OR', 'XOR', '2', '3',
# '>', '<', '/', '*',
# '!=', '==', '+', '-',
# '(', ')', '@', 'DEL']
#
# positions = [(i,j) for i in range(5) for j in range(4)]
self.buno= QPushButton('NOT',self)
self.buno.resize(60,35)
self.buno.move(0*70+30,0*52+85)
self.buno.setFont(QFont('Calibri', 14, QFont.Normal))
self.buno.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.buno.clicked.connect(self.commandBuno)
self.buand= QPushButton('AND',self)
self.buand.resize(60,35)
self.buand.move(1*70+30,0*52+85)
self.buand.setFont(QFont('Calibri', 14, QFont.Normal))
self.buand.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.buand.clicked.connect(self.commandBuand)
self.bu0= QPushButton('0',self)
self.bu0.resize(60,35)
self.bu0.move(2*70+30,0*52+85)
self.bu0.setFont(QFont('Calibri', 14, QFont.Normal))
self.bu0.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bu0.clicked.connect(self.commandBu0)
self.bu1= QPushButton('1',self)
self.bu1.resize(60,35)
self.bu1.move(3*70+30,0*52+85)
self.bu1.setFont(QFont('Calibri', 14, QFont.Normal))
self.bu1.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bu1.clicked.connect(self.commandBu1)
self.buor= QPushButton('OR',self)
self.buor.resize(60,35)
self.buor.move(0*70+30,1*52+85)
self.buor.setFont(QFont('Calibri', 14, QFont.Normal))
self.buor.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.buor.clicked.connect(self.commandBuor)
self.buxor= QPushButton('XOR',self)
self.buxor.resize(60,35)
self.buxor.move(1*70+30,1*52+85)
self.buxor.setFont(QFont('Calibri', 14, QFont.Normal))
self.buxor.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.buxor.clicked.connect(self.commandBuxor)
self.bu2= QPushButton('2',self)
self.bu2.resize(60,35)
self.bu2.move(2*70+30,1*52+85)
self.bu2.setFont(QFont('Calibri', 14, QFont.Normal))
self.bu2.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bu2.clicked.connect(self.commandBu2)
self.bu3= QPushButton('3',self)
self.bu3.resize(60,35)
self.bu3.move(3*70+30,1*52+85)
self.bu3.setFont(QFont('Calibri', 14, QFont.Normal))
self.bu3.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bu3.clicked.connect(self.commandBu3)
self.bul= QPushButton('>',self)
self.bul.resize(60,35)
self.bul.move(0*70+30,2*52+85)
self.bul.setFont(QFont('Calibri', 14, QFont.Normal))
self.bul.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bul.clicked.connect(self.commandBul)
self.bus= QPushButton('<',self)
self.bus.resize(60,35)
self.bus.move(1*70+30,2*52+85)
self.bus.setFont(QFont('Calibri', 14, QFont.Normal))
self.bus.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bus.clicked.connect(self.commandBus)
self.bud= QPushButton('/',self)
self.bud.resize(60,35)
self.bud.move(2*70+30,2*52+85)
self.bud.setFont(QFont('Calibri', 14, QFont.Normal))
self.bud.setStyleSheet("QPushButton{color:'#212121';background:'#e1e1e1'}")
self.bud.clicked.connect(self.commandBud)
#.........这里部分代码省略.........