本文整理汇总了Python中PyQt4.Qt.QTextEdit.setFont方法的典型用法代码示例。如果您正苦于以下问题:Python QTextEdit.setFont方法的具体用法?Python QTextEdit.setFont怎么用?Python QTextEdit.setFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QTextEdit
的用法示例。
在下文中一共展示了QTextEdit.setFont方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createLogDisplay
# 需要导入模块: from PyQt4.Qt import QTextEdit [as 别名]
# 或者: from PyQt4.Qt.QTextEdit import setFont [as 别名]
def createLogDisplay(self):
logTextDisplay = QTextEdit()
logTextDisplay.setFont(GETFONT('Fixed', 8))
w,h = relaxedSizeNChar(logTextDisplay, 68)[0], int(12 * 8.2)
logTextDisplay.setMinimumWidth(w)
logTextDisplay.setMinimumHeight(h)
logTextDisplay.setReadOnly(True)
return logTextDisplay
示例2: PluginObject
# 需要导入模块: from PyQt4.Qt import QTextEdit [as 别名]
# 或者: from PyQt4.Qt.QTextEdit import setFont [as 别名]
#.........这里部分代码省略.........
self.segDefTableView.verticalHeader().setDefaultSectionSize(20)
self.segDefTableView.verticalHeader().hide()
h = tightSizeNChar(self.segDefTableView, 1)[1]
self.segDefTableView.setMinimumHeight(2 * (1.3 * h))
self.segDefTableView.setMaximumHeight(10 * (1.3 * h))
initialColResize(self.segDefTableView, [.1, .2, .4, .1, .1, .1])
self.segDefTableView.customContextMenuRequested.connect(self.showSegContextMenu)
self.segDefTableView.setContextMenuPolicy(Qt.CustomContextMenu)
segmentOrderingsHeader = QRichLabel(tr("""<b>Specify orderings for pass phrase search: </b>"""), doWrap=False)
self.addOrderingButton = QPushButton("Add Ordering")
self.main.connect(self.addOrderingButton, SIGNAL('clicked()'), addOrdering)
orderingButtonPanel = makeHorizFrame([segmentOrderingsHeader, self.addOrderingButton, 'stretch'])
self.segOrdListBox = QListWidget()
self.segOrdListBox.customContextMenuRequested.connect(self.showOrdContextMenu)
self.segOrdListBox.setContextMenuPolicy(Qt.CustomContextMenu)
self.searchButton = QPushButton("Search")
self.main.connect(self.searchButton, SIGNAL('clicked()'), searchForPassphrase)
self.stopButton = QPushButton("Stop Searching")
self.stopButton.setEnabled(False)
self.main.connect(self.stopButton, SIGNAL('clicked()'), endSearch)
totalSearchLabel = QRichLabel(tr("""<b>Total Passphrase Tries To Search: </b>"""), doWrap=False)
self.totalSearchTriesDisplay = QLineEdit()
self.totalSearchTriesDisplay.setReadOnly(True)
self.totalSearchTriesDisplay.setText(QString('0'))
self.totalSearchTriesDisplay.setFont(GETFONT('Fixed'))
self.totalSearchTriesDisplay.setMinimumWidth(tightSizeNChar(self.totalSearchTriesDisplay, 6)[0])
self.totalSearchTriesDisplay.setMaximumWidth(tightSizeNChar(self.totalSearchTriesDisplay, 12)[0])
searchButtonPanel = makeHorizFrame([self.searchButton, self.stopButton, 'stretch', totalSearchLabel, self.totalSearchTriesDisplay])
self.resultsDisplay = QTextEdit()
self.resultsDisplay.setReadOnly(True)
self.resultsDisplay.setFont(GETFONT('Fixed'))
self.resultsDisplay.setMinimumHeight(100)
self.searchPanel = makeVertFrame([topRow, self.segDefTableView, orderingButtonPanel,
self.segOrdListBox, searchButtonPanel, self.resultsDisplay, 'stretch'])
# Now set the scrollarea widget to the layout
self.tabToDisplay = QScrollArea()
self.tabToDisplay.setWidgetResizable(True)
self.tabToDisplay.setWidget(self.searchPanel)
def getSelectedWlt(self):
wlt = None
selectedWltList = self.main.walletsView.selectedIndexes()
if len(selectedWltList)>0:
row = selectedWltList[0].row()
wltID = str(self.main.walletsView.model().index(row, WLTVIEWCOLS.ID).data().toString())
wlt = self.main.walletMap[wltID]
return wlt
def showSegContextMenu(self):
menu = QMenu(self.segDefTableView)
if len(self.segDefTableView.selectedIndexes())==0:
return
row = self.segDefTableView.selectedIndexes()[0].row()
deleteSegMenuItem = menu.addAction("Delete Segment")
action = menu.exec_(QCursor.pos())