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


Python QtGui.QFontDialog类代码示例

本文整理汇总了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
开发者ID:calpe20,项目名称:PYTHONIZANDO,代码行数:8,代码来源:preferences_window.py

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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