本文整理汇总了Python中qgis.PyQt.QtWidgets.QDialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QDialog.__init__方法的具体用法?Python QDialog.__init__怎么用?Python QDialog.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.PyQt.QtWidgets.QDialog
的用法示例。
在下文中一共展示了QDialog.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, iface):
QDialog.__init__(self, iface.mainWindow())
self.iface = iface
# Set up the user interface from Designer.
self.setupUi(self)
self.populateLayers()
spaced_distance_list = ['1','2','3','4','5']
self.spaced_pts_comboBox.clear()
for distance in spaced_distance_list:
self.spaced_pts_comboBox.addItem(distance)
self.spaced_pts_comboBox.setEnabled(False)
self.middle_pts_radioButton.setChecked(1)
self.spaced_pts_radioButton.setChecked(0)
self.middle_pts_radioButton.toggled.connect(self.method_update)
self.spaced_pts_radioButton.toggled.connect(self.method_update)
self.receiver_layer_pushButton.clicked.connect(self.outFile)
self.buttonBox = self.buttonBox.button( QDialogButtonBox.Ok )
self.progressBar.setValue(0)
示例2: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, repo, layer=None):
self.repo = repo
self.layer = layer
self.ref = None
QDialog.__init__(self, config.iface.mainWindow(),
Qt.WindowSystemMenuHint | Qt.WindowTitleHint)
execute(self.initGui)
示例3: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.setupUi(self)
self.titleBoldBtn.hide()
self.titleItalicBtn.hide()
self.labelsBoldBtn.hide()
self.labelsItalicBtn.hide()
# remove fonts matplotlib doesn't load
for index in range(self.titleFontCombo.count()-1, -1, -1):
found = False
family = unicode( self.titleFontCombo.itemText( index ) )
try:
props = self.findFont( {'family':family} )
if family == props['family']:
found = True
except Exception:
pass
if not found:
self.titleFontCombo.removeItem( index )
self.labelsFontCombo.removeItem( index )
self.initProps()
self.titleColorBtn.clicked.connect(self.chooseTitleColor)
self.labelsColorBtn.clicked.connect(self.chooseLabelsColor)
self.pointsColorBtn.clicked.connect(self.choosePointsColor)
self.pointsReplicasColorBtn.clicked.connect(self.choosePointsReplicasColor)
self.linesColorBtn.clicked.connect(self.chooseLinesColor)
self.linesThrendColorBtn.clicked.connect(self.chooseLinesThrendColor)
示例4: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self):
QDialog.__init__(self)
self.setWindowTitle(tr('XY Point drawing tool'))
self.X = QLineEdit()
self.Y = QLineEdit()
X_val = QDoubleValidator()
Y_val = QDoubleValidator()
self.X.setValidator(X_val)
self.Y.setValidator(Y_val)
self.crsButton = QPushButton("Projection")
self.crsButton.clicked.connect(self.changeCRS)
self.crsLabel = QLabel("")
buttons = QDialogButtonBox(
QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
buttons.accepted.connect(self.accept)
buttons.rejected.connect(self.reject)
grid = QGridLayout()
grid.addWidget(QLabel("X"), 0, 0)
grid.addWidget(QLabel("Y"), 0, 1)
grid.addWidget(self.X, 1, 0)
grid.addWidget(self.Y, 1, 1)
grid.addWidget(self.crsButton, 2, 0)
grid.addWidget(self.crsLabel, 2, 1)
grid.addWidget(buttons, 3, 0, 1, 2)
self.setLayout(grid)
示例5: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, iface):
"""
Constructor
"""
QDialog.__init__(self)
self.setupUi(self)
self.iface = iface
self.mc = self.iface.mapCanvas()
#self.legend = self.iface.legendInterface()
self.loaded_layers = [layer for layer in QgsProject.instance().mapLayers().values()]
# UI CCONNECTORS
self.buttonBox_ok_cancel.accepted.connect(self.run)
self.buttonBox_ok_cancel.rejected.connect(self.close)
self.comboBox_line_layer.currentIndexChanged.connect(self.update_fields)
# Get line layers and raster layers from legend
vector_line_layers, raster_layers = self.get_useful_layers()
# Populate comboboxes
self.comboBox_line_layer.clear()
self.comboBox_line_layer.addItems(vector_line_layers)
self.comboBox_elevation_layer.clear()
self.comboBox_elevation_layer.addItems(raster_layers)
示例6: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, alg, paramType=None, param=None):
self.alg = alg
self.paramType = paramType
self.param = param
QDialog.__init__(self)
self.setModal(True)
self.setupUi()
示例7: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self):
"""Constructor for the dialog.
"""
QDialog.__init__(self)
self.setupUi(self)
self.comboBox.addItem('ESRI shape file')
self.comboBox.addItem('Comma separated value (CSV)')
self.comboBox.addItem('SQLite database')
self.comboBox.addItem('Copy complete database')
# self.comboBox.addItem('INSPIRE')
self.comboBox.currentIndexChanged.connect(self.seler)
self.comboBox_2.addItem(';')
self.comboBox_2.addItem(',')
self.comboBox_2.addItem('tab')
self.tabWidget.setTabEnabled(0, False)
self.tabWidget.setTabEnabled(1, False)
self.seler()
self.toolButton.clicked.connect(self.filer)
示例8: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, model):
QDialog.__init__(self)
# Set up the user interface from Designer.
self.ui = uic.loadUi(ui_file, self)
self.resultModel = model
self.constraintTableView.setModel(self.resultModel)
self.constraintTableView.resizeColumnsToContents()
示例9: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, parent):
QDialog.__init__(self, parent)
self.setWindowTitle(QCoreApplication.translate("SettingsDialogPythonConsole", "Settings Python Console"))
self.parent = parent
self.setupUi(self)
self.listPath = []
self.lineEdit.setReadOnly(True)
self.restoreSettings()
self.initialCheck()
self.addAPIpath.setIcon(QIcon(":/images/themes/default/symbologyAdd.svg"))
self.addAPIpath.setToolTip(QCoreApplication.translate("PythonConsole", "Add API path"))
self.removeAPIpath.setIcon(QIcon(":/images/themes/default/symbologyRemove.svg"))
self.removeAPIpath.setToolTip(QCoreApplication.translate("PythonConsole", "Remove API path"))
self.preloadAPI.stateChanged.connect(self.initialCheck)
self.addAPIpath.clicked.connect(self.loadAPIFile)
self.removeAPIpath.clicked.connect(self.removeAPI)
self.compileAPIs.clicked.connect(self._prepareAPI)
self.resetFontColor.setIcon(QIcon(":/images/themes/default/console/iconResetColorConsole.png"))
self.resetFontColor.setIconSize(QSize(18, 18))
self.resetFontColorEditor.setIcon(QIcon(":/images/themes/default/console/iconResetColorConsole.png"))
self.resetFontColorEditor.setIconSize(QSize(18, 18))
self.resetFontColor.clicked.connect(self._resetFontColor)
self.resetFontColorEditor.clicked.connect(self._resetFontColorEditor)
示例10: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, iface):
self.iface = iface
QDialog.__init__(self)
# Set up the user interface from Designer.
self.ui = uic.loadUi(ui_file, self)
self.configFilePath = os.path.join(os.path.dirname(__file__), 'config.cfg')
self.defFlags = Qt.NoItemFlags | Qt.ItemIsEnabled | Qt.ItemIsEditable | Qt.ItemIsSelectable
# Populate the PostGIS connection combo with the available connections
# Determine our current preference
s = QSettings()
selectedConnection = str(s.value("constraintchecker/postgisConnection", ''))
s.beginGroup('PostgreSQL/connections')
i = 0
for connectionName in s.childGroups():
self.postgisConnectionComboBox.addItem(connectionName)
if connectionName == selectedConnection:
# Select this preference in the combo if exists
self.postgisConnectionComboBox.setCurrentIndex(i)
i += 1
s.endGroup()
# Now read the configuration file (if it exists) into the table widget
try:
self.readConfiguration()
except:
pass
示例11: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, table, parent=None):
QDialog.__init__(self, parent)
self.table = table
self.setupUi(self)
self.db = self.table.database()
m = TableFieldsModel(self)
self.viewFields.setModel(m)
m = TableConstraintsModel(self)
self.viewConstraints.setModel(m)
m = TableIndexesModel(self)
self.viewIndexes.setModel(m)
self.btnAddColumn.clicked.connect(self.addColumn)
self.btnAddGeometryColumn.clicked.connect(self.addGeometryColumn)
self.btnEditColumn.clicked.connect(self.editColumn)
self.btnDeleteColumn.clicked.connect(self.deleteColumn)
self.btnAddConstraint.clicked.connect(self.addConstraint)
self.btnDeleteConstraint.clicked.connect(self.deleteConstraint)
self.btnAddIndex.clicked.connect(self.createIndex)
self.btnAddSpatialIndex.clicked.connect(self.createSpatialIndex)
self.btnDeleteIndex.clicked.connect(self.deleteIndex)
self.populateViews()
self.checkSupports()
示例12: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, iface):
self.supportedPaperSizes = ['A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8'] # ISO A series
self.paperSizesPresent = []
self.presetScales = ['200', '500', '1 000', '1 250', '2 500', '5 000', '10 000', '25 000', '50 000', '100 000']
self.iface = iface
QDialog.__init__(self)
# Set up the user interface from Designer.
self.ui = uic.loadUi(ui_file, self)
# Set up the list of templates
s = QtCore.QSettings()
self.identifiable_only = s.value("SelectorTools/ProjectSelector/identifiableOnly", True, type=bool)
self.templateFileRoot = s.value("SelectorTools/TemplateSelector/templateRoot", '', type=str)
if len(self.templateFileRoot) == 0 or not os.path.isdir(self.templateFileRoot):
raise TemplateSelectorException('\'%s\' is not a valid template file root folder.' % self.templateFileRoot)
self.populateTemplateTypes()
self.populatePoiLayers()
self.onPoiLayerChanged()
self.onTemplateTypeChanged()
self.plugin_dir = os.path.dirname(__file__)
# Replacement map
self.ui.suitableForComboBox.addItem('<custom>')
self.user = os.environ.get('username', '[user]')
self.replaceMap = {
'author': "Compiled by {} on [%concat(day($now ),'/',month($now),'/',year($now))%]".format(self.user)
}
self.ui.autofit_btn.clicked.connect(self.autofit_map)
self.ui.suitableForComboBox.currentIndexChanged.connect(self.specify_dpi)
self.ui.suitableForComboBox.editTextChanged.connect(self.text_changed)
self.ui.poiLayerComboBox.currentIndexChanged.connect(self.onPoiLayerChanged)
示例13: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, item, parent=None):
QDialog.__init__(self, parent)
self.item = item
self.setupUi(self)
self.db = self.item.database()
self.schemas = self.db.schemas()
self.hasSchemas = self.schemas is not None
self.buttonBox.accepted.connect(self.onOK)
self.buttonBox.helpRequested.connect(self.showHelp)
self.populateSchemas()
self.populateTables()
if isinstance(item, Table):
index = self.cboTable.findText(self.item.name)
if index >= 0:
self.cboTable.setCurrentIndex(index)
self.cboSchema.currentIndexChanged.connect(self.populateTables)
# updates of SQL window
self.cboSchema.currentIndexChanged.connect(self.updateSql)
self.cboTable.currentIndexChanged.connect(self.updateSql)
self.chkCreateCurrent.stateChanged.connect(self.updateSql)
self.editPkey.textChanged.connect(self.updateSql)
self.editStart.textChanged.connect(self.updateSql)
self.editEnd.textChanged.connect(self.updateSql)
self.updateSql()
示例14: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, parent=None, table=None, db=None):
QDialog.__init__(self, parent)
self.table = table
self.db = self.table.database() if self.table and self.table.database() else db
self.setupUi(self)
self.buttonBox.accepted.connect(self.createGeomColumn)
示例15: __init__
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import __init__ [as 别名]
def __init__(self, alg, model, algName=None, configuration=None):
QDialog.__init__(self)
self.setModal(True)
self._alg = alg # The algorithm to define in this dialog. It is an instance of QgsProcessingAlgorithm
self.model = model # The model this algorithm is going to be added to. It is an instance of QgsProcessingModelAlgorithm
self.childId = algName # The name of the algorithm in the model, in case we are editing it and not defining it for the first time
self.configuration = configuration
self.context = createContext()
self.widget_labels = {}
class ContextGenerator(QgsProcessingContextGenerator):
def __init__(self, context):
super().__init__()
self.processing_context = context
def processingContext(self):
return self.processing_context
self.context_generator = ContextGenerator(self.context)
self.setupUi()
self.params = None
settings = QgsSettings()
self.restoreGeometry(settings.value("/Processing/modelParametersDialogGeometry", QByteArray()))