當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。