本文整理汇总了Python中PyQt4.QtGui.QFontDialog类的典型用法代码示例。如果您正苦于以下问题:Python QFontDialog类的具体用法?Python QFontDialog怎么用?Python QFontDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QFontDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_font
def load_font(self, initialFont):
print initialFont.key()
font, ok = QFontDialog(initialFont).getFont()
if ok:
newFont = font.toString().split(',')
return newFont[0]+', '+newFont[1]
else:
return initialFont
示例2: change_font
def change_font(self):
"""Change font"""
font, valid = QFontDialog.getFont(get_font(self.ID), self,
translate("Pylint", "Select a new font"))
if valid:
self.set_font(font)
set_font(font, self.ID)
示例3: FontClicked
def FontClicked(self):
(font, ret) = QFontDialog.getFont()
if ret:
self.font_family = str(font.family())
self.ui.FontNameLabel.setText(font.family())
#self.ui.webView.setFont(font)
self.load()
示例4: _choose_font
def _choose_font(self):
"""^: user requested the font dialog for the restedit window"""
font = self.font()
(font, ok) = QFontDialog.getFont(font)
if ok:
self.setFont(font)
self._save_preferences()
示例5: change_font
def change_font(self):
"""Change font"""
font, valid = QFontDialog.getFont(self.get_plugin_font(), self,
_("Select a new font"))
if valid:
self.set_font(font)
self.set_plugin_font(font)
示例6: _load_font
def _load_font(self, initialFont, parent=0):
font, ok = QFontDialog.getFont(initialFont, parent)
if ok:
newFont = font.toString().split(',')
return newFont[0] + ', ' + newFont[1]
else:
return initialFont
示例7: change_font
def change_font(self):
"""Change console font"""
font, valid = QFontDialog.getFont(get_font(self.ID),
self, self.tr("Select a new font"))
if valid:
self.shell.set_font(font)
set_font(font, self.ID)
示例8: change_font
def change_font(self):
"""Change console font"""
font, valid = QFontDialog.getFont(get_font(self.ID), self,
translate("Editor", "Select a new font"))
if valid:
self.editor.set_font(font)
set_font(font, self.ID)
示例9: change_font
def change_font(self):
"""Change console font"""
font, valid = QFontDialog.getFont(get_font(self.ID),
self, self.tr("Select a new font"))
if valid:
for editor in self.editors:
editor.set_font(font)
set_font(font, self.ID)
示例10: _changeFont
def _changeFont(self):
fnt, ok = QFontDialog.getFont(self.scale_font, self._scale_config_param, "Font for the color scale bar")
if ok:
self.scale_font = fnt
normal_size = self._scale_config_param.selectFont.font().pointSizeF()
scaled_font = QFont(fnt)
scaled_font.setPointSizeF(normal_size)
self._scale_config_param.selectFont.setFont(scaled_font)
示例11: change_font
def change_font(self):
"""Change console font"""
font, valid = QFontDialog.getFont(get_font(self.ID),
self, self.tr("Select a new font"))
if valid:
for index in range(self.tabwidget.count()):
self.tabwidget.widget(index).shell.set_font(font)
set_font(font, self.ID)
示例12: selectFont
def selectFont(self):
selected = self.table.selectedItems()
if not selected:
return
font, ok = QFontDialog.getFont(self.font(), self)
if not ok:
return
for i in selected:
i and i.setFont(font)
示例13: popup_editor
def popup_editor ( self ):
""" Invokes the pop-up editor for an object facet.
"""
fnt, ok = QFontDialog.getFont( self.factory.to_pyqt_font( self ),
self.control )
if ok:
self.value = self.factory.from_pyqt_font( fnt )
self.update_editor()
示例14: on_actionChangeAxesFont_triggered
def on_actionChangeAxesFont_triggered(self):
""" Signal handler called to edit the axes font.
@return None
"""
widget = self.referenceAxisWidget()
default = widget.font()
font, okay = QFontDialog.getFont(default, self, 'Select Axis Font')
if okay:
self.setAxisFont(font)
self.settings.setValue(
'%s/axisfont' % self.plotName(), font)
示例15: _load_editor_font
def _load_editor_font(self):
try:
font, ok = QFontDialog.getFont(self._font, self)
if ok:
self._font = font
btnText = ', '.join(self._font.toString().split(',')[0:2])
self._btnEditorFont.setText(btnText)
except:
QMessageBox.warning(
self,
translations.TR_PREFERENCES_EDITOR_GENERAL_FONT_MESSAGE_TITLE,
translations.TR_PREFERENCES_EDITOR_GENERAL_FONT_MESSAGE_BODY)