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


Python QTabWidget.show方法代码示例

本文整理汇总了Python中PySide.QtGui.QTabWidget.show方法的典型用法代码示例。如果您正苦于以下问题:Python QTabWidget.show方法的具体用法?Python QTabWidget.show怎么用?Python QTabWidget.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtGui.QTabWidget的用法示例。


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

示例1: Jaime

# 需要导入模块: from PySide.QtGui import QTabWidget [as 别名]
# 或者: from PySide.QtGui.QTabWidget import show [as 别名]
class Jaime(QObject,Singleton):
    
    instance = None
    logger = None
    
    def __init__(self):
        if Jaime.instance:
            raise Exception("Can't call to constructor with another instance created")
        
        self.tabs_widget = QTabWidget()
        self.view = QWebView()
        self.page = QWebPage()
        self.config = SafeConfigParser()        
        Logger.getLoggerFor(self.__class__)
        
        self.tabs_widget.insertTab(0,self.view,'label')
        self.tabs = {}        
        
        self.graph_file = None
        
        self.close_tab_timer = QTimer()
        self.close_tab_timer.setSingleShot(False)
        #cada 30 segundos se cierra un tab
        self.close_tab_timer.setInterval(10000)
        self.view.setPage(self.page)
        self.tabs['mainTab'] = self.view
        
        self.network_manager = CustomNetworkAccessManager.getInstance()        
        self.navigator = Navigator.getInstance()
        self.route_node = YahooRouteNode.getInstance()
        self.graph_parser = GraphParser.getInstance()        
        self.page.setNetworkAccessManager(self.network_manager)
        
    def loadConfig(self,config_file):
        self.config.read(config_file)
    
    def loadParam(self,name,value):
        name = name.strip()
#         print 'get param [%s]' % name
        if not self.config.has_section('PARAMS'):
#             print 'cree la seccion'
            self.config.add_section('PARAMS')
            
        self.config.set('PARAMS',name.strip(),value)        
#         print 'seteo %s a %s ' %  (name,value)
    
    def getParam(self,name,default=None):
        
        name = name.strip()
#         print 'get param [%s]' % name
        if self.config.has_section('PARAMS') and \
                self.config.has_option('PARAMS',name):
#             print 'get param 1 %s' % name
            return self.config.get('PARAMS',name)
        if default != None:
            return default
        return None
    
    def toggleDelegationPolicy(self, delegate=None):
        if self.page.linkDelegationPolicy() == QWebPage.DontDelegateLinks or \
                ( isinstance(delegate,bool) and delegate ):
            self.logger.info('cambio a delegate links')            
            self.page.setLinkDelegationPolicy(QWebPage.DelegateAllLinks) 
        
        elif self.page.linkDelegationPolicy() == QWebPage.DelegateAllLinks or \
                ( isinstance(delegate,bool) and not delegate ):
            self.logger.info('cambio a dont delegate links')
            self.page.setLinkDelegationPolicy(QWebPage.DontDelegateLinks)
        
        else:
            self.logger.warn("Can't set delegation policy")

    def setGraph(self,filename):
        
        self.graph_file = filename
    
    def start(self):
        self.logger.info('---------------------------- Jaime start work ---------------------------------')                    
        self.logger.info('Graph file = %s' % self.graph_file)                    
        if self.config.has_section('PARAMS') :
            self.logger.info('[PARAMS]')                    
            for name,value in self.config.items('PARAMS'):
                self.logger.info('        %s = %s' % (name,value))
        
        self.page.setNetworkAccessManager(self.network_manager)
        self.page.loadFinished.connect(self.navigator.processPageLoadFinished)
        self.page.loadStarted.connect(self.navigator.processLoadStarted)
        self.page.linkClicked.connect(self.openLinkOnTab)
        
        self.close_tab_timer.timeout.connect(self.closeOpenTab)
        
        self.graph_parser.loadGraph(self.graph_file)
        
        if not self.navigator.takeEntryPoint():
            self.finishWork()           
            
        self.tabs_widget.show()
#         self.tabs_widget.showMaximized()
        
    def finishWork(self):
#.........这里部分代码省略.........
开发者ID:juanchitot,项目名称:jaimeboot,代码行数:103,代码来源:jaime.py


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