當前位置: 首頁>>代碼示例>>Python>>正文


Python exploreritems.TreeItem類代碼示例

本文整理匯總了Python中opengeo.gui.exploreritems.TreeItem的典型用法代碼示例。如果您正苦於以下問題:Python TreeItem類的具體用法?Python TreeItem怎麽用?Python TreeItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了TreeItem類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 def __init__(self, repo):            
     self.diffs = repo.notindatabase();
     self.isDirty = len(self.diffs) > 0 
     text = "Working Tree [NOT CLEAN]" if self.isDirty else "Working Tree"  
     icon = worktreeUncleanIcon if self.isDirty else worktreeCleanIcon                     
     TreeItem.__init__(self, repo, icon, text)
     self.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable)
開發者ID:garnertb,項目名稱:suite-qgis-plugin,代碼行數:7,代碼來源:geogitexploreritems.py

示例2: __init__

 def __init__(self, layer ):
     icon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/layer.png")
     TreeItem.__init__(self, layer, icon)
     self.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDragEnabled)
     if layer is not None and hasattr(layer, 'name') \
             and hasattr(layer, 'publicSource'):
         self.setToolTip(0, "{0}:\n{1}".format(layer.name(),
             layer.publicSource()))
開發者ID:GeoCat,項目名稱:qgis-suite-plugin,代碼行數:8,代碼來源:qgsexploreritems.py

示例3: linkClicked

 def linkClicked(self, tree, explorer, url):
     TreeItem.linkClicked(self,tree, explorer, url)
     if url.toString() == 'kill':
         try:
             self.element.killSeedingTasks()
         except FailedRequestError:
             #TODO:
             return
     try:
         text = self.getDescriptionHtml(tree, explorer)
         self.description.setHtml(text)
     except:
         explorer.setDescriptionWidget()
開發者ID:GeoCat,項目名稱:qgis-suite-plugin,代碼行數:13,代碼來源:gwcexploreritems.py

示例4: _getDescriptionHtml

 def _getDescriptionHtml(self, tree, explorer):  
     if not self.element.isValid:            
         html = ('<p>Cannot connect to this database. This might be caused by missing user/passwd credentials.'
                 'Try <a href="refresh">refreshing</a> the connection, to enter new credentials and retry to connect</p>')     
         return html
     else:
         return TreeItem._getDescriptionHtml(self, tree, explorer)
開發者ID:ischneider,項目名稱:suite-qgis-plugin,代碼行數:7,代碼來源:pgexploreritems.py

示例5: _getDescriptionHtml

 def _getDescriptionHtml(self, tree, explorer):  
     if not self.element.isValid:
         html = u'<div style="background-color:#ffffcc;"><h1>&nbsp; ' + self.text(0) + ' (GWC layer)</h1></div></br>'  
         html += ('<p>Cannot connect to this database. This might be caused by missing user/passwd credentials.'
                 'Try <a href="refresh">refreshing</a> the connection, to enter new credentials and retry to connect</p>')     
         return html
     else:
         return TreeItem._getDescriptionHtml(self, tree, explorer)
開發者ID:garnertb,項目名稱:suite-qgis-plugin,代碼行數:8,代碼來源:pgexploreritems.py

示例6: _getDescriptionHtml

    def _getDescriptionHtml(self, tree, explorer):
        if not self.element.isValid:
            html = ""
            typesok, typesmsg = self._checkAllSelectionTypes(self, tree)
            if not typesok:
                return typesmsg
            else:
                html += typesmsg

            items = tree.selectedItems()
            # don't show if multiple items selected, but not the current item
            if not items or self in items or len(items) == 1:
                html += ('<p>Cannot connect to this database. This might be caused by missing user/passwd credentials.'
                        'Try <a href="refresh">refreshing</a> the connection, to enter new credentials and retry to connect</p>')
            return html
        else:
            return TreeItem._getDescriptionHtml(self, tree, explorer)
開發者ID:GeoCat,項目名稱:qgis-suite-plugin,代碼行數:17,代碼來源:pgexploreritems.py

示例7: __init__

 def __init__(self, group): 
     icon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/group.gif")
     TreeItem.__init__(self, group , icon)   
     self.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDragEnabled)
開發者ID:garnertb,項目名稱:suite-qgis-plugin,代碼行數:4,代碼來源:qgsexploreritems.py

示例8: populate

 def populate(self):                    
     icon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/layer.png")
     layersItem = TreeItem(None, icon, "QGIS Layers")        
     layersItem.setIcon(0, icon)
     layers = qgislayers.getAllLayers()
     for layer in layers:
         layerItem = QgsLayerItem(layer)            
         layersItem.addChild(layerItem)
     self.addChild(layersItem)
     icon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/group.gif")
     groupsItem = TreeItem(None, icon, "QGIS Groups")        
     groups = qgislayers.getGroups()
     for group in groups:
         groupItem = QgsGroupItem(group)                                
         groupsItem.addChild(groupItem)
         groupItem.populate()
     self.addChild(groupsItem)
     icon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/style.png")
     stylesItem = TreeItem(None, icon, "QGIS Styles")               
     stylesItem.setIcon(0, icon)
     styles = qgislayers.getVectorLayers()
     for style in styles:
         styleItem = QgsStyleItem(style)            
         stylesItem.addChild(styleItem)
     self.addChild(stylesItem)        
開發者ID:garnertb,項目名稱:suite-qgis-plugin,代碼行數:25,代碼來源:qgsexploreritems.py

示例9: __init__

 def __init__(self, conn):                      
     TreeItem.__init__(self, conn, pgIcon)
     self.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDropEnabled)          
開發者ID:ischneider,項目名稱:suite-qgis-plugin,代碼行數:3,代碼來源:pgexploreritems.py

示例10: __init__

 def __init__(self, catalog):
     self.catalog = catalog
     icon = QtGui.QIcon(os.path.dirname(__file__) + "/../images/gwc.png")
     TreeItem.__init__(self, None, icon, "GeoWebCache Layers")
     self.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDropEnabled)
開發者ID:GeoCat,項目名稱:qgis-suite-plugin,代碼行數:5,代碼來源:gwcexploreritems.py

示例11: linkClicked

 def linkClicked(self, tree, explorer, url):
     if not self.element.isValid:
         self.refreshContent(explorer)
     else:
         TreeItem.linkClicked(self, tree, explorer, url)        
開發者ID:ischneider,項目名稱:suite-qgis-plugin,代碼行數:5,代碼來源:pgexploreritems.py


注:本文中的opengeo.gui.exploreritems.TreeItem類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。