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


Python gui.QgsCollapsibleGroupBox方法代碼示例

本文整理匯總了Python中qgis.gui.QgsCollapsibleGroupBox方法的典型用法代碼示例。如果您正苦於以下問題:Python gui.QgsCollapsibleGroupBox方法的具體用法?Python gui.QgsCollapsibleGroupBox怎麽用?Python gui.QgsCollapsibleGroupBox使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qgis.gui的用法示例。


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

示例1: _remove_provider

# 需要導入模塊: from qgis import gui [as 別名]
# 或者: from qgis.gui import QgsCollapsibleGroupBox [as 別名]
def _remove_provider(self):
        """Remove list of providers from list."""

        providers = [provider['name'] for provider in self.temp_config['providers']]

        provider, ok = QInputDialog.getItem(self,
                                            "Remove ORS provider",
                                            "Choose provider to remove",
                                            providers, 0, False)
        if ok:
            box_remove = self.providers.findChild(QgsCollapsibleGroupBox, provider)
            self.gridLayout.removeWidget(box_remove)
            box_remove.deleteLater()
            box_remove = None

            # delete from in-memory self.temp_config
            provider_id = providers.index(provider)
            del self.temp_config['providers'][provider_id] 
開發者ID:GIScience,項目名稱:orstools-qgis-plugin,代碼行數:20,代碼來源:ORStoolsDialogConfig.py

示例2: accept

# 需要導入模塊: from qgis import gui [as 別名]
# 或者: from qgis.gui import QgsCollapsibleGroupBox [as 別名]
def accept(self):
        """When the OK Button is clicked, in-memory temp_config is updated and written to config.yml"""

        collapsible_boxes = self.providers.findChildren(QgsCollapsibleGroupBox)
        for idx, box in enumerate(collapsible_boxes):
            current_provider = self.temp_config['providers'][idx]
            current_provider['key'] = box.findChild(QtWidgets.QLineEdit, box.title() + "_key_text").text()
            current_provider['base_url'] = box.findChild(QtWidgets.QLineEdit, box.title() + "_base_url_text").text()

        configmanager.write_config(self.temp_config)
        self.close() 
開發者ID:GIScience,項目名稱:orstools-qgis-plugin,代碼行數:13,代碼來源:ORStoolsDialogConfig.py

示例3: _collapse_boxes

# 需要導入模塊: from qgis import gui [as 別名]
# 或者: from qgis.gui import QgsCollapsibleGroupBox [as 別名]
def _collapse_boxes(self):
        """Collapse all QgsCollapsibleGroupBoxes."""
        collapsible_boxes = self.providers.findChildren(QgsCollapsibleGroupBox)
        for box in collapsible_boxes:
            box.setCollapsed(True) 
開發者ID:GIScience,項目名稱:orstools-qgis-plugin,代碼行數:7,代碼來源:ORStoolsDialogConfig.py

示例4: addWidget

# 需要導入模塊: from qgis import gui [as 別名]
# 或者: from qgis.gui import QgsCollapsibleGroupBox [as 別名]
def addWidget(self, widget, title):
        layout = QtGui.QFormLayout()
        layout.addRow(widget)
        groupBox = QgsCollapsibleGroupBox(title)
        groupBox.setCollapsed(False)
        groupBox.setSaveCollapsedState(False)
        groupBox.setLayout(layout)
        self.scrollAreaLayout.addWidget(groupBox)
        return groupBox 
開發者ID:dsgoficial,項目名稱:DsgTools,代碼行數:11,代碼來源:createDatabaseCustomization.py

示例5: _add_box

# 需要導入模塊: from qgis import gui [as 別名]
# 或者: from qgis.gui import QgsCollapsibleGroupBox [as 別名]
def _add_box(self,
                 name,
                 url,
                 key,
                 new=False):
        """
        Adds a provider box to the QWidget layout and self.temp_config.

        :param name: provider name
        :type name: str

        :param url: provider's base url
        :type url: str

        :param key: user's API key
        :type key: str

        :param new: Specifies whether user wants to insert provider or the GUI is being built.
        :type new: boolean
        """
        if new:
            self.temp_config['providers'].append(
                dict(
                    name=name,
                    base_url=url,
                    key=key,
                )
            )

        provider = QgsCollapsibleGroupBox(self.providers)
        provider.setObjectName(name)
        provider.setTitle(name)
        gridLayout_3 = QtWidgets.QGridLayout(provider)
        gridLayout_3.setObjectName(name + '_grid')
        key_label = QtWidgets.QLabel(provider)
        key_label.setObjectName(name + '_key_label')
        key_label.setText('API Key')
        gridLayout_3.addWidget(key_label, 0, 0, 1, 1)
        base_url_text = QtWidgets.QLineEdit(provider)
        base_url_text.setObjectName(name + "_base_url_text")
        base_url_text.setText(url)
        gridLayout_3.addWidget(base_url_text, 3, 0, 1, 4)
        key_text = QtWidgets.QLineEdit(provider)
        key_text.setObjectName(name + "_key_text")
        key_text.setText(key)
        gridLayout_3.addWidget(key_text, 1, 0, 1, 4)
        base_url_label = QtWidgets.QLabel(provider)
        base_url_label.setObjectName("base_url_label")
        base_url_label.setText("Base URL")
        gridLayout_3.addWidget(base_url_label, 2, 0, 1, 1)
        self.verticalLayout.addWidget(provider)
        provider.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) 
開發者ID:GIScience,項目名稱:orstools-qgis-plugin,代碼行數:54,代碼來源:ORStoolsDialogConfig.py


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