def paint(self, painter, option, index): if not self.parent().indexWidget(index): btn_reload = QPushButton(index.data(), self.parent()) btn_reload.clicked.connect( lambda: self.functionOwner.update_validity(index)) btn_reload.setMinimumSize(qcore.QSize(26, 26)) btn_reload.setMaximumSize(qcore.QSize(26, 26)) btn_reload.setIcon( qgui.QIcon(':/resourcesFolder/icons/refresh_icon.svg')) self.parent().setIndexWidget(index, btn_reload)
def __init__(self, text): QtGui.QPushButton.__init__(self) self.setText(text) buttons_size_policy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) self.setSizePolicy(buttons_size_policy) self.setMaximumSize(QtCore.QSize(30, 30))
def run(self): if self.check_all_inputs(): # Sets the visual of the tool self.lbl_funding1.setVisible(False) self.lbl_funding2.setVisible(False) self.progress_label.setVisible(True) self.progressbar.setVisible(True) self.setMaximumSize(QtCore.QSize(383, 444)) self.resize(383, 444) dl_type = "DesireLines" if self.radio_delaunay.isChecked(): dl_type = "DelaunayLines" self.worker_thread = DesireLinesProcedure( qgis.utils.iface.mainWindow(), self.zoning_layer.currentText(), self.zone_id_field.currentText(), self.matrix, self.matrix_hash, dl_type, ) self.run_thread() else: qgis.utils.iface.messageBar().pushMessage( "Inputs not loaded properly. You need the layer and at least one matrix_procedures core", "", level=3)
def get_qgis_app(): """ Start one QGIS application to test against. :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFACE, PARENT) If QGIS is already running the handle to that app will be returned. """ global QGIS_APP, PARENT, IFACE, CANVAS # pylint: disable=W0603 if iface: from qgis.core import QgsApplication QGIS_APP = QgsApplication CANVAS = iface.mapCanvas() PARENT = iface.mainWindow() IFACE = iface return QGIS_APP, CANVAS, IFACE, PARENT try: from qgis.PyQt import QtGui, QtCore, QtWidgets from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas except ImportError: return None, None, None, None if QGIS_APP is None: gui_flag = True # All test will run qgis in gui mode # noinspection PyPep8Naming QgsApplication.setPrefixPath('/usr', True) QGIS_APP = QgsApplication([], gui_flag) # Make sure QGIS_PREFIX_PATH is set in your env if needed! QGIS_APP.initQgis() s = QGIS_APP.showSettings() LOGGER.debug(s) if PARENT is None: # noinspection PyPep8Naming PARENT = QtWidgets.QWidget if CANVAS is None: # noinspection PyPep8Naming CANVAS = QgsMapCanvas() CANVAS.resize(QtCore.QSize(400, 400)) if IFACE is None: # QgisInterface is a stub implementation of the QGIS plugin interface # noinspection PyPep8Naming # IFACE = QgisInterface(CANVAS) IFACE = None return QGIS_APP, CANVAS, IFACE, PARENT
def get_qgis_app(): """ Start one QGIS application to test against. :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFACE, PARENT) If QGIS is already running the handle to that app will be returned. """ from qgis.PyQt import QtGui, QtCore from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas from svir.test.qgis_interface import QgisInterface global QGIS_APP # pylint: disable=W0603 if QGIS_APP is None: gui_flag = True # All test will run qgis in gui mode #noinspection PyPep8Naming QGIS_APP = QgsApplication(sys.argv, gui_flag) # Make sure QGIS_PREFIX_PATH is set in your env if needed! QGIS_APP.initQgis() s = QGIS_APP.showSettings() LOGGER.debug(s) global PARENT # pylint: disable=W0603 if PARENT is None: #noinspection PyPep8Naming PARENT = QtGui.QWidget() global CANVAS # pylint: disable=W0603 if CANVAS is None: #noinspection PyPep8Naming CANVAS = QgsMapCanvas(PARENT) CANVAS.resize(QtCore.QSize(400, 400)) global IFACE # pylint: disable=W0603 if IFACE is None: # QgisInterface is a stub implementation of the QGIS plugin interface #noinspection PyPep8Naming IFACE = QgisInterface(CANVAS) # add some fake methods, where the actual ones were missing # FIXME: in QgisInterface, legendInterface is returning the canvas # instead of the legendInterface, which breaks things like setting the # active layer or refreshing the layer symbology. def do_nothing(layer): pass IFACE.legendInterface().refreshLayerSymbology = do_nothing return QGIS_APP, CANVAS, IFACE, PARENT
def __init__(self, parent=None): super(ScribbleArea, self).__init__(parent) self.setAttribute(QtCore.Qt.WA_StaticContents) self.modified = False self.scribbling = False imageSize = QtCore.QSize(500, 500) self.image = QtGui.QImage(imageSize, QtGui.QImage.Format_RGB16) self.userimage = None self.painter = QtGui.QPainter() self.lastPoint = QtCore.QPoint() self.pen = QtGui.QPen()
def setupUi(self, photosImp): photosImp.setObjectName(_fromUtf8("photosImp")) photosImp.setWindowModality(QtCore.Qt.ApplicationModal) photosImp.resize(377, 164) photosImp.setMinimumSize(QtCore.QSize(377, 164)) photosImp.setMaximumSize(QtCore.QSize(377, 164)) photosImp.setWhatsThis(_fromUtf8("")) photosImp.setSizeGripEnabled(False) self.label = QtGui.QLabel(photosImp) self.label.setGeometry(QtCore.QRect(10, 20, 101, 16)) self.label.setObjectName(_fromUtf8("label")) self.label_2 = QtGui.QLabel(photosImp) self.label_2.setGeometry(QtCore.QRect(10, 50, 101, 21)) self.label_2.setObjectName(_fromUtf8("label_2")) self.imp = QtGui.QLineEdit(photosImp) self.imp.setGeometry(QtCore.QRect(130, 20, 151, 20)) self.imp.setObjectName(_fromUtf8("imp")) self.toolButtonImport = QtGui.QToolButton(photosImp) self.toolButtonImport.setGeometry(QtCore.QRect(300, 20, 60, 19)) self.toolButtonImport.setObjectName(_fromUtf8("toolButtonImport")) self.out = QtGui.QLineEdit(photosImp) self.out.setGeometry(QtCore.QRect(130, 50, 151, 20)) self.out.setObjectName(_fromUtf8("out")) self.toolButtonOut = QtGui.QToolButton(photosImp) self.toolButtonOut.setGeometry(QtCore.QRect(300, 50, 60, 19)) self.toolButtonOut.setObjectName(_fromUtf8("toolButtonOut")) self.progressBar = QtGui.QProgressBar(photosImp) self.progressBar.setGeometry(QtCore.QRect(10, 90, 351, 21)) self.progressBar.setProperty("value", 0) self.progressBar.setObjectName(_fromUtf8("progressBar")) self.ok = QtGui.QPushButton(photosImp) self.ok.setGeometry(QtCore.QRect(10, 130, 75, 23)) self.ok.setObjectName(_fromUtf8("ok")) self.closebutton = QtGui.QPushButton(photosImp) self.closebutton.setGeometry(QtCore.QRect(290, 130, 75, 23)) self.closebutton.setObjectName(_fromUtf8("closebutton")) self.retranslateUi(photosImp) QtCore.QMetaObject.connectSlotsByName(photosImp)
def setupUi(self, DeleteProject): DeleteProject.setObjectName(_fromUtf8("DeleteProject")) DeleteProject.resize(381, 124) self.gridLayout = QtGui.QGridLayout(DeleteProject) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.groupBox = QtGui.QGroupBox(DeleteProject) self.groupBox.setFlat(False) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.gridLayout_2 = QtGui.QGridLayout(self.groupBox) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.gridLayout2 = QtGui.QGridLayout() self.gridLayout2.setObjectName(_fromUtf8("gridLayout2")) self.cBoxProject = QtGui.QComboBox(self.groupBox) self.cBoxProject.setEnabled(True) self.cBoxProject.setMinimumSize(QtCore.QSize(0, 0)) self.cBoxProject.setObjectName(_fromUtf8("cBoxProject")) self.gridLayout2.addWidget(self.cBoxProject, 0, 1, 1, 1) self.label_7 = QtGui.QLabel(self.groupBox) self.label_7.setEnabled(True) self.label_7.setMinimumSize(QtCore.QSize(0, 27)) self.label_7.setObjectName(_fromUtf8("label_7")) self.gridLayout2.addWidget(self.label_7, 0, 0, 1, 1) self.gridLayout_2.addLayout(self.gridLayout2, 0, 0, 1, 1) self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(DeleteProject) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1) self.retranslateUi(DeleteProject) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), DeleteProject.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), DeleteProject.reject) QtCore.QMetaObject.connectSlotsByName(DeleteProject)
def set_show_matrices(self): self.tbl_array_cores.clear() if self.chb_use_all_matrices.isChecked(): self.resize(383, 385) self.setMaximumSize(QtCore.QSize(383, 385)) else: self.setMaximumSize(QtCore.QSize(710, 385)) self.resize(710, 385) self.tbl_array_cores.setColumnWidth(0, 200) self.tbl_array_cores.setColumnWidth(1, 80) self.tbl_array_cores.setHorizontalHeaderLabels(["Matrix", "Use?"]) if self.matrix is not None: table = self.tbl_array_cores table.setRowCount(self.matrix.cores) for i, mat in enumerate(self.matrix.names): item1 = QTableWidgetItem(mat) item1.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable) table.setItem(i, 0, item1) chb1 = QCheckBox() chb1.setChecked(True) chb1.setEnabled(True) table.setCellWidget(i, 1, self.centers_item(chb1))
def get_qgis_app(): """ Start one QGIS application to test against. :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFACE, PARENT) If QGIS is already running the handle to that app will be returned. """ try: from qgis.PyQt import QtGui, QtCore, QtWidgets from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas from .qgis_interface import QgisInterface except ImportError as e: return None, None, None, None global QGIS_APP # pylint: disable=W0603 if QGIS_APP is None: gui_flag = True # All test will run qgis in gui mode #noinspection PyPep8Naming argv_bytes = list(map(lambda x: bytes(x, 'utf-8'), sys.argv)) QGIS_APP = QgsApplication(argv_bytes, gui_flag) # Make sure QGIS_PREFIX_PATH is set in your env if needed! QGIS_APP.initQgis() s = QGIS_APP.showSettings() LOGGER.debug(s) global PARENT # pylint: disable=W0603 if PARENT is None: #noinspection PyPep8Naming PARENT = QtWidgets.QWidget() global CANVAS # pylint: disable=W0603 if CANVAS is None: #noinspection PyPep8Naming CANVAS = QgsMapCanvas(PARENT) CANVAS.resize(QtCore.QSize(400, 400)) global IFACE # pylint: disable=W0603 if IFACE is None: # QgisInterface is a stub implementation of the QGIS plugin interface #noinspection PyPep8Naming IFACE = QgisInterface(CANVAS) return QGIS_APP, CANVAS, IFACE, PARENT
def setupUi(self, QgsNewHttpConnectionBase): QgsNewHttpConnectionBase.setObjectName("QgsNewHttpConnectionBase") QgsNewHttpConnectionBase.resize(618, 247) QgsNewHttpConnectionBase.setSizeGripEnabled(True) QgsNewHttpConnectionBase.setModal(True) self.gridlayout = QtGui.QGridLayout(QgsNewHttpConnectionBase) self.gridlayout.setObjectName("gridlayout") self.GroupBox1 = QtGui.QGroupBox(QgsNewHttpConnectionBase) self.GroupBox1.setObjectName("GroupBox1") self.gridlayout1 = QtGui.QGridLayout(self.GroupBox1) self.gridlayout1.setObjectName("gridlayout1") self.TextLabel1_2 = QtGui.QLabel(self.GroupBox1) self.TextLabel1_2.setMargin(5) self.TextLabel1_2.setObjectName("TextLabel1_2") self.gridlayout1.addWidget(self.TextLabel1_2, 0, 0, 1, 1) self.txtName = QtGui.QLineEdit(self.GroupBox1) self.txtName.setMinimumSize(QtCore.QSize(0, 0)) self.txtName.setFrame(True) self.txtName.setObjectName("txtName") self.gridlayout1.addWidget(self.txtName, 0, 1, 1, 2) self.TextLabel1 = QtGui.QLabel(self.GroupBox1) self.TextLabel1.setMargin(5) self.TextLabel1.setObjectName("TextLabel1") self.gridlayout1.addWidget(self.TextLabel1, 1, 0, 1, 1) self.txtUrl = QtGui.QLineEdit(self.GroupBox1) self.txtUrl.setObjectName("txtUrl") self.gridlayout1.addWidget(self.txtUrl, 1, 1, 1, 2) self.label = QtGui.QLabel(self.GroupBox1) self.label.setObjectName("label") self.gridlayout1.addWidget(self.label, 2, 0, 1, 1) self.txtVersion = QtGui.QLineEdit(self.GroupBox1) self.txtVersion.setObjectName("txtVersion") self.gridlayout1.addWidget(self.txtVersion, 2, 1, 1, 2) self.gridlayout.addWidget(self.GroupBox1, 0, 0, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(QgsNewHttpConnectionBase) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Help|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridlayout.addWidget(self.buttonBox, 1, 0, 1, 1) self.TextLabel1_2.setBuddy(self.txtName) self.TextLabel1.setBuddy(self.txtUrl) self.retranslateUi(QgsNewHttpConnectionBase) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), QgsNewHttpConnectionBase.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), QgsNewHttpConnectionBase.reject) QtCore.QMetaObject.connectSlotsByName(QgsNewHttpConnectionBase) QgsNewHttpConnectionBase.setTabOrder(self.txtName, self.txtUrl)
def get_qgis_app(): """ Start one QGIS application to test against. :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFACE, PARENT) If QGIS is already running the handle to that app will be returned. """ try: from qgis.PyQt import QtGui, QtCore, QtWidgets from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas from qgis.testing import start_app except ImportError: return None, None, None, None global QGIS_APP # pylint: disable=W0603 if QGIS_APP is None: #noinspection PyPep8Naming QGIS_APP = start_app() s = QGIS_APP.showSettings() LOGGER.debug(s) global PARENT # pylint: disable=W0603 if PARENT is None: #noinspection PyPep8Naming PARENT = QtWidgets.QWidget() global CANVAS # pylint: disable=W0603 if CANVAS is None: #noinspection PyPep8Naming CANVAS = QgsMapCanvas(PARENT) CANVAS.resize(QtCore.QSize(400, 400)) global IFACE # pylint: disable=W0603 if IFACE is None: from test.qgis_interface import QgisInterface # QgisInterface is a stub implementation of the QGIS plugin interface #noinspection PyPep8Naming IFACE = QgisInterface(CANVAS) return QGIS_APP, CANVAS, IFACE, PARENT
def testMethod(self): self.createMainWin() self.mainwin.resize(QtCore.QSize(1000,800)) if True: if int(qgis.PyQt.QtCore.QT_VERSION_STR[0]) == 4: # qgis2 reg = qgis.core.QgsPluginLayerRegistry.instance() elif int(qgis.PyQt.QtCore.QT_VERSION_STR[0]) == 5: # qgis3 reg = qgis.core.QgsApplication.pluginLayerRegistry() # qgisRegistryInstance = qgis.core.QgsApplication.pluginLayerRegistry() reg.addPluginLayerType(SelafinPluginLayerType()) if True: layer = SelafinPluginLayer(self.tr('Click properties to load selafin file'), specificmapcanvas=self.canvas) if True: self.dialogslf = layer.propertiesdialog self.mainwin.frame_2.layout().addWidget(self.dialogslf) if True: print('********* SELAFI created ***************************** ') pathslf = os.path.join(os.path.dirname(__file__), 'telemac_files', 'r2d_malpasset-fine.slf') layer.load_selafin(pathslf,'TELEMAC') if True: print('********* SELAFI loaded ***************************** ') self.canvas.setLayers([layer]) self.canvas.refresh() print('********* SELAFI on canvas ***************************** ') print('launch window') self.mainwin.exec_()
def __init__(self, iface): QtWidgets.QDialog.__init__(self) self.iface = iface self.setupUi(self) self.error = None self.validtypes = numeric_types self.tot_skims = 0 self.name_skims = 0 self.matrix = None self.path = standard_path() self.zones = None self.columns = None self.matrix_hash = {} self.setMaximumSize(QtCore.QSize(383, 385)) self.resize(383, 385) # FIRST, we connect slot signals # For changing the input matrix_procedures self.but_load_new_matrix.clicked.connect(self.find_matrices) self.zoning_layer.currentIndexChanged.connect( self.load_fields_to_combo_boxes) self.chb_use_all_matrices.toggled.connect(self.set_show_matrices) # Create desire lines self.create_dl.clicked.connect(self.run) # cancel button self.cancel.clicked.connect(self.exit_procedure) # THIRD, we load layers in the canvas to the combo-boxes for layer in qgis.utils.iface.mapCanvas().layers( ): # We iterate through all layers if 'wkbType' in dir(layer): if layer.wkbType() in poly_types or layer.wkbType( ) in point_types: self.zoning_layer.addItem(layer.name()) self.progress_label.setVisible(False) self.progressbar.setVisible(False)
def resizing(self): if self.radio_aeq_matrix.isChecked(): self.group_combo.setVisible(False) self.group_list.setVisible(False) self.group_buttons.setVisible(False) self.setMaximumSize(127, 176) self.resize(127, 176) self.but_permanent_save.setVisible(False) else: self.group_combo.setVisible(True) self.group_list.setVisible(True) self.group_buttons.setVisible(True) self.matrix_list_view.setColumnWidth(0, 180) self.matrix_list_view.setColumnWidth(1, 100) self.matrix_list_view.setColumnWidth(2, 125) self.matrix_list_view.itemChanged.connect(self.change_matrix_name) self.matrix_list_view.doubleClicked.connect(self.slot_double_clicked) self.setMaximumSize(QtCore.QSize(100000, 100000)) self.resize(542, 427) self.but_permanent_save.setVisible(True) self.but_save_for_single_use.setEnabled(False) self.but_permanent_save.setEnabled(False)
def setupUi(self, MainApp): MainApp.setObjectName(_fromUtf8("MainApp")) MainApp.resize(918, 332) MainApp.setLayoutDirection(QtCore.Qt.LeftToRight) self.centralWidget = QtWidgets.QWidget(MainApp) self.centralWidget.setObjectName(_fromUtf8("centralWidget")) self.gridLayout_4 = QtWidgets.QGridLayout(self.centralWidget) self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) self.splitter = QtWidgets.QSplitter(self.centralWidget) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName(_fromUtf8("splitter")) self.stackedWidget = QtWidgets.QStackedWidget(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(2) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.stackedWidget.sizePolicy().hasHeightForWidth()) self.stackedWidget.setSizePolicy(sizePolicy) self.stackedWidget.setObjectName(_fromUtf8("stackedWidget")) self.importPage = QtWidgets.QWidget() self.importPage.setObjectName(_fromUtf8("importPage")) self.gridLayout_10 = QtWidgets.QGridLayout(self.importPage) self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) self.scrollArea_5 = QtWidgets.QScrollArea(self.importPage) self.scrollArea_5.setWidgetResizable(True) self.scrollArea_5.setObjectName(_fromUtf8("scrollArea_5")) self.scrollAreaWidgetContents_5 = QtWidgets.QWidget() self.scrollAreaWidgetContents_5.setGeometry(QtCore.QRect(0, 0, 409, 294)) self.scrollAreaWidgetContents_5.setObjectName(_fromUtf8("scrollAreaWidgetContents_5")) self.gridLayout_11 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_5) self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents_5) self.widget.setObjectName(_fromUtf8("widget")) self.gridLayout_17 = QtWidgets.QGridLayout(self.widget) self.gridLayout_17.setMargin(0) self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) self.groupBox = QtWidgets.QGroupBox(self.widget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth()) self.groupBox.setSizePolicy(sizePolicy) self.groupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.groupBox.setFlat(False) self.groupBox.setCheckable(False) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.groupBox) self.horizontalLayout_6.setSpacing(6) self.horizontalLayout_6.setContentsMargins(9, 7, -1, 0) self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) self.rb_file = QtWidgets.QRadioButton(self.groupBox) self.rb_file.setChecked(True) self.rb_file.setObjectName(_fromUtf8("rb_file")) self.horizontalLayout_6.addWidget(self.rb_file) self.rb_directory = QtWidgets.QRadioButton(self.groupBox) self.rb_directory.setObjectName(_fromUtf8("rb_directory")) self.horizontalLayout_6.addWidget(self.rb_directory) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_6.addItem(spacerItem) self.gridLayout_17.addWidget(self.groupBox, 0, 0, 1, 1) spacerItem1 = QtWidgets.QSpacerItem(20, 13, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout_17.addItem(spacerItem1, 2, 0, 1, 1) self.gridLayout_12 = QtWidgets.QGridLayout() self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) self.pb_nextFile = QtWidgets.QPushButton(self.widget) self.pb_nextFile.setMinimumSize(QtCore.QSize(0, 0)) self.pb_nextFile.setMaximumSize(QtCore.QSize(27, 27)) font = QtGui.QFont() font.setPointSize(9) font.setBold(True) font.setUnderline(False) font.setWeight(75) font.setStrikeOut(False) font.setKerning(False) self.pb_nextFile.setFont(font) self.pb_nextFile.setStyleSheet(_fromUtf8("")) self.pb_nextFile.setAutoRepeat(False) self.pb_nextFile.setAutoDefault(False) self.pb_nextFile.setDefault(False) self.pb_nextFile.setFlat(False) self.pb_nextFile.setObjectName(_fromUtf8("pb_nextFile")) self.gridLayout_12.addWidget(self.pb_nextFile, 0, 2, 1, 1) self.label_2 = QtWidgets.QLabel(self.widget) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.label_2.setFont(font) self.label_2.setObjectName(_fromUtf8("label_2")) self.gridLayout_12.addWidget(self.label_2, 1, 0, 1, 1) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) self.vfkFileLineEdit = QtWidgets.QLineEdit(self.widget) self.vfkFileLineEdit.setObjectName(_fromUtf8("vfkFileLineEdit")) self.horizontalLayout_3.addWidget(self.vfkFileLineEdit) self.browseButton = QtWidgets.QPushButton(self.widget) self.browseButton.setObjectName(_fromUtf8("browseButton")) self.horizontalLayout_3.addWidget(self.browseButton) self.gridLayout_12.addLayout(self.horizontalLayout_3, 0, 1, 1, 1) self.budCheckBox = QtWidgets.QCheckBox(self.widget) self.budCheckBox.setChecked(True) self.budCheckBox.setObjectName(_fromUtf8("budCheckBox")) self.gridLayout_12.addWidget(self.budCheckBox, 2, 1, 1, 1) self.label = QtWidgets.QLabel(self.widget) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.label.setFont(font) self.label.setObjectName(_fromUtf8("label")) self.gridLayout_12.addWidget(self.label, 0, 0, 1, 1) self.parCheckBox = QtWidgets.QCheckBox(self.widget) self.parCheckBox.setChecked(True) self.parCheckBox.setObjectName(_fromUtf8("parCheckBox")) self.gridLayout_12.addWidget(self.parCheckBox, 1, 1, 1, 1) self.l_settings = QtWidgets.QLabel(self.widget) self.l_settings.setMinimumSize(QtCore.QSize(69, 0)) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.l_settings.setFont(font) self.l_settings.setObjectName(_fromUtf8("l_settings")) self.gridLayout_12.addWidget(self.l_settings, 3, 0, 1, 1) self.overwriteCheckBox = QtWidgets.QCheckBox(self.widget) self.overwriteCheckBox.setChecked(False) self.overwriteCheckBox.setObjectName(_fromUtf8("overwriteCheckBox")) self.gridLayout_12.addWidget(self.overwriteCheckBox, 3, 1, 1, 1) self.gridLayout_17.addLayout(self.gridLayout_12, 1, 0, 1, 1) self.labelLoading = QtWidgets.QLabel(self.widget) self.labelLoading.setText(_fromUtf8("")) self.labelLoading.setObjectName(_fromUtf8("labelLoading")) self.gridLayout_17.addWidget(self.labelLoading, 3, 0, 1, 1) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.progressBar = QtWidgets.QProgressBar(self.widget) self.progressBar.setProperty("value", 0) self.progressBar.setObjectName(_fromUtf8("progressBar")) self.horizontalLayout_2.addWidget(self.progressBar) self.loadVfkButton = QtWidgets.QPushButton(self.widget) self.loadVfkButton.setObjectName(_fromUtf8("loadVfkButton")) self.horizontalLayout_2.addWidget(self.loadVfkButton) self.gridLayout_17.addLayout(self.horizontalLayout_2, 4, 0, 1, 1) self.gridLayout_11.addWidget(self.widget, 1, 0, 1, 1) self.scrollArea_5.setWidget(self.scrollAreaWidgetContents_5) self.gridLayout_10.addWidget(self.scrollArea_5, 0, 0, 1, 1) self.stackedWidget.addWidget(self.importPage) self.changesPage = QtWidgets.QWidget() self.changesPage.setObjectName(_fromUtf8("changesPage")) self.gridLayout_15 = QtWidgets.QGridLayout(self.changesPage) self.gridLayout_15.setObjectName(_fromUtf8("gridLayout_15")) self.scrollArea_6 = QtWidgets.QScrollArea(self.changesPage) self.scrollArea_6.setWidgetResizable(True) self.scrollArea_6.setObjectName(_fromUtf8("scrollArea_6")) self.scrollAreaWidgetContents_6 = QtWidgets.QWidget() self.scrollAreaWidgetContents_6.setGeometry(QtCore.QRect(0, 0, 269, 194)) self.scrollAreaWidgetContents_6.setObjectName(_fromUtf8("scrollAreaWidgetContents_6")) self.gridLayout_16 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_6) self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) self.widget_3 = QtWidgets.QWidget(self.scrollAreaWidgetContents_6) self.widget_3.setObjectName(_fromUtf8("widget_3")) self.gridLayout_14 = QtWidgets.QGridLayout(self.widget_3) self.gridLayout_14.setMargin(0) self.gridLayout_14.setObjectName(_fromUtf8("gridLayout_14")) self.gridLayout_13 = QtWidgets.QGridLayout() self.gridLayout_13.setObjectName(_fromUtf8("gridLayout_13")) self.label_4 = QtWidgets.QLabel(self.widget_3) self.label_4.setObjectName(_fromUtf8("label_4")) self.gridLayout_13.addWidget(self.label_4, 0, 0, 1, 1) self.le_mainDb = QtWidgets.QLineEdit(self.widget_3) self.le_mainDb.setObjectName(_fromUtf8("le_mainDb")) self.gridLayout_13.addWidget(self.le_mainDb, 0, 1, 1, 1) self.pb_mainDb = QtWidgets.QPushButton(self.widget_3) self.pb_mainDb.setObjectName(_fromUtf8("pb_mainDb")) self.gridLayout_13.addWidget(self.pb_mainDb, 0, 2, 1, 1) self.label_5 = QtWidgets.QLabel(self.widget_3) self.label_5.setObjectName(_fromUtf8("label_5")) self.gridLayout_13.addWidget(self.label_5, 1, 0, 1, 1) self.le_amendmentDb = QtWidgets.QLineEdit(self.widget_3) self.le_amendmentDb.setObjectName(_fromUtf8("le_amendmentDb")) self.gridLayout_13.addWidget(self.le_amendmentDb, 1, 1, 1, 1) self.pb_amendmentDb = QtWidgets.QPushButton(self.widget_3) self.pb_amendmentDb.setObjectName(_fromUtf8("pb_amendmentDb")) self.gridLayout_13.addWidget(self.pb_amendmentDb, 1, 2, 1, 1) self.label_6 = QtWidgets.QLabel(self.widget_3) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout_13.addWidget(self.label_6, 2, 0, 1, 1) self.le_exportDb = QtWidgets.QLineEdit(self.widget_3) self.le_exportDb.setObjectName(_fromUtf8("le_exportDb")) self.gridLayout_13.addWidget(self.le_exportDb, 2, 1, 1, 1) self.pb_exportDb = QtWidgets.QPushButton(self.widget_3) self.pb_exportDb.setObjectName(_fromUtf8("pb_exportDb")) self.gridLayout_13.addWidget(self.pb_exportDb, 2, 2, 1, 1) self.gridLayout_14.addLayout(self.gridLayout_13, 0, 0, 1, 1) spacerItem2 = QtWidgets.QSpacerItem(20, 38, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout_14.addItem(spacerItem2, 1, 0, 1, 1) self.l_status = QtWidgets.QLabel(self.widget_3) self.l_status.setText(_fromUtf8("")) self.l_status.setObjectName(_fromUtf8("l_status")) self.gridLayout_14.addWidget(self.l_status, 2, 0, 1, 1) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5")) self.progressBar_Changes = QtWidgets.QProgressBar(self.widget_3) self.progressBar_Changes.setProperty("value", 0) self.progressBar_Changes.setObjectName(_fromUtf8("progressBar_Changes")) self.horizontalLayout_5.addWidget(self.progressBar_Changes) self.pb_applyChanges = QtWidgets.QPushButton(self.widget_3) self.pb_applyChanges.setObjectName(_fromUtf8("pb_applyChanges")) self.horizontalLayout_5.addWidget(self.pb_applyChanges) self.gridLayout_14.addLayout(self.horizontalLayout_5, 3, 0, 1, 1) self.gridLayout_16.addWidget(self.widget_3, 0, 0, 1, 1) self.scrollArea_6.setWidget(self.scrollAreaWidgetContents_6) self.gridLayout_15.addWidget(self.scrollArea_6, 0, 0, 1, 1) self.stackedWidget.addWidget(self.changesPage) self.searchPage = QtWidgets.QWidget() sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.searchPage.sizePolicy().hasHeightForWidth()) self.searchPage.setSizePolicy(sizePolicy) self.searchPage.setObjectName(_fromUtf8("searchPage")) self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.searchPage) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.label_3 = QtWidgets.QLabel(self.searchPage) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) self.label_3.setObjectName(_fromUtf8("label_3")) self.horizontalLayout_4.addWidget(self.label_3) self.searchCombo = QtWidgets.QComboBox(self.searchPage) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.searchCombo.sizePolicy().hasHeightForWidth()) self.searchCombo.setSizePolicy(sizePolicy) self.searchCombo.setObjectName(_fromUtf8("searchCombo")) self.horizontalLayout_4.addWidget(self.searchCombo) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.searchForms = QtWidgets.QStackedWidget(self.searchPage) self.searchForms.setObjectName(_fromUtf8("searchForms")) self.page = QtWidgets.QWidget() self.page.setObjectName(_fromUtf8("page")) self.gridLayout = QtWidgets.QGridLayout(self.page) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.scrollArea = QtWidgets.QScrollArea(self.page) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName(_fromUtf8("scrollArea")) self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 48, 28)) self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents")) self.gridLayout_5 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents) self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) self.vlastniciSearchForm = VlastniciSearchForm(self.scrollAreaWidgetContents) self.vlastniciSearchForm.setObjectName(_fromUtf8("vlastniciSearchForm")) self.gridLayout_5.addWidget(self.vlastniciSearchForm, 0, 0, 1, 1) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.gridLayout.addWidget(self.scrollArea, 0, 0, 1, 1) self.searchForms.addWidget(self.page) self.page_2 = QtWidgets.QWidget() self.page_2.setObjectName(_fromUtf8("page_2")) self.gridLayout_6 = QtWidgets.QGridLayout(self.page_2) self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) self.scrollArea_3 = QtWidgets.QScrollArea(self.page_2) self.scrollArea_3.setWidgetResizable(True) self.scrollArea_3.setObjectName(_fromUtf8("scrollArea_3")) self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 66, 28)) self.scrollAreaWidgetContents_2.setObjectName(_fromUtf8("scrollAreaWidgetContents_2")) self.gridLayout_7 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_2) self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) self.parcelySearchForm = ParcelySearchForm(self.scrollAreaWidgetContents_2) self.parcelySearchForm.setObjectName(_fromUtf8("parcelySearchForm")) self.gridLayout_7.addWidget(self.parcelySearchForm, 0, 0, 1, 1) self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_2) self.gridLayout_6.addWidget(self.scrollArea_3, 0, 0, 1, 1) self.searchForms.addWidget(self.page_2) self.page_3 = QtWidgets.QWidget() self.page_3.setObjectName(_fromUtf8("page_3")) self.gridLayout_2 = QtWidgets.QGridLayout(self.page_3) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.scrollArea_2 = QtWidgets.QScrollArea(self.page_3) self.scrollArea_2.setWidgetResizable(True) self.scrollArea_2.setObjectName(_fromUtf8("scrollArea_2")) self.scrollAreaWidgetContents_3 = QtWidgets.QWidget() self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 66, 28)) self.scrollAreaWidgetContents_3.setObjectName(_fromUtf8("scrollAreaWidgetContents_3")) self.gridLayout_3 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_3) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) self.budovySearchForm = BudovySearchForm(self.scrollAreaWidgetContents_3) self.budovySearchForm.setObjectName(_fromUtf8("budovySearchForm")) self.gridLayout_3.addWidget(self.budovySearchForm, 0, 0, 1, 1) self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_3) self.gridLayout_2.addWidget(self.scrollArea_2, 0, 0, 1, 1) self.searchForms.addWidget(self.page_3) self.page_4 = QtWidgets.QWidget() self.page_4.setObjectName(_fromUtf8("page_4")) self.gridLayout_8 = QtWidgets.QGridLayout(self.page_4) self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) self.scrollArea_4 = QtWidgets.QScrollArea(self.page_4) self.scrollArea_4.setWidgetResizable(True) self.scrollArea_4.setObjectName(_fromUtf8("scrollArea_4")) self.scrollAreaWidgetContents_4 = QtWidgets.QWidget() self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 66, 28)) self.scrollAreaWidgetContents_4.setObjectName(_fromUtf8("scrollAreaWidgetContents_4")) self.gridLayout_9 = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_4) self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) self.jednotkySearchForm = JednotkySearchForm(self.scrollAreaWidgetContents_4) self.jednotkySearchForm.setObjectName(_fromUtf8("jednotkySearchForm")) self.gridLayout_9.addWidget(self.jednotkySearchForm, 0, 0, 1, 1) self.scrollArea_4.setWidget(self.scrollAreaWidgetContents_4) self.gridLayout_8.addWidget(self.scrollArea_4, 0, 0, 1, 1) self.searchForms.addWidget(self.page_4) self.verticalLayout_3.addWidget(self.searchForms) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem3) self.searchButton = QtWidgets.QPushButton(self.searchPage) self.searchButton.setObjectName(_fromUtf8("searchButton")) self.horizontalLayout.addWidget(self.searchButton) self.verticalLayout_3.addLayout(self.horizontalLayout) self.stackedWidget.addWidget(self.searchPage) self.widget_2 = QtWidgets.QWidget(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(3) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.widget_2.sizePolicy().hasHeightForWidth()) self.widget_2.setSizePolicy(sizePolicy) self.widget_2.setObjectName(_fromUtf8("widget_2")) self.rightWidgetLayout = QtWidgets.QVBoxLayout(self.widget_2) self.rightWidgetLayout.setMargin(0) self.rightWidgetLayout.setObjectName(_fromUtf8("rightWidgetLayout")) self.vfkBrowser = VfkTextBrowser(self.widget_2) self.vfkBrowser.setObjectName(_fromUtf8("vfkBrowser")) self.rightWidgetLayout.addWidget(self.vfkBrowser) self.gridLayout_4.addWidget(self.splitter, 0, 1, 1, 1) MainApp.setWidget(self.centralWidget) self.actionVyhledavani = QtWidgets.QAction(MainApp) self.actionVyhledavani.setCheckable(True) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/search.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionVyhledavani.setIcon(icon) self.actionVyhledavani.setObjectName(_fromUtf8("actionVyhledavani")) self.actionImport = QtWidgets.QAction(MainApp) self.actionImport.setCheckable(True) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/db-add.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionImport.setIcon(icon1) self.actionImport.setObjectName(_fromUtf8("actionImport")) self.actionBack = QtWidgets.QAction(MainApp) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/arrowBack.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionBack.setIcon(icon2) self.actionBack.setObjectName(_fromUtf8("actionBack")) self.actionForward = QtWidgets.QAction(MainApp) self.actionForward.setEnabled(True) icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/arrowForward.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionForward.setIcon(icon3) self.actionForward.setObjectName(_fromUtf8("actionForward")) self.actionExportLatex = QtWidgets.QAction(MainApp) self.actionExportLatex.setObjectName(_fromUtf8("actionExportLatex")) self.actionExportHtml = QtWidgets.QAction(MainApp) self.actionExportHtml.setObjectName(_fromUtf8("actionExportHtml")) self.actionSelectParInMap = QtWidgets.QAction(MainApp) icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/selectPar.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionSelectParInMap.setIcon(icon4) self.actionSelectParInMap.setObjectName(_fromUtf8("actionSelectParInMap")) self.actionSelectBudInMap = QtWidgets.QAction(MainApp) icon5 = QtGui.QIcon() icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/selectBud.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionSelectBudInMap.setIcon(icon5) self.actionSelectBudInMap.setObjectName(_fromUtf8("actionSelectBudInMap")) self.actionCuzkPage = QtWidgets.QAction(MainApp) icon6 = QtGui.QIcon() icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/cuzk.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionCuzkPage.setIcon(icon6) self.actionCuzkPage.setObjectName(_fromUtf8("actionCuzkPage")) self.actionShowInfoaboutSelection = QtWidgets.QAction(MainApp) self.actionShowInfoaboutSelection.setCheckable(True) icon7 = QtGui.QIcon() icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/showInfo.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionShowInfoaboutSelection.setIcon(icon7) self.actionShowInfoaboutSelection.setObjectName(_fromUtf8("actionShowInfoaboutSelection")) self.actionShowHelpPage = QtWidgets.QAction(MainApp) icon8 = QtGui.QIcon() icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/vfkPlugin.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionShowHelpPage.setIcon(icon8) self.actionShowHelpPage.setObjectName(_fromUtf8("actionShowHelpPage")) self.actionZpracujZmeny = QtWidgets.QAction(MainApp) self.actionZpracujZmeny.setCheckable(True) icon9 = QtGui.QIcon() icon9.addPixmap(QtGui.QPixmap(_fromUtf8(":/applyChanges.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionZpracujZmeny.setIcon(icon9) self.actionZpracujZmeny.setObjectName(_fromUtf8("actionZpracujZmeny")) self.retranslateUi(MainApp) self.stackedWidget.setCurrentIndex(0) self.searchForms.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainApp)
def setupUi(self, StereoDockWidget): StereoDockWidget.setObjectName("StereoDockWidget") StereoDockWidget.resize(434, 342) StereoDockWidget.setMinimumSize(QtCore.QSize(165, 200)) self.dockWidgetContents = QtWidgets.QWidget() self.dockWidgetContents.setObjectName("dockWidgetContents") self.groupBoxMainPath = dropedit(self.dockWidgetContents) self.groupBoxMainPath.setGeometry(QtCore.QRect(20, 10, 401, 45)) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.groupBoxMainPath.setFont(font) self.groupBoxMainPath.setObjectName("groupBoxMainPath") self.importLineProject = QtWidgets.QLineEdit(self.groupBoxMainPath) self.importLineProject.setGeometry(QtCore.QRect(40, 20, 311, 20)) font = QtGui.QFont() font.setBold(False) font.setWeight(50) self.importLineProject.setFont(font) self.importLineProject.setText("") self.importLineProject.setReadOnly(True) self.importLineProject.setObjectName("importLineProject") self.importToolProject = QtWidgets.QToolButton(self.groupBoxMainPath) self.importToolProject.setGeometry(QtCore.QRect(350, 20, 25, 19)) font = QtGui.QFont() font.setBold(False) font.setWeight(50) self.importToolProject.setFont(font) self.importToolProject.setObjectName("importToolProject") self.toolButtonEst = QtWidgets.QToolButton(self.dockWidgetContents) self.toolButtonEst.setEnabled(False) self.toolButtonEst.setGeometry(QtCore.QRect(350, 90, 66, 23)) self.toolButtonEst.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) self.toolButtonEst.setAutoRaise(False) self.toolButtonEst.setArrowType(QtCore.Qt.RightArrow) self.toolButtonEst.setObjectName("toolButtonEst") self.toolButtonOuest = QtWidgets.QToolButton(self.dockWidgetContents) self.toolButtonOuest.setEnabled(False) self.toolButtonOuest.setGeometry(QtCore.QRect(260, 90, 81, 23)) self.toolButtonOuest.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) self.toolButtonOuest.setAutoRaise(False) self.toolButtonOuest.setArrowType(QtCore.Qt.LeftArrow) self.toolButtonOuest.setObjectName("toolButtonOuest") self.toolButtonSud = QtWidgets.QToolButton(self.dockWidgetContents) self.toolButtonSud.setEnabled(False) self.toolButtonSud.setGeometry(QtCore.QRect(310, 120, 71, 23)) self.toolButtonSud.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) self.toolButtonSud.setAutoRaise(False) self.toolButtonSud.setArrowType(QtCore.Qt.DownArrow) self.toolButtonSud.setObjectName("toolButtonSud") self.toolButtonNord = QtWidgets.QToolButton(self.dockWidgetContents) self.toolButtonNord.setEnabled(False) self.toolButtonNord.setGeometry(QtCore.QRect(300, 60, 81, 23)) self.toolButtonNord.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon) self.toolButtonNord.setAutoRaise(False) self.toolButtonNord.setArrowType(QtCore.Qt.UpArrow) self.toolButtonNord.setObjectName("toolButtonNord") self.label_10 = QtWidgets.QLabel(self.dockWidgetContents) self.label_10.setGeometry(QtCore.QRect(10, 190, 111, 16)) self.label_10.setObjectName("label_10") self.pushButtonShowIDList = QtWidgets.QPushButton( self.dockWidgetContents) self.pushButtonShowIDList.setEnabled(False) self.pushButtonShowIDList.setGeometry(QtCore.QRect(290, 150, 101, 23)) self.pushButtonShowIDList.setObjectName("pushButtonShowIDList") self.enhanceButton = QtWidgets.QPushButton(self.dockWidgetContents) self.enhanceButton.setEnabled(False) self.enhanceButton.setGeometry(QtCore.QRect(30, 230, 71, 23)) self.enhanceButton.setCheckable(False) self.enhanceButton.setObjectName("enhanceButton") self.pushButtonShowPicture = QtWidgets.QPushButton( self.dockWidgetContents) self.pushButtonShowPicture.setEnabled(False) self.pushButtonShowPicture.setGeometry(QtCore.QRect(60, 270, 81, 23)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.pushButtonShowPicture.setFont(font) self.pushButtonShowPicture.setObjectName("pushButtonShowPicture") self.spinBoxRecouvrementH = QtWidgets.QSpinBox(self.dockWidgetContents) self.spinBoxRecouvrementH.setGeometry(QtCore.QRect(140, 190, 51, 22)) self.spinBoxRecouvrementH.setMaximum(100) self.spinBoxRecouvrementH.setProperty("value", 40) self.spinBoxRecouvrementH.setObjectName("spinBoxRecouvrementH") self.importLineVectorLayer = QtWidgets.QLineEdit( self.dockWidgetContents) self.importLineVectorLayer.setEnabled(True) self.importLineVectorLayer.setGeometry(QtCore.QRect(70, 130, 141, 20)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.importLineVectorLayer.setFont(font) self.importLineVectorLayer.setText("") self.importLineVectorLayer.setReadOnly(True) self.importLineVectorLayer.setObjectName("importLineVectorLayer") self.importToolVectorLayer = QtWidgets.QToolButton( self.dockWidgetContents) self.importToolVectorLayer.setGeometry(QtCore.QRect(210, 130, 25, 19)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.importToolVectorLayer.setFont(font) self.importToolVectorLayer.setObjectName("importToolVectorLayer") self.pushButtonRemoveShape = QtWidgets.QPushButton( self.dockWidgetContents) self.pushButtonRemoveShape.setEnabled(False) self.pushButtonRemoveShape.setGeometry(QtCore.QRect(10, 160, 91, 23)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.pushButtonRemoveShape.setFont(font) self.pushButtonRemoveShape.setObjectName("pushButtonRemoveShape") self.label_11 = QtWidgets.QLabel(self.dockWidgetContents) self.label_11.setGeometry(QtCore.QRect(10, 130, 71, 16)) self.label_11.setObjectName("label_11") self.groupBoxMNT = dropEventMNT(self.dockWidgetContents) self.groupBoxMNT.setGeometry(QtCore.QRect(210, 190, 201, 91)) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.groupBoxMNT.setFont(font) self.groupBoxMNT.setObjectName("groupBox") self.radioButtonDraw = QtWidgets.QRadioButton(self.groupBoxMNT) self.radioButtonDraw.setEnabled(False) self.radioButtonDraw.setGeometry(QtCore.QRect(20, 60, 71, 17)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.radioButtonDraw.setFont(font) self.radioButtonDraw.setChecked(True) self.radioButtonDraw.setEnabled(False) self.radioButtonDraw.setObjectName("radioButtonDraw") self.radioButtonCut = QtWidgets.QRadioButton(self.groupBoxMNT) self.radioButtonCut.setGeometry(QtCore.QRect(90, 60, 81, 17)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.radioButtonCut.setFont(font) self.radioButtonCut.setEnabled(False) self.radioButtonCut.setObjectName("radioButtonCut") self.importToolMNT = QtWidgets.QToolButton(self.groupBoxMNT) self.importToolMNT.setGeometry(QtCore.QRect(170, 20, 25, 19)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.importToolMNT.setFont(font) self.importToolMNT.setObjectName("importToolMNT") self.importLineMNT = QtWidgets.QLineEdit(self.groupBoxMNT) self.importLineMNT.setGeometry(QtCore.QRect(10, 20, 161, 20)) font = QtGui.QFont() font.setPointSize(8) font.setBold(False) font.setWeight(50) self.importLineMNT.setFont(font) self.importLineMNT.setText("") self.importLineMNT.setReadOnly(True) self.importLineMNT.setObjectName("importLineMNT") self.pushButtonOpenParam = QtWidgets.QPushButton( self.dockWidgetContents) self.pushButtonOpenParam.setGeometry(QtCore.QRect(110, 230, 75, 23)) self.pushButtonOpenParam.setObjectName("pushButtonOpenParam") self.labelRightName = QtWidgets.QLabel(self.dockWidgetContents) self.labelRightName.setGeometry(QtCore.QRect(110, 100, 141, 16)) self.labelRightName.setText("") self.labelRightName.setObjectName("labelRightName") self.labelLeftName = QtWidgets.QLabel(self.dockWidgetContents) self.labelLeftName.setGeometry(QtCore.QRect(110, 70, 141, 20)) self.labelLeftName.setText("") self.labelLeftName.setObjectName("labelLeftName") self.label = QtWidgets.QLabel(self.dockWidgetContents) self.label.setGeometry(QtCore.QRect(10, 70, 101, 16)) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.label.setFont(font) self.label.setObjectName("label") self.label_2 = QtWidgets.QLabel(self.dockWidgetContents) self.label_2.setGeometry(QtCore.QRect(10, 100, 101, 16)) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.label_2.setFont(font) self.label_2.setObjectName("label_2") StereoDockWidget.setWidget(self.dockWidgetContents) self.retranslateUi(StereoDockWidget) QtCore.QMetaObject.connectSlotsByName(StereoDockWidget)
def getimage(self, meshlayer, rendererContext): #initialize rendered image dimension DEBUG = False if DEBUG: self.debugtext = [] self.timestart = time.clock() painter = rendererContext.painter() self.__imageChangedMutex.lock() self.rendererContext = qgis.core.QgsRenderContext(rendererContext) self.rendererContext.setPainter(None) self.ext = self.rendererContext.extent() self.rect = [ float(self.ext.xMinimum()), float(self.ext.xMaximum()), float(self.ext.yMinimum()), float(self.ext.yMaximum()) ] if False: self.sizepx = painter.viewport().size( ) #size in pixel - notworking when printing else: ratio = 1.0 mupp = float(rendererContext.mapToPixel().mapUnitsPerPixel()) #self.sizepx = [ round(((rect[1] - rect[0] )/mupp/ratio),2) , round(((rect[3] - rect[2] )/mupp/ratio),2) ] self.sizepx = QtCore.QSize( int(((self.rect[1] - self.rect[0]) / mupp / ratio)), int(((self.rect[3] - self.rect[2]) / mupp / ratio))) self.dpi = rendererContext.painter().device().logicalDpiX() self.width = float((self.sizepx.width())) / float( self.dpi) #widht of canvas in inches self.lenght = float((self.sizepx.height())) / float( self.dpi) #height of canvas in inches #self.__img = None self.__imageChangedMutex.unlock() try: #*********************************************************************** #Case 1 : mapcanvas panned if (self.previousdrawrenderersizepx == self.sizepx and self.previousdrawtime == meshlayer.time_displayed and self.previousdrawparam == meshlayer.param_displayed and self.lvl_contour == self.previousdrawlvl and self.alpha_displayed == self.previousdrawalpha and self.previousdrawcmcontour == self.cmap_contour_raw and meshlayer.forcerefresh == False): if DEBUG: self.debugtext += [ 'deplacement : ' + str(round(time.clock() - self.timestart, 3)) ] if self.alreadypanned: #the whole mesh has been regenerated img1, img2 = self.canvasPaned() else: #maybe working with case 2 : need t oregenerate the whole mesh img1, img2 = self.canvasCreation() self.alreadypanned = True #Case 2 : figure changed (time,param) with the same mapcanvas dimension elif self.previousdrawrenderersizepx == self.sizepx and meshlayer.forcerefresh == False: #update meshlayer parameters self.previousdrawparam = meshlayer.param_displayed self.previousdrawlvl = self.lvl_contour self.previousdrawtime = meshlayer.time_displayed self.previousdrawalpha = self.alpha_displayed self.previousdrawrenderersizepx = self.sizepx self.previousdrawcmcontour = self.cmap_contour_raw self.alreadypanned = False if DEBUG: self.debugtext += [ 'paramchanged : ' + str(round(time.clock() - self.timestart, 3)) ] img1, img2 = self.canvasChangedWithSameBBox() #*********************************************************************** #Case 3 : new figure else: #update meshlayer parameters self.previousdrawparam = meshlayer.param_displayed self.previousdrawlvl = self.lvl_contour self.previousdrawtime = meshlayer.time_displayed self.previousdrawalpha = self.alpha_displayed self.previousdrawrenderersizepx = self.sizepx self.previousdrawcmcontour = self.cmap_contour_raw self.alreadypanned = False if self.meshlayer.forcerefresh == True: self.meshlayer.forcerefresh = False if DEBUG: self.debugtext += [ 'new fig : ' + str(round(time.clock() - self.timestart, 3)) ] img1, img2 = self.canvasCreation() if DEBUG: self.debugtext += [ 'fin : ' + str(round(time.clock() - self.timestart, 3)) ] if DEBUG: self.meshlayer.propertiesdialog.textBrowser_2.append( str(self.debugtext)) return (True, img1, img2) except Exception as e: meshlayer.propertiesdialog.textBrowser_2.append( 'Get rendered image : ' + str(e)) return (False, QtGui.QImage(), QtGui.QImage())
def set_size(w, h): self.setMaximumSize(QtCore.QSize(w, h)) self.resize(w, h)
def get_qgis_app(): """ Start one QGIS application to test against. :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFload_standard_layersACE, PARENT) If QGIS is already running the handle to that app will be returned. """ try: from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas # pylint: disable=no-name-in-module # noinspection PyPackageRequirements from qgis.PyQt import QtGui, QtCore # pylint: disable=W0621 # noinspection PyPackageRequirements from qgis.PyQt.QtCore import QCoreApplication, QSettings from qgis.gui import QgisInterface except ImportError: return None, None, None, None global QGIS_APP # pylint: disable=W0603 if QGIS_APP is None: gui_flag = True # All test will run qgis in gui mode # AG: For testing purposes, we use our own configuration file instead # of using the QGIS apps conf of the host # noinspection PyCallByClass,PyArgumentList QCoreApplication.setOrganizationName('QGIS') # noinspection PyCallByClass,PyArgumentList QCoreApplication.setOrganizationDomain('qgis.org') # noinspection PyCallByClass,PyArgumentList QCoreApplication.setApplicationName('IsochronesTesting') # noinspection PyPep8Naming QGIS_APP = QgsApplication(sys.argv, gui_flag) # Make sure QGIS_PREFIX_PATH is set in your env if needed! QGIS_APP.initQgis() s = QGIS_APP.showSettings() # Save some settings settings = QSettings() settings.setValue('locale/overrideFlag', True) settings.setValue('locale/userLocale', 'en_US') # We disabled message bars for now for extent selector as # we don't have a main window to show them in TS - version 3.2 global PARENT # pylint: disable=W0603 if PARENT is None: # noinspection PyPep8Naming PARENT = QtGui.QWidget() global CANVAS # pylint: disable=W0603 if CANVAS is None: # noinspection PyPep8Naming CANVAS = QgsMapCanvas(PARENT) CANVAS.resize(QtCore.QSize(400, 400)) global IFACE # pylint: disable=W0603 if IFACE is None: # QgisInterface is a stub implementation of the QGIS plugin interface # noinspection PyPep8Naming IFACE = QgisInterface(CANVAS) return QGIS_APP, CANVAS, IFACE, PARENT
def get_qgis_app(requested_locale='en_US', qsetting=''): """ Start one QGIS application to test against. :param locale: The locale we want the qgis to launch with. :type locale: str :param qsetting: String to specify the QSettings. By default, use empty string. :type qsetting: str :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFACE, PARENT) If QGIS is already running the handle to that app will be returned. """ global QGIS_APP, PARENT, IFACE, CANVAS # pylint: disable=W0603 from qgis.PyQt.QtCore import QSettings if qsetting: settings = QSettings(qsetting) else: settings = QSettings() default_user_directory = setting('defaultUserDirectory') current_locale = general_setting( 'locale/userLocale', default='en_US', qsettings=settings) locale_match = current_locale == requested_locale if iface and locale_match: from qgis.core import QgsApplication QGIS_APP = QgsApplication CANVAS = iface.mapCanvas() PARENT = iface.mainWindow() IFACE = iface try: from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas # pylint: disable=no-name-in-module # noinspection PyPackageRequirements from qgis.PyQt import QtWidgets, QtCore # pylint: disable=W0621 # noinspection PyPackageRequirements from qgis.PyQt.QtCore import QCoreApplication, QSettings from safe.test.qgis_interface import QgisInterface except ImportError: return None, None, None, None if qsetting: settings = QSettings(qsetting) else: settings = QSettings() if not QGIS_APP: gui_flag = True # All test will run qgis in gui mode # AG: For testing purposes, we use our own configuration file # instead of using the QGIS apps conf of the host # noinspection PyCallByClass,PyArgumentList QCoreApplication.setOrganizationName('QGIS') # noinspection PyCallByClass,PyArgumentList QCoreApplication.setOrganizationDomain('qgis.org') # noinspection PyCallByClass,PyArgumentList QCoreApplication.setApplicationName('QGIS2InaSAFETesting') # We disabled message bars for now for extent selector as # we don't have a main window to show them in TS - version 3.2 set_setting('show_extent_warnings', False, settings) set_setting('showRubberBands', True, settings) set_setting('show_extent_confirmations', False, settings) set_setting('analysis_extents_mode', HAZARD_EXPOSURE, settings) if default_user_directory: set_setting( 'defaultUserDirectory', default_user_directory, settings) # noinspection PyPep8Naming if 'argv' in dir(sys): QGIS_APP = QgsApplication([p.encode('utf-8') for p in sys.argv], gui_flag) else: QGIS_APP = QgsApplication([], gui_flag) # Make sure QGIS_PREFIX_PATH is set in your env if needed! QGIS_APP.initQgis() # Initialize processing processing.Processing.initialize() s = QGIS_APP.showSettings() LOGGER.debug(s) if not locale_match: """Setup internationalisation for the plugin.""" # Save some settings set_general_setting('locale/overrideFlag', True, settings) set_general_setting('locale/userLocale', requested_locale, settings) locale_name = str(requested_locale).split('_')[0] # Also set the system locale to the user overridden local # so that the inasafe library functions gettext will work # .. see:: :py:func:`common.utilities` os.environ['LANG'] = str(locale_name) inasafe_translation_path = os.path.join( safe_dir('i18n'), 'inasafe_' + str(locale_name) + '.qm') if os.path.exists(inasafe_translation_path): if isinstance(QGIS_APP, sip.wrappertype): translator = QTranslator() else: translator = QTranslator(QGIS_APP) result = translator.load(inasafe_translation_path) if not result: message = 'Failed to load translation for %s' % locale_name raise Exception(message) # noinspection PyTypeChecker,PyCallByClass QCoreApplication.installTranslator(translator) # at the end, reload InaSAFE modules so it will get translated too reload_inasafe_modules() if PARENT is None: # noinspection PyPep8Naming PARENT = QtWidgets.QWidget() if CANVAS is None: # noinspection PyPep8Naming CANVAS = QgsMapCanvas(PARENT) CANVAS.resize(QtCore.QSize(400, 400)) if IFACE is None: # QgisInterface is a stub implementation of the QGIS plugin interface # noinspection PyPep8Naming IFACE = QgisInterface(CANVAS) return QGIS_APP, CANVAS, IFACE, PARENT
def sizehint(self, option, index): return qcore.QSize(100, 100)
def setupUi(self, DsgRasterInfoTool): DsgRasterInfoTool.setObjectName(_fromUtf8("DsgRasterInfoTool")) DsgRasterInfoTool.resize(309, 49) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(DsgRasterInfoTool.sizePolicy().hasHeightForWidth()) DsgRasterInfoTool.setSizePolicy(sizePolicy) DsgRasterInfoTool.setMinimumSize(QtCore.QSize(0, 20)) DsgRasterInfoTool.setMaximumSize(QtCore.QSize(468, 50)) DsgRasterInfoTool.setToolTip(_fromUtf8("")) self.gridLayout = QtWidgets.QGridLayout(DsgRasterInfoTool) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.rasterInfoPushButton = QtWidgets.QPushButton(DsgRasterInfoTool) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.rasterInfoPushButton.sizePolicy().hasHeightForWidth()) self.rasterInfoPushButton.setSizePolicy(sizePolicy) self.rasterInfoPushButton.setMinimumSize(QtCore.QSize(16, 16)) self.rasterInfoPushButton.setMaximumSize(QtCore.QSize(24, 24)) self.rasterInfoPushButton.setText(_fromUtf8("")) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/DsgTools/icons/rasterToolTip.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.rasterInfoPushButton.setIcon(icon) self.rasterInfoPushButton.setIconSize(QtCore.QSize(16, 16)) self.rasterInfoPushButton.setCheckable(True) self.rasterInfoPushButton.setObjectName(_fromUtf8("rasterInfoPushButton")) self.gridLayout.addWidget(self.rasterInfoPushButton, 0, 0, 1, 1) self.splitter = QtWidgets.QSplitter(DsgRasterInfoTool) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName(_fromUtf8("splitter")) self.rasterComboBox = QgsMapLayerComboBox(self.splitter) self.rasterComboBox.setFilters(QgsMapLayerProxyModel.RasterLayer) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.rasterComboBox.sizePolicy().hasHeightForWidth()) self.rasterComboBox.setSizePolicy(sizePolicy) self.rasterComboBox.setMinimumSize(QtCore.QSize(0, 20)) self.rasterComboBox.setMaximumSize(QtCore.QSize(16777215, 24)) self.rasterComboBox.setObjectName(_fromUtf8("rasterComboBox")) self.bandTooltipButton = QtWidgets.QPushButton(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.bandTooltipButton.sizePolicy().hasHeightForWidth()) self.bandTooltipButton.setSizePolicy(sizePolicy) self.bandTooltipButton.setMinimumSize(QtCore.QSize(16, 16)) self.bandTooltipButton.setMaximumSize(QtCore.QSize(24, 24)) self.bandTooltipButton.setToolTip(_fromUtf8("Show raster tooltip")) self.bandTooltipButton.setText(_fromUtf8("")) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/DsgTools/icons/band_tooltip.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.bandTooltipButton.setIcon(icon1) self.bandTooltipButton.setIconSize(QtCore.QSize(16, 16)) self.bandTooltipButton.setCheckable(True) self.bandTooltipButton.setObjectName(_fromUtf8("bandTooltipButton")) self.dynamicHistogramButton = QtWidgets.QPushButton(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.dynamicHistogramButton.sizePolicy().hasHeightForWidth()) self.dynamicHistogramButton.setSizePolicy(sizePolicy) self.dynamicHistogramButton.setMinimumSize(QtCore.QSize(16, 16)) self.dynamicHistogramButton.setMaximumSize(QtCore.QSize(24, 24)) self.dynamicHistogramButton.setToolTip(_fromUtf8("Dynamic histogram view")) self.dynamicHistogramButton.setText(_fromUtf8("")) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/DsgTools/icons/dynamic_histogram_viewer.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.dynamicHistogramButton.setIcon(icon2) self.dynamicHistogramButton.setIconSize(QtCore.QSize(16,16)) self.dynamicHistogramButton.setCheckable(True) self.dynamicHistogramButton.setObjectName(_fromUtf8("dynamicHistogramButton")) self.gridLayout.addWidget(self.splitter, 0, 1, 1, 1) self.valueSetterButton = QtWidgets.QPushButton(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.valueSetterButton.sizePolicy().hasHeightForWidth()) self.valueSetterButton.setSizePolicy(sizePolicy) self.valueSetterButton.setMinimumSize(QtCore.QSize(16, 16)) self.valueSetterButton.setMaximumSize(QtCore.QSize(24, 24)) self.valueSetterButton.setToolTip(_fromUtf8("Set Value From Raster")) self.valueSetterButton.setText(_fromUtf8("")) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/DsgTools/icons/valueSetter.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.valueSetterButton.setIcon(icon2) self.valueSetterButton.setIconSize(QtCore.QSize(40, 40)) self.valueSetterButton.setCheckable(True) self.valueSetterButton.setObjectName(_fromUtf8("valueSetterButton")) self.gridLayout.addWidget(self.splitter, 0, 2, 1, 1) self.retranslateUi(DsgRasterInfoTool) QtCore.QMetaObject.connectSlotsByName(DsgRasterInfoTool)
def minimumSizeHint(self): return QtCore.QSize(50, super().minimumSizeHint().height())
def get_qgis_app(requested_locale='en_US', qsetting=''): """ Start one QGIS application to test against. :param locale: The locale we want the qgis to launch with. :type locale: str :param qsetting: String to specify the QSettings. By default, use empty string. :type qsetting: str :returns: Handle to QGIS app, canvas, iface and parent. If there are any errors the tuple members will be returned as None. :rtype: (QgsApplication, CANVAS, IFACE, PARENT) If QGIS is already running the handle to that app will be returned. """ global QGIS_APP, PARENT, IFACE, CANVAS # pylint: disable=W0603 from qgis.PyQt.QtCore import QSettings if qsetting: settings = QSettings(qsetting) else: settings = QSettings() try: current_locale = settings.value( 'locale/userLocale', 'en_US') except TypeError as e: pass locale_match = current_locale == requested_locale if iface and locale_match: from qgis.core import QgsApplication QGIS_APP = QgsApplication CANVAS = iface.mapCanvas() PARENT = iface.mainWindow() IFACE = iface try: from qgis.core import QgsApplication from qgis.gui import QgsMapCanvas # pylint: disable=no-name-in-module # noinspection PyPackageRequirements from qgis.PyQt import QtWidgets, QtCore # pylint: disable=W0621 # noinspection PyPackageRequirements from qgis.PyQt.QtCore import QCoreApplication, QSettings except ImportError: return None, None, None, None if not QGIS_APP: gui_flag = True # All test will run qgis in gui mode # AG: For testing purposes, we use our own configuration file # instead of using the QGIS apps conf of the host # noinspection PyCallByClass,PyArgumentList QCoreApplication.setOrganizationName('QGIS') # noinspection PyCallByClass,PyArgumentList QCoreApplication.setOrganizationDomain('qgis.org') # noinspection PyCallByClass,PyArgumentList QCoreApplication.setApplicationName('QGIS3Testing') # noinspection PyPep8Naming if 'argv' in dir(sys): QGIS_APP = QgsApplication([p.encode('utf-8') for p in sys.argv], gui_flag) else: QGIS_APP = QgsApplication([], gui_flag) # Make sure QGIS_PREFIX_PATH is set in your env if needed! QGIS_APP.initQgis() s = QGIS_APP.showSettings() LOGGER.debug(s) if not locale_match: """Setup internationalisation for the plugin.""" if not settings: settings = QSettings() settings.setValue('locale/userLocale', deep_convert_dict( requested_locale)) locale_name = str(requested_locale).split('_')[0] os.environ['LANG'] = str(locale_name) i18n_path = os.path.join( os.path.dirname(__file__), '../') i18n_path = os.path.join(i18n_path, 'i18n') translation_path = os.path.join( i18n_path, '_' + str(locale_name) + '.qm') if os.path.exists(translation_path): if isinstance(QGIS_APP, sip.wrappertype): translator = QTranslator() else: translator = QTranslator(QGIS_APP) result = translator.load(translation_path) if not result: message = 'Failed to load translation for %s' % locale_name raise Exception(message) # noinspection PyTypeChecker,PyCallByClass QCoreApplication.installTranslator(translator) if PARENT is None: # noinspection PyPep8Naming PARENT = QtWidgets.QWidget() if CANVAS is None: # noinspection PyPep8Naming CANVAS = QgsMapCanvas(PARENT) CANVAS.resize(QtCore.QSize(400, 400)) return QGIS_APP, CANVAS, IFACE, PARENT
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.setEnabled(True) Dialog.resize(627, 490) Dialog.setFocusPolicy(QtCore.Qt.NoFocus) Dialog.setContextMenuPolicy(QtCore.Qt.NoContextMenu) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/icons/tableManagerIcon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) Dialog.setWindowIcon(icon) Dialog.setSizeGripEnabled(True) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.tabWidget = QtWidgets.QTabWidget(Dialog) self.tabWidget.setMinimumSize(QtCore.QSize(0, 0)) self.tabWidget.setAutoFillBackground(True) self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded) self.tabWidget.setElideMode(QtCore.Qt.ElideNone) self.tabWidget.setUsesScrollButtons(False) self.tabWidget.setObjectName(_fromUtf8("tabWidget")) self.tab_1 = QtWidgets.QWidget() self.tab_1.setObjectName(_fromUtf8("tab_1")) self.gridlayout = QtWidgets.QGridLayout(self.tab_1) self.gridlayout.setObjectName(_fromUtf8("gridlayout")) self.fieldsTable = QtWidgets.QTableWidget(self.tab_1) self.fieldsTable.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.fieldsTable.sizePolicy().hasHeightForWidth()) self.fieldsTable.setSizePolicy(sizePolicy) self.fieldsTable.setMinimumSize(QtCore.QSize(0, 280)) self.fieldsTable.setFocusPolicy(QtCore.Qt.WheelFocus) self.fieldsTable.setEditTriggers(QtWidgets.QAbstractItemView.AnyKeyPressed|QtWidgets.QAbstractItemView.DoubleClicked|QtWidgets.QAbstractItemView.EditKeyPressed) self.fieldsTable.setDragDropMode(QtWidgets.QAbstractItemView.NoDragDrop) self.fieldsTable.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) self.fieldsTable.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.fieldsTable.setGridStyle(QtCore.Qt.DotLine) self.fieldsTable.setWordWrap(False) self.fieldsTable.setCornerButtonEnabled(False) self.fieldsTable.setRowCount(0) self.fieldsTable.setColumnCount(2) self.fieldsTable.setObjectName(_fromUtf8("fieldsTable")) item = QtWidgets.QTableWidgetItem() self.fieldsTable.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.fieldsTable.setHorizontalHeaderItem(1, item) self.gridlayout.addWidget(self.fieldsTable, 0, 0, 1, 1) self.vboxlayout = QtWidgets.QVBoxLayout() self.vboxlayout.setObjectName(_fromUtf8("vboxlayout")) self.butUp = QtWidgets.QToolButton(self.tab_1) self.butUp.setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.butUp.sizePolicy().hasHeightForWidth()) self.butUp.setSizePolicy(sizePolicy) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/crystalsvg_1uparrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butUp.setIcon(icon1) self.butUp.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.butUp.setObjectName(_fromUtf8("butUp")) self.vboxlayout.addWidget(self.butUp) self.butDown = QtWidgets.QToolButton(self.tab_1) self.butDown.setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.butDown.sizePolicy().hasHeightForWidth()) self.butDown.setSizePolicy(sizePolicy) self.butDown.setMinimumSize(QtCore.QSize(120, 0)) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/crystalsvg_1downarrow.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butDown.setIcon(icon2) self.butDown.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.butDown.setObjectName(_fromUtf8("butDown")) self.vboxlayout.addWidget(self.butDown) self.butRename = QtWidgets.QToolButton(self.tab_1) self.butRename.setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.butRename.sizePolicy().hasHeightForWidth()) self.butRename.setSizePolicy(sizePolicy) icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/tableManagerIcon3.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butRename.setIcon(icon3) self.butRename.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.butRename.setObjectName(_fromUtf8("butRename")) self.vboxlayout.addWidget(self.butRename) self.butIns = QtWidgets.QToolButton(self.tab_1) self.butIns.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.butIns.sizePolicy().hasHeightForWidth()) self.butIns.setSizePolicy(sizePolicy) icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/mActionNewAttribute.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butIns.setIcon(icon4) self.butIns.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.butIns.setObjectName(_fromUtf8("butIns")) self.vboxlayout.addWidget(self.butIns) self.butClone = QtWidgets.QToolButton(self.tab_1) self.butClone.setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.butClone.sizePolicy().hasHeightForWidth()) self.butClone.setSizePolicy(sizePolicy) icon5 = QtGui.QIcon() icon5.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/mActionCopySelected.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butClone.setIcon(icon5) self.butClone.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.butClone.setObjectName(_fromUtf8("butClone")) self.vboxlayout.addWidget(self.butClone) spacerItem = QtWidgets.QSpacerItem(20, 24, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.vboxlayout.addItem(spacerItem) self.butDel = QtWidgets.QToolButton(self.tab_1) self.butDel.setEnabled(False) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.butDel.sizePolicy().hasHeightForWidth()) self.butDel.setSizePolicy(sizePolicy) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(150, 147, 145)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) self.butDel.setPalette(palette) icon6 = QtGui.QIcon() icon6.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/mActionDeleteAttribute.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butDel.setIcon(icon6) self.butDel.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.butDel.setObjectName(_fromUtf8("butDel")) self.vboxlayout.addWidget(self.butDel) spacerItem1 = QtWidgets.QSpacerItem(120, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.vboxlayout.addItem(spacerItem1) self.gridlayout.addLayout(self.vboxlayout, 0, 1, 1, 1) self.tabWidget.addTab(self.tab_1, _fromUtf8("")) self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) self.gridlayout1 = QtWidgets.QGridLayout(self.tab_2) self.gridlayout1.setObjectName(_fromUtf8("gridlayout1")) self.dataTable = QtWidgets.QTableWidget(self.tab_2) self.dataTable.setEnabled(True) self.dataTable.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) self.dataTable.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectColumns) self.dataTable.setGridStyle(QtCore.Qt.DotLine) self.dataTable.setWordWrap(False) self.dataTable.setCornerButtonEnabled(False) self.dataTable.setObjectName(_fromUtf8("dataTable")) self.dataTable.setColumnCount(0) self.dataTable.setRowCount(0) self.gridlayout1.addWidget(self.dataTable, 0, 0, 1, 1) self.tabWidget.addTab(self.tab_2, _fromUtf8("")) self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName(_fromUtf8("tab_3")) self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab_3) self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_2.addItem(spacerItem2) self.label = QtWidgets.QLabel(self.tab_3) self.label.setWordWrap(True) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout_2.addWidget(self.label) spacerItem3 = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_2.addItem(spacerItem3) self.label_2 = QtWidgets.QLabel(self.tab_3) self.label_2.setWordWrap(True) self.label_2.setObjectName(_fromUtf8("label_2")) self.verticalLayout_2.addWidget(self.label_2) spacerItem4 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) self.verticalLayout_2.addItem(spacerItem4) self.cbWarning = QtWidgets.QCheckBox(self.tab_3) self.cbWarning.setChecked(True) self.cbWarning.setObjectName(_fromUtf8("cbWarning")) self.verticalLayout_2.addWidget(self.cbWarning) spacerItem5 = QtWidgets.QSpacerItem(20, 272, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem5) self.tabWidget.addTab(self.tab_3, _fromUtf8("")) self.verticalLayout.addWidget(self.tabWidget) self.hboxlayout = QtWidgets.QHBoxLayout() self.hboxlayout.setObjectName(_fromUtf8("hboxlayout")) spacerItem6 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.hboxlayout.addItem(spacerItem6) self.progressBar = QtWidgets.QProgressBar(Dialog) self.progressBar.setEnabled(True) self.progressBar.setAlignment(QtCore.Qt.AlignHCenter) self.progressBar.setTextVisible(True) self.progressBar.setOrientation(QtCore.Qt.Horizontal) self.progressBar.setInvertedAppearance(False) self.progressBar.setTextDirection(QtWidgets.QProgressBar.TopToBottom) self.progressBar.setFormat(_fromUtf8("")) self.progressBar.setObjectName(_fromUtf8("progressBar")) self.hboxlayout.addWidget(self.progressBar) spacerItem7 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.hboxlayout.addItem(spacerItem7) self.butSave = QtWidgets.QPushButton(Dialog) self.butSave.setEnabled(False) self.butSave.setMinimumSize(QtCore.QSize(0, 32)) palette = QtGui.QPalette() self.butSave.setPalette(palette) self.butSave.setStatusTip(_fromUtf8("")) self.butSave.setWhatsThis(_fromUtf8("")) self.butSave.setAccessibleDescription(_fromUtf8("")) icon7 = QtGui.QIcon() icon7.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/mActionFileSave.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butSave.setIcon(icon7) self.butSave.setObjectName(_fromUtf8("butSave")) self.hboxlayout.addWidget(self.butSave) self.butSaveAs = QtWidgets.QPushButton(Dialog) self.butSaveAs.setEnabled(False) self.butSaveAs.setMinimumSize(QtCore.QSize(0, 32)) icon8 = QtGui.QIcon() icon8.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/tableManager/dialog/icons/mActionFileSaveAs.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.butSaveAs.setIcon(icon8) self.butSaveAs.setObjectName(_fromUtf8("butSaveAs")) self.hboxlayout.addWidget(self.butSaveAs) spacerItem8 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.hboxlayout.addItem(spacerItem8) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.buttonBox.setEnabled(True) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth()) self.buttonBox.setSizePolicy(sizePolicy) self.buttonBox.setMinimumSize(QtCore.QSize(0, 32)) self.buttonBox.setLayoutDirection(QtCore.Qt.LeftToRight) self.buttonBox.setAutoFillBackground(False) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) self.buttonBox.setCenterButtons(False) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.hboxlayout.addWidget(self.buttonBox) spacerItem9 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.hboxlayout.addItem(spacerItem9) self.verticalLayout.addLayout(self.hboxlayout) self.retranslateUi(Dialog) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(Dialog) Dialog.setTabOrder(self.buttonBox, self.tabWidget) Dialog.setTabOrder(self.tabWidget, self.fieldsTable) Dialog.setTabOrder(self.fieldsTable, self.butUp) Dialog.setTabOrder(self.butUp, self.butDown) Dialog.setTabOrder(self.butDown, self.butRename) Dialog.setTabOrder(self.butRename, self.butIns) Dialog.setTabOrder(self.butIns, self.butClone) Dialog.setTabOrder(self.butClone, self.butDel) Dialog.setTabOrder(self.butDel, self.dataTable) Dialog.setTabOrder(self.dataTable, self.butSaveAs) Dialog.setTabOrder(self.butSaveAs, self.butSave)
def setupUi(self, ImportProject): ImportProject.setObjectName(_fromUtf8("ImportProject")) ImportProject.resize(480, 596) self.gridLayout = QtGui.QGridLayout(ImportProject) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.buttonBox = QtGui.QDialogButtonBox(ImportProject) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1) self.groupBox = QtGui.QGroupBox(ImportProject) self.groupBox.setFlat(False) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.gridLayout_2 = QtGui.QGridLayout(self.groupBox) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.gridLayout_4 = QtGui.QGridLayout() self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) self.lineEditInputFile = QtGui.QLineEdit(self.groupBox) self.lineEditInputFile.setText(_fromUtf8("")) self.lineEditInputFile.setObjectName(_fromUtf8("lineEditInputFile")) self.gridLayout_4.addWidget(self.lineEditInputFile, 0, 2, 1, 1) self.label = QtGui.QLabel(self.groupBox) self.label.setMinimumSize(QtCore.QSize(0, 27)) self.label.setObjectName(_fromUtf8("label")) self.gridLayout_4.addWidget(self.label, 0, 0, 1, 1) self.btnBrowseInputFile = QtGui.QPushButton(self.groupBox) self.btnBrowseInputFile.setObjectName(_fromUtf8("btnBrowseInputFile")) self.gridLayout_4.addWidget(self.btnBrowseInputFile, 0, 3, 1, 1) self.lblProjectName = QtGui.QLabel(self.groupBox) self.lblProjectName.setMinimumSize(QtCore.QSize(0, 27)) self.lblProjectName.setObjectName(_fromUtf8("lblProjectName")) self.gridLayout_4.addWidget(self.lblProjectName, 4, 0, 1, 1) self.lineEditDbSchema = QtGui.QLineEdit(self.groupBox) self.lineEditDbSchema.setText(_fromUtf8("")) self.lineEditDbSchema.setObjectName(_fromUtf8("lineEditDbSchema")) self.gridLayout_4.addWidget(self.lineEditDbSchema, 4, 2, 1, 1) self.btnProjectName = QtGui.QPushButton(self.groupBox) self.btnProjectName.setEnabled(True) self.btnProjectName.setObjectName(_fromUtf8("btnProjectName")) self.gridLayout_4.addWidget(self.btnProjectName, 4, 3, 1, 1) self.dateTimeEdit = QtGui.QDateTimeEdit(self.groupBox) self.dateTimeEdit.setObjectName(_fromUtf8("dateTimeEdit")) self.gridLayout_4.addWidget(self.dateTimeEdit, 6, 2, 1, 1) self.label_3 = QtGui.QLabel(self.groupBox) self.label_3.setMinimumSize(QtCore.QSize(0, 27)) self.label_3.setObjectName(_fromUtf8("label_3")) self.gridLayout_4.addWidget(self.label_3, 6, 0, 1, 1) self.label_5 = QtGui.QLabel(self.groupBox) self.label_5.setMinimumSize(QtCore.QSize(0, 27)) self.label_5.setObjectName(_fromUtf8("label_5")) self.gridLayout_4.addWidget(self.label_5, 3, 0, 1, 1) self.lineEditRefFrame = QtGui.QLineEdit(self.groupBox) self.lineEditRefFrame.setEnabled(False) self.lineEditRefFrame.setObjectName(_fromUtf8("lineEditRefFrame")) self.gridLayout_4.addWidget(self.lineEditRefFrame, 3, 2, 1, 1) self.cmbBoxAppModule = QtGui.QComboBox(self.groupBox) self.cmbBoxAppModule.setEnabled(True) self.cmbBoxAppModule.setObjectName(_fromUtf8("cmbBoxAppModule")) self.gridLayout_4.addWidget(self.cmbBoxAppModule, 1, 2, 1, 1) self.label_6 = QtGui.QLabel(self.groupBox) self.label_6.setMinimumSize(QtCore.QSize(0, 27)) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1) self.cmbBoxIliModelName = QtGui.QComboBox(self.groupBox) self.cmbBoxIliModelName.setObjectName(_fromUtf8("cmbBoxIliModelName")) self.gridLayout_4.addWidget(self.cmbBoxIliModelName, 2, 2, 1, 1) self.label_7 = QtGui.QLabel(self.groupBox) self.label_7.setObjectName(_fromUtf8("label_7")) self.gridLayout_4.addWidget(self.label_7, 2, 0, 1, 1) self.gridLayout_2.addLayout(self.gridLayout_4, 0, 0, 1, 1) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.label_4 = QtGui.QLabel(self.groupBox) self.label_4.setObjectName(_fromUtf8("label_4")) self.verticalLayout.addWidget(self.label_4) self.textEditImportOutput = QtGui.QPlainTextEdit(self.groupBox) font = QtGui.QFont() font.setPointSize(8) self.textEditImportOutput.setFont(font) self.textEditImportOutput.setLayoutDirection(QtCore.Qt.LeftToRight) self.textEditImportOutput.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap) self.textEditImportOutput.setReadOnly(True) self.textEditImportOutput.setObjectName( _fromUtf8("textEditImportOutput")) self.verticalLayout.addWidget(self.textEditImportOutput) self.gridLayout_2.addLayout(self.verticalLayout, 2, 0, 1, 1) self.verticalLayout_2 = QtGui.QVBoxLayout() self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.label_2 = QtGui.QLabel(self.groupBox) self.label_2.setObjectName(_fromUtf8("label_2")) self.verticalLayout_2.addWidget(self.label_2) self.textEditNotes = QtGui.QPlainTextEdit(self.groupBox) self.textEditNotes.setObjectName(_fromUtf8("textEditNotes")) self.verticalLayout_2.addWidget(self.textEditNotes) self.gridLayout_2.addLayout(self.verticalLayout_2, 1, 0, 1, 1) self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1) self.retranslateUi(ImportProject) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), ImportProject.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), ImportProject.reject) QtCore.QMetaObject.connectSlotsByName(ImportProject)
def setupUi(self, Autocorrelation): Autocorrelation.setObjectName(_fromUtf8("Autocorrelation")) Autocorrelation.setWindowModality(QtCore.Qt.NonModal) Autocorrelation.resize(674, 462) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( Autocorrelation.sizePolicy().hasHeightForWidth()) Autocorrelation.setSizePolicy(sizePolicy) Autocorrelation.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu) self.verticalLayout = QtGui.QVBoxLayout(Autocorrelation) self.verticalLayout.setSizeConstraint( QtGui.QLayout.SetDefaultConstraint) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.formLayout = QtGui.QFormLayout() self.formLayout.setFieldGrowthPolicy( QtGui.QFormLayout.AllNonFixedFieldsGrow) self.formLayout.setObjectName(_fromUtf8("formLayout")) self.label = QtGui.QLabel(Autocorrelation) self.label.setObjectName(_fromUtf8("label")) self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label) self.cbx_aggregation_layer = QgsMapLayerComboBox(Autocorrelation) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.cbx_aggregation_layer.sizePolicy().hasHeightForWidth()) self.cbx_aggregation_layer.setSizePolicy(sizePolicy) self.cbx_aggregation_layer.setObjectName( _fromUtf8("cbx_aggregation_layer")) self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.cbx_aggregation_layer) self.label_4 = QtGui.QLabel(Autocorrelation) self.label_4.setObjectName(_fromUtf8("label_4")) self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_4) self.cbx_indicator_field = QgsFieldComboBox(Autocorrelation) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.cbx_indicator_field.sizePolicy().hasHeightForWidth()) self.cbx_indicator_field.setSizePolicy(sizePolicy) self.cbx_indicator_field.setObjectName( _fromUtf8("cbx_indicator_field")) self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.cbx_indicator_field) self.horizontalLayout_6 = QtGui.QHBoxLayout() self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) self.le_output_filepath = QtGui.QLineEdit(Autocorrelation) self.le_output_filepath.setObjectName(_fromUtf8("le_output_filepath")) self.horizontalLayout_6.addWidget(self.le_output_filepath) self.button_browse = QtGui.QPushButton(Autocorrelation) self.button_browse.setObjectName(_fromUtf8("button_browse")) self.horizontalLayout_6.addWidget(self.button_browse) self.formLayout.setLayout(12, QtGui.QFormLayout.FieldRole, self.horizontalLayout_6) self.label_3 = QtGui.QLabel(Autocorrelation) self.label_3.setObjectName(_fromUtf8("label_3")) self.formLayout.setWidget(8, QtGui.QFormLayout.LabelRole, self.label_3) self.cbx_contiguity = QtGui.QComboBox(Autocorrelation) self.cbx_contiguity.setEnabled(True) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.cbx_contiguity.sizePolicy().hasHeightForWidth()) self.cbx_contiguity.setSizePolicy(sizePolicy) self.cbx_contiguity.setMinimumSize(QtCore.QSize(104, 0)) self.cbx_contiguity.setObjectName(_fromUtf8("cbx_contiguity")) self.cbx_contiguity.addItem(_fromUtf8("")) self.cbx_contiguity.addItem(_fromUtf8("")) self.formLayout.setWidget(8, QtGui.QFormLayout.FieldRole, self.cbx_contiguity) self.label_8 = QtGui.QLabel(Autocorrelation) self.label_8.setObjectName(_fromUtf8("label_8")) self.formLayout.setWidget(12, QtGui.QFormLayout.LabelRole, self.label_8) self.verticalLayout.addLayout(self.formLayout) self.button_box_ok = QtGui.QDialogButtonBox(Autocorrelation) self.button_box_ok.setOrientation(QtCore.Qt.Horizontal) self.button_box_ok.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.button_box_ok.setObjectName(_fromUtf8("button_box_ok")) self.verticalLayout.addWidget(self.button_box_ok) self.retranslateUi(Autocorrelation) QtCore.QObject.connect( self.cbx_aggregation_layer, QtCore.SIGNAL(_fromUtf8("layerChanged(QgsMapLayer*)")), self.cbx_indicator_field.setLayer) QtCore.QMetaObject.connectSlotsByName(Autocorrelation)
def restoreSelectedLayers(self): proj = QgsProject.instance() cutDefStr = proj.readEntry("CutPlugin", "GeologyCut", "[]")[0] pointsStr = proj.readEntry("CutPlugin", "PointToDraw", '[]')[0] self.dockwidget.blockAllSignals(True) # try: self.dockwidget.mXyAspectRatio.setValue(float(proj.readEntry("CutPlugin", "XyAspectRatio", '1.0')[0])) self.dockwidget.plotComboBox.setCurrentIndex(int(proj.readEntry("CutPlugin", "plotIndex", '0')[0])) self.dockwidget.comboBox.setCurrentIndex(int(proj.readEntry("CutPlugin", "comboBox", '0')[0])) self.dockwidget.mWellDistance.setValue(float(proj.readEntry("CutPlugin", "distanceToWell", '50')[0])) self.dockwidget.wellTopDepthEdit.setValue(float(proj.readEntry("CutPlugin", "wellTopDepth", '-9999')[0])) self.dockwidget.wellBottomDepthEdit.setValue( float(proj.readEntry("CutPlugin", "wellBottomDepth", '-9999')[0])) self.dockwidget.currentTemplateId = int(proj.readEntry("CutPlugin", "currentTemplateId", "-1")[0]) self.dockwidget.isDefaultTrackWidth = proj.readEntry("CutPlugin", "isDefaultTrackWidth", 'True')[0] == 'True' self.dockwidget.trackWidth = int(proj.readEntry("CutPlugin", "trackWidth", '10')[0]) self.dockwidget.setShowModel(proj.readEntry("CutPlugin", "isShowModel", 'True')[0] == 'True') propsStr = proj.readEntry("CutPlugin", "colorRamp1", "{'color1': '202,0,32,255', " "'color2': '64,64,64,255', " "'discrete': '0', " "'rampType': 'gradient', " "'stops': '0.25;244,165,130,255:0.5;255,255,255,255:0.75;186,186,186,255'}")[0] self.dockwidget.mColorRamp.setColorRamp(QgsGradientColorRamp.create(ast.literal_eval(propsStr))) try: model_no = int(proj.readEntry("CutPlugin", "model_no", '0')[0]) for i in range(self.dockwidget.modelListWidget.count()): item = self.dockwidget.modelListWidget.item(i) if int(item.data(Qt.UserRole)) == model_no: self.dockwidget.modelListWidget.setCurrentItem(item) break propKey = proj.readEntry("CutPlugin", "property_key", "")[0] items = self.dockwidget.propertyListWidget.findItems(propKey, Qt.MatchExactly) if len(items): self.dockwidget.propertyListWidget.setCurrentItem(items[0]) except: pass cutDefs = ast.literal_eval(cutDefStr) self.dockwidget.tableViewTool.blockSignals(True) reg = QgsProject.instance() for row in cutDefs: layer = reg.mapLayer(row['id']) if layer: self.dockwidget.addLayer(layer) mdl = self.dockwidget.mdl r = mdl.rowCount() - 1 mdl.setData(mdl.index(r, COL_VISIBLE, QtCore.QModelIndex()), bool(row['selected']), QtCore.Qt.CheckStateRole) mdl.setData(mdl.index(r, COL_COLOR, QtCore.QModelIndex()), QtGui.QColor(row['color']), QtCore.Qt.BackgroundRole) symbolXml = str(row['backColor']) symbol = self.stringToSymbol(symbolXml) if not symbol: symbol = QgsFillSymbol.createSimple({'color': '#0000FF', 'style': 'solid', 'style_border': 'solid', 'color_border': 'black', 'width_border': '0.3'}) icon = QgsSymbolLayerUtils.symbolPreviewIcon(symbol, QtCore.QSize(50, 50)) mdl.setData(mdl.index(r, COL_BACKGROUND, QtCore.QModelIndex()), symbol, QtCore.Qt.UserRole) mdl.setData(mdl.index(r, COL_BACKGROUND, QtCore.QModelIndex()), icon, QtCore.Qt.DecorationRole) mdl.setData(mdl.index(r, COL_NAME, QtCore.QModelIndex()), icon, QtCore.Qt.DecorationRole) self.pointstoDraw = ast.literal_eval(pointsStr) if len(self.pointstoDraw): self.isInitialised = True PlottingTool().addAllLayers(self.dockwidget) # self.updateProfil(self.pointstoDraw, False, True) # self.updateWells() self.toolrenderer.setPointsToDraw(self.pointstoDraw) # except Exception as e: # QgsMessageLog.logMessage(u"Cut restore error: {0}".format(str(e)), tag="CutPlugin") self.dockwidget.tableViewTool.blockSignals(False) self.isInitialised = True self.dockwidget.blockAllSignals(False)
def setupUi(self, mapExport): mapExport.setObjectName(_fromUtf8("mapExport")) mapExport.resize(376, 453) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( mapExport.sizePolicy().hasHeightForWidth()) mapExport.setSizePolicy(sizePolicy) mapExport.setMinimumSize(QtCore.QSize(320, 340)) mapExport.setSizeIncrement(QtCore.QSize(0, 0)) mapExport.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) icon = QtGui.QIcon() icon.addPixmap( QtGui.QPixmap(_fromUtf8(":/plugins/MapExport/icons/icon.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) mapExport.setWindowIcon(icon) mapExport.setSizeGripEnabled(True) self.gridLayout = QtGui.QGridLayout(mapExport) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.label_2 = QtGui.QLabel(mapExport) self.label_2.setObjectName(_fromUtf8("label_2")) self.gridLayout.addWidget(self.label_2, 5, 0, 1, 1) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.exportButton = QtGui.QPushButton(mapExport) self.exportButton.setObjectName(_fromUtf8("exportButton")) self.horizontalLayout.addWidget(self.exportButton) self.buttonBox = QtGui.QDialogButtonBox(mapExport) self.buttonBox.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Close) self.buttonBox.setCenterButtons(False) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.horizontalLayout.addWidget(self.buttonBox) self.gridLayout.addLayout(self.horizontalLayout, 8, 0, 1, 2) self.horizontalLayout_6 = QtGui.QHBoxLayout() self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6")) self.printinglabel = QtGui.QLabel(mapExport) self.printinglabel.setText(_fromUtf8("")) self.printinglabel.setObjectName(_fromUtf8("printinglabel")) self.horizontalLayout_6.addWidget(self.printinglabel) self.pageBar = QtGui.QProgressBar(mapExport) self.pageBar.setProperty("value", 0) self.pageBar.setObjectName(_fromUtf8("pageBar")) self.horizontalLayout_6.addWidget(self.pageBar) self.gridLayout.addLayout(self.horizontalLayout_6, 7, 0, 1, 2) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) self.path = QtGui.QLineEdit(mapExport) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.path.sizePolicy().hasHeightForWidth()) self.path.setSizePolicy(sizePolicy) self.path.setSizeIncrement(QtCore.QSize(0, 0)) self.path.setToolTip(_fromUtf8("")) self.path.setWhatsThis(_fromUtf8("")) self.path.setObjectName(_fromUtf8("path")) self.horizontalLayout_3.addWidget(self.path) self.browser = QtGui.QPushButton(mapExport) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.browser.sizePolicy().hasHeightForWidth()) self.browser.setSizePolicy(sizePolicy) self.browser.setMinimumSize(QtCore.QSize(100, 23)) self.browser.setObjectName(_fromUtf8("browser")) self.horizontalLayout_3.addWidget(self.browser) self.gridLayout.addLayout(self.horizontalLayout_3, 6, 0, 1, 2) self.textBrowser = QtGui.QTextBrowser(mapExport) self.textBrowser.setObjectName(_fromUtf8("textBrowser")) self.gridLayout.addWidget(self.textBrowser, 0, 0, 1, 2) self.label = QtGui.QLabel(mapExport) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setObjectName(_fromUtf8("label")) self.gridLayout.addWidget(self.label, 1, 0, 1, 1) self.composerSelect = QtGui.QComboBox(mapExport) self.composerSelect.setObjectName(_fromUtf8("composerSelect")) self.gridLayout.addWidget(self.composerSelect, 2, 0, 1, 2) self.retranslateUi(mapExport) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), mapExport.reject) QtCore.QMetaObject.connectSlotsByName(mapExport) mapExport.setTabOrder(self.path, self.browser) mapExport.setTabOrder(self.browser, self.exportButton) mapExport.setTabOrder(self.exportButton, self.buttonBox)