Python qgis.gui.QgsCollapsibleGroupBox() Examples
The following are 5
code examples of qgis.gui.QgsCollapsibleGroupBox().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
qgis.gui
, or try the search function
.
Example #1
Source File: ORStoolsDialogConfig.py From orstools-qgis-plugin with MIT License | 6 votes |
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]
Example #2
Source File: ORStoolsDialogConfig.py From orstools-qgis-plugin with MIT License | 5 votes |
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()
Example #3
Source File: ORStoolsDialogConfig.py From orstools-qgis-plugin with MIT License | 5 votes |
def _collapse_boxes(self): """Collapse all QgsCollapsibleGroupBoxes.""" collapsible_boxes = self.providers.findChildren(QgsCollapsibleGroupBox) for box in collapsible_boxes: box.setCollapsed(True)
Example #4
Source File: createDatabaseCustomization.py From DsgTools with GNU General Public License v2.0 | 5 votes |
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
Example #5
Source File: ORStoolsDialogConfig.py From orstools-qgis-plugin with MIT License | 4 votes |
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)