• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python guiconfig.get_font函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中spyderlib.guiconfig.get_font函数的典型用法代码示例。如果您正苦于以下问题:Python get_font函数的具体用法?Python get_font怎么用?Python get_font使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_font函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent, history_filename, profile=False):
        """
        parent : specifies the parent widget
        """
        ConsoleBaseWidget.__init__(self, parent)
        SaveHistoryMixin.__init__(self)
                
        # Prompt position: tuple (line, index)
        self.current_prompt_pos = None
        self.new_input_line = True
        
        # History
        self.histidx = None
        self.hist_wholeline = False
        assert is_text_string(history_filename)
        self.history_filename = history_filename
        self.history = self.load_history()
        
        # Session
        self.historylog_filename = CONF.get('main', 'historylog_filename',
                                            get_conf_path('history.log'))
        
        # Context menu
        self.menu = None
        self.setup_context_menu()

        # Simple profiling test
        self.profile = profile
        
        # Buffer to increase performance of write/flush operations
        self.__buffer = []
        self.__timestamp = 0.0
        self.__flushtimer = QTimer(self)
        self.__flushtimer.setSingleShot(True)
        self.connect(self.__flushtimer, SIGNAL('timeout()'), self.flush)

        # Give focus to widget
        self.setFocus()
                
        # Calltips
        calltip_size = CONF.get('shell_appearance', 'calltips/size')
        calltip_font = get_font('shell_appearance', 'calltips')
        self.setup_calltips(calltip_size, calltip_font)
        
        # Completion
        completion_size = CONF.get('shell_appearance', 'completion/size')
        completion_font = get_font('shell_appearance', 'completion')
        self.completion_widget.setup_appearance(completion_size,
                                                completion_font)
        # Cursor width
        self.setCursorWidth( CONF.get('shell_appearance', 'cursor/width') )
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:51,代码来源:shell.py


示例2: change_font

 def change_font(self):
     """Change console font"""
     font, valid = QFontDialog.getFont(get_font(self.CONF_SECTION), self,
                                   _("Select a new font"))
     if valid:
         self.set_plain_text_font(font)
         set_font(font, self.CONF_SECTION)
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:7,代码来源:inspector.py


示例3: __init__

    def __init__(self, parent, statusbar):
        QWidget.__init__(self, parent)

        self.label_font = font = get_font('editor')
        font.setPointSize(self.font().pointSize())
        font.setBold(True)
        
        layout = QHBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        statusbar.addPermanentWidget(self)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:12,代码来源:status.py


示例4: __init__

    def __init__(self, text, title='', font=None, parent=None,
                 readonly=False, size=(400, 300)):
        QDialog.__init__(self, parent)
        
        # Destroying the C++ object right after closing the dialog box,
        # otherwise it may be garbage-collected in another QThread
        # (e.g. the editor's analysis thread in Spyder), thus leading to
        # a segmentation fault on UNIX or an application crash on Windows
        self.setAttribute(Qt.WA_DeleteOnClose)
        
        self.text = None
        
        # Display text as unicode if it comes as bytes, so users see 
        # its right representation
        if is_binary_string(text):
            self.is_binary = True
            text = to_text_string(text, 'utf8')
        else:
            self.is_binary = False
        
        self.layout = QVBoxLayout()
        self.setLayout(self.layout)

        # Text edit
        self.edit = QTextEdit(parent)
        self.connect(self.edit, SIGNAL('textChanged()'), self.text_changed)
        self.edit.setReadOnly(readonly)
        self.edit.setPlainText(text)
        if font is None:
            font = get_font('texteditor')
        self.edit.setFont(font)
        self.layout.addWidget(self.edit)

        # Buttons configuration
        buttons = QDialogButtonBox.Ok
        if not readonly:
            buttons = buttons | QDialogButtonBox.Cancel
        bbox = QDialogButtonBox(buttons)
        self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
        self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
        self.layout.addWidget(bbox)
        
        # Make the dialog act as a window
        self.setWindowFlags(Qt.Window)
        
        self.setWindowIcon(get_icon('edit.png'))
        self.setWindowTitle(_("Text editor") + \
                            "%s" % (" - "+str(title) if str(title) else ""))
        self.resize(size[0], size[1])
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:49,代码来源:texteditor.py


示例5: createEditor

 def createEditor(self, parent, option, index):
     """Create editor widget"""
     model = index.model()
     value = model.get_value(index)
     if model._data.dtype.name == "bool":
         value = not value
         model.setData(index, to_qvariant(value))
         return
     elif value is not np.ma.masked:
         editor = QLineEdit(parent)
         editor.setFont(get_font('arrayeditor'))
         editor.setAlignment(Qt.AlignCenter)
         if is_number(self.dtype):
             editor.setValidator(QDoubleValidator(editor))
         editor.returnPressed.connect(self.commitAndCloseEditor)
         return editor
开发者ID:da-woods,项目名称:spyder,代码行数:16,代码来源:arrayeditor.py


示例6: data

 def data(self, index, role=Qt.DisplayRole):
     """Cell content"""
     if not index.isValid():
         return to_qvariant()
     value = self.get_value(index)
     if role == Qt.DisplayRole:
         if value is np.ma.masked:
             return ''
         else:
             return to_qvariant(self._format % value)
     elif role == Qt.TextAlignmentRole:
         return to_qvariant(int(Qt.AlignCenter|Qt.AlignVCenter))
     elif role == Qt.BackgroundColorRole and self.bgcolor_enabled\
          and value is not np.ma.masked:
         hue = self.hue0+\
               self.dhue*(self.vmax-self.color_func(value))\
               /(self.vmax-self.vmin)
         hue = float(np.abs(hue))
         color = QColor.fromHsvF(hue, self.sat, self.val, self.alp)
         return to_qvariant(color)
     elif role == Qt.FontRole:
         return to_qvariant(get_font('arrayeditor'))
     return to_qvariant()
开发者ID:da-woods,项目名称:spyder,代码行数:23,代码来源:arrayeditor.py


示例7: data

 def data(self, index, role=Qt.DisplayRole):
     """Cell content"""
     if not index.isValid():
         return to_qvariant()
     if role == Qt.DisplayRole or role == Qt.EditRole:
         column = index.column()
         row = index.row()
         if column == 0:
             return to_qvariant(to_text_string(self.df_index[row]))
         else:
             value = self.get_value(row, column-1)
             if isinstance(value, float):
                 return to_qvariant(self._format % value)
             else:
                 try:
                     return to_qvariant(to_text_string(value))
                 except UnicodeDecodeError:
                     return to_qvariant(encoding.to_unicode(value))
     elif role == Qt.BackgroundColorRole:
         return to_qvariant(self.get_bgcolor(index))
     elif role == Qt.FontRole:
         return to_qvariant(get_font('arrayeditor'))
     return to_qvariant()
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:23,代码来源:dataframeeditor.py


示例8: get_plugin_font

 def get_plugin_font(self, option=None):
     """Return plugin font option"""
     return get_font(self.CONF_SECTION, option)
开发者ID:ymarfoq,项目名称:outilACVDesagregation,代码行数:3,代码来源:__init__.py


示例9: set_infowidget_font

 def set_infowidget_font(self):
     font = get_font('inspector', 'rich_text')
     self.infowidget.set_font(font)
开发者ID:jromang,项目名称:spyderlib,代码行数:3,代码来源:ipython.py


示例10: set_infowidget_font

 def set_infowidget_font(self):
     """Set font for infowidget"""
     font = get_font('inspector', 'rich_text')
     self.infowidget.set_font(font)
开发者ID:beyondliyang,项目名称:spyder,代码行数:4,代码来源:ipython.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python plugins.SpyderPluginMixin类代码示例发布时间:2022-05-27
下一篇:
Python dependencies.add函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap