本文整理汇总了Python中PyQt4.QtGui.QFontDialog.getFont方法的典型用法代码示例。如果您正苦于以下问题:Python QFontDialog.getFont方法的具体用法?Python QFontDialog.getFont怎么用?Python QFontDialog.getFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QFontDialog
的用法示例。
在下文中一共展示了QFontDialog.getFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FontClicked
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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()
示例2: _choose_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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()
示例3: change_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例4: _load_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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
示例5: change_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例6: change_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例7: change_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例8: change_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例9: change_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例10: _changeFont
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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: popup_editor
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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()
示例12: selectFont
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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: _load_editor_font
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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)
示例14: on_actionChangeAxesFont_triggered
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
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: change_formatting
# 需要导入模块: from PyQt4.QtGui import QFontDialog [as 别名]
# 或者: from PyQt4.QtGui.QFontDialog import getFont [as 别名]
def change_formatting(self, color=False, font=False):
if color:
_color = QColorDialog.getColor(self.color, self, "Select Color")
if _color.isValid():
self.color = _color
elif font:
self.font, _ = QFontDialog.getFont(self.font, self, "Select Font")
widgetformatter(self.widgets.sample_text, self.font, self.color,
klass="QPlainTextEdit")
#now, change the config objects..
fmt = self.config.globals["appearance"]
fmt.update({
"font_family":str(self.font.family()),
"font_size":int(self.font.pointSize()),
"font_color":str(self.color.name()),
"font_bold":bool(self.font.bold()),
"font_italic":bool(self.font.italic()),
"font_underline":bool(self.font.underline())
})