本文整理汇总了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]
示例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()
示例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)
示例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
示例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)