当前位置: 首页>>代码示例>>Python>>正文


Python QFontDialog.getFont方法代码示例

本文整理汇总了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()
开发者ID:rmlockwood,项目名称:FLExTrans,代码行数:9,代码来源:ViewSrcTgt.py

示例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()
开发者ID:eblot,项目名称:ezsphinx,代码行数:9,代码来源:restedit.py

示例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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:9,代码来源:pylintgui.py

示例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
开发者ID:aztli,项目名称:Traducciones,代码行数:9,代码来源:preferences_window.py

示例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)
开发者ID:cheesinglee,项目名称:spyder,代码行数:9,代码来源:console.py

示例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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:9,代码来源:__init__.py

示例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)
开发者ID:koll00,项目名称:Gui_SM,代码行数:9,代码来源:projectexplorer.py

示例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)
开发者ID:cheesinglee,项目名称:spyder,代码行数:10,代码来源:history.py

示例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)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:10,代码来源:externalconsole.py

示例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)
开发者ID:PierreBdR,项目名称:point_tracker,代码行数:10,代码来源:tracking_plot.py

示例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()
开发者ID:davidmorrill,项目名称:facets,代码行数:11,代码来源:font_editor.py

示例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)
开发者ID:lifemapper,项目名称:LmQGIS,代码行数:11,代码来源:spreadsheet.py

示例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)
开发者ID:AnyBucket,项目名称:ninja-ide,代码行数:14,代码来源:preferences_editor_general.py

示例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)
开发者ID:InfiniteAlpha,项目名称:profitpy,代码行数:14,代码来源:plot.py

示例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())
     })
开发者ID:mnunberg,项目名称:yobot,代码行数:23,代码来源:config_dialog.py


注:本文中的PyQt4.QtGui.QFontDialog.getFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。