def __init__(self): QDialog.__init__(self) # Set up the user interface from Designer. # After setupUI you can access any designer object by doing: # self.<objectname> self.ui = Ui_padroHabitantsDialog() self.ui.setupUi(self)
def __init__(self, item, parent=None): QDialog.__init__(self, parent) self.item = item self.setupUi(self) self.db = self.item.database() self.schemas = self.db.schemas() self.hasSchemas = self.schemas is not None self.connect(self.buttonBox, SIGNAL("accepted()"), self.onOK) self.connect(self.buttonBox, SIGNAL("helpRequested()"), self.showHelp) self.populateSchemas() self.populateTables() if isinstance(item, Table): index = self.cboTable.findText(self.item.name) if index >= 0: self.cboTable.setCurrentIndex(index) self.connect(self.cboSchema, SIGNAL("currentIndexChanged(int)"), self.populateTables) # updates of SQL window self.connect(self.cboSchema, SIGNAL("currentIndexChanged(int)"), self.updateSql) self.connect(self.cboTable, SIGNAL("currentIndexChanged(int)"), self.updateSql) self.connect(self.chkCreateCurrent, SIGNAL("stateChanged(int)"), self.updateSql) self.connect(self.editPkey, SIGNAL("textChanged(const QString &)"), self.updateSql) self.connect(self.editStart, SIGNAL("textChanged(const QString &)"), self.updateSql) self.connect(self.editEnd, SIGNAL("textChanged(const QString &)"), self.updateSql) self.updateSql()
def __init__(self, parent, lookup_entity_name, profile=None): """ Initializes LookupValueSelector. :param parent: The parent of the dialog. :type parent: QWidget :param lookup_entity_name: The lookup entity name :type lookup_entity_name: String :param profile: The current profile object :type profile: Object """ QDialog.__init__(self, parent, Qt.WindowTitleHint | Qt.WindowCloseButtonHint) self.setupUi(self) self.value_and_code = None if profile is None: self._profile = current_profile() else: self._profile = profile self.lookup_entity = self._profile.entity_by_name( '{}_{}'.format(self._profile.prefix, lookup_entity_name) ) self.notice = NotificationBar(self.notice_bar) self._view_model = QStandardItemModel() self.value_list_box.setModel(self._view_model) header_item = QStandardItem(lookup_entity_name) self._view_model.setHorizontalHeaderItem(0, header_item) self.populate_value_list_view() self.selected_code = None self.selected_value_code = None self.value_list_box.clicked.connect(self.validate_selected_code)
def __init__(self, *args): QDialog.__init__(self, *args) self.setupUi(self) self.fileNameEdit.addAction(self.actionCopy) self.connect(self.chooseFileButton, SIGNAL("clicked()"), self.chooseFile) self.allowedFileTypes = "" self._fileName = None
def __init__(self, *args): QDialog.__init__(self, *args) self.setWindowFlags(self.windowFlags() | Qt.CustomizeWindowHint) self.setupUi(self) if self.style().metaObject().className() != "QMacStyle": self.buttonBox.setStyleSheet("") self.setFixedSize(self.size())
def __init__(self, parent, repo, packages=[], components=[]): QDialog.__init__(self, parent) self.setupUi(self) # Package repository self.repo = repo # Selected packages/components self.packages = packages self.components = components self.all_packages = [] # Search widget self.connect(self.searchPackage, SIGNAL("textChanged(const QString &)"), self.slotSearchPackage) # Ok/cancel buttons self.connect(self.buttonBox, SIGNAL("accepted()"), self.accept) self.connect(self.buttonBox, SIGNAL("rejected()"), self.reject) # Filter combo self.connect(self.comboFilter, SIGNAL("currentIndexChanged(int)"), self.slotComboFilter) # Package/Component changes self.connect(self.treeComponents, SIGNAL("currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)"), self.slotSelectComponent) self.connect(self.treeComponents, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self.slotClickComponent) self.connect(self.treePackages, SIGNAL("currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)"), self.slotSelectPackage) self.connect(self.treePackages, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self.slotClickPackage) # Go go go! self.initialize()
def __init__(self, direction): self.dns_lookup_id = 0 QDialog.__init__(self) self.setupUi(self) if (direction == 'OUT'): text = 'is trying to connect to' if (direction == 'IN'): text = 'is being connected to from' self.setWindowTitle("Leopard Flower firewall") self.label_text.setText(text) self.pushButton_allow.clicked.connect(self.allowClicked) self.pushButton_deny.clicked.connect(self.denyClicked) self.pushButton_hide.setVisible(False) self.tableWidget_details.setVisible(False) self.rejected.connect(self.escapePressed) self.finished.connect(self.dialogFinished) fullpath_text = QTableWidgetItem("Full path") self.tableWidget_details.setItem(0,0,fullpath_text) pid_text = QTableWidgetItem("Process ID") self.tableWidget_details.setItem(1,0,pid_text) remoteip_text = QTableWidgetItem("Remote IP") self.tableWidget_details.setItem(2,0,remoteip_text) remotedomain_text = QTableWidgetItem("Remote domain") self.tableWidget_details.setItem(3,0,remotedomain_text) remoteport_text = QTableWidgetItem("Remote port") self.tableWidget_details.setItem(4,0,remoteport_text) localport_text = QTableWidgetItem("Local port") self.tableWidget_details.setItem(5,0,localport_text) #make the incoming dialog stand out. It is not common to receive incoming connections if (direction == 'IN'): pal = QPalette() col = QColor(255, 0, 0, 127) pal.setColor(QPalette.Window, col) self.setPalette(pal)
def __init__(self, parent=None, **kwargs): QDialog.__init__(self, parent, **kwargs) if sys.platform == "darwin": self.setAttribute(Qt.WA_MacSmallSize, True) self.__setupUi()
def __init__(self, server_data, server_version, version, parent = None): QDialog.__init__(self, parent) self.ui = Stat.Ui_Dialog() self.ui.setupUi(self) self.ui.closeDialog.clicked.connect(self.close) self.ui.appVer.setText(version) self.ui.server_name.setText(server_data["site"]["name"]) self.ui.server_address.setText(server_data["site"]["server"]) self.ui.sn_version.setText(server_version) self.ui.dent_size.setText(server_data["site"]["textlimit"] + " characters") if server_data["attachments"]["uploads"]: upload_status = "Enabled" file_size = str(server_data["attachments"]["file_quota"] / 1024) + " KBytes" self.ui.max_file_size.setText(str(file_size)) else: upload_status = "Disabled" self.ui.max_file_size.setText("Unknown") self.ui.uploads_status.setText(upload_status) server_type = "" if server_data["site"]["closed"] == "1": server_type += "Registrations closed" if server_data["site"]["inviteonly"] == "1": server_type += ", Inviation only" if server_data["site"]["private"] == "1": server_type += ", No anonymous reading" self.ui.server_type.setText(server_type)
def __init__(self, parent, titre, contenu, fonction_modif): QDialog.__init__(self, parent) self.setWindowTitle(titre) sizer = QVBoxLayout() self.parent = parent self.fonction_modif = fonction_modif self.texte = PythonSTC(self) # self.texte.setMinimumSize(300, 10) self.texte.setText(contenu) ## self.texte.SetInsertionPointEnd() sizer.addWidget(self.texte) boutons = QHBoxLayout() self.btn_modif = QPushButton(u"Modifier - F5") boutons.addWidget(self.btn_modif) self.btn_esc = QPushButton(u"Annuler - ESC") boutons.addStretch() boutons.addWidget(self.btn_esc) sizer.addLayout(boutons) self.setLayout(sizer) self.btn_modif.clicked.connect(self.executer) self.btn_esc.clicked.connect(self.close) self.setMinimumSize(400, 500) self.texte.setFocus()
def __init__(self, parent=None): """Constructor for the dialog. Show the grid converter dialog. :param parent: parent - widget to use as parent. :type parent: QWidget """ QDialog.__init__(self, parent) self.parent = parent self.setupUi(self) self.setWindowTitle( self.tr('InaSAFE %s Shakemap Converter' % get_version())) self.warning_text = set() self.on_input_path_textChanged() self.on_output_path_textChanged() self.update_warning() # Event register # noinspection PyUnresolvedReferences self.use_output_default.toggled.connect( self.get_output_from_input) # noinspection PyUnresolvedReferences self.input_path.textChanged.connect(self.on_input_path_textChanged) # noinspection PyUnresolvedReferences self.output_path.textChanged.connect(self.on_output_path_textChanged) # Set up things for context help self.help_button = self.button_box.button(QtGui.QDialogButtonBox.Help) # Allow toggling the help button self.help_button.setCheckable(True) self.help_button.toggled.connect(self.help_toggled) self.main_stacked_widget.setCurrentIndex(1)
def __init__(self, project, parent=None): QDialog.__init__(self, parent, Qt.Dialog) self.project = project self.setWindowTitle(translations.TR_PROJECT_PROPERTIES) self.resize(600, 500) vbox = QVBoxLayout(self) self.tab_widget = QTabWidget() self.projectData = ProjectData(self) self.projectExecution = ProjectExecution(self) self.projectMetadata = ProjectMetadata(self) self.tab_widget.addTab(self.projectData, translations.TR_PROJECT_DATA) self.tab_widget.addTab(self.projectExecution, translations.TR_PROJECT_EXECUTION) self.tab_widget.addTab(self.projectMetadata, translations.TR_PROJECT_METADATA) vbox.addWidget(self.tab_widget) self.btnSave = QPushButton(translations.TR_SAVE) self.btnCancel = QPushButton(translations.TR_CANCEL) hbox = QHBoxLayout() hbox.addWidget(self.btnCancel) hbox.addWidget(self.btnSave) vbox.addLayout(hbox) self.connect(self.btnCancel, SIGNAL("clicked()"), self.close) self.connect(self.btnSave, SIGNAL("clicked()"), self.save_properties)
def __init__(self, featureDict, selectedFeatures=None, parent=None, ndim=3): """ Parameters: * featureDict: a nested dictionary. {plugin name : {feature name : {parameter name : parameter}} * selectedDict: like featureDict. entries will be checked and their parameters populated. """ QDialog.__init__(self, parent) self.featureDict = featureDict if selectedFeatures is None or len(selectedFeatures) == 0: selectedFeatures = defaultdict(list) self.selectedFeatures = selectedFeatures self.setWindowTitle("Object Features") ui_class, widget_class = uic.loadUiType(os.path.split(__file__)[0] + "/featureSelection.ui") self.ui = ui_class() self.ui.setupUi(self) self.ui.buttonBox.accepted.connect(self.accept) self.ui.buttonBox.rejected.connect(self.reject) self.ui.allButton.pressed.connect(self.handleAll) self.ui.noneButton.pressed.connect(self.handleNone) self.populate() self.ndim = ndim self.set_margin() self.setObjectName("FeatureSelectionDialog")
def __init__(self, parent=None): """Constructor for the dialog. Show the grid converter dialog. :param parent: parent - widget to use as parent. :type parent: QWidget """ QDialog.__init__(self, parent) self.parent = parent self.setupUi(self) self.setWindowTitle(self.tr('InaSAFE %1 Converter').arg( get_version())) self.warning_text = set() self.on_leInputPath_textChanged() self.on_leOutputPath_textChanged() self.update_warning() # Event register QObject.connect(self.cBDefaultOutputLocation, SIGNAL('toggled(bool)'), self.get_output_from_input) QObject.connect(self.leInputPath, SIGNAL('textChanged(QString)'), self.on_leInputPath_textChanged) QObject.connect(self.leOutputPath, SIGNAL('textChanged(QString)'), self.on_leOutputPath_textChanged) self.show_info()
def __init__(self, parent = None, tabIndex = 0): QDialog.__init__(self, parent) self.ui = Ui_Settings() self.ui.setupUi(self) self.ui.tabWidget.setCurrentIndex(tabIndex) self.initSettings()
def __init__(self, parent): QDialog.__init__(self, parent) self.resize(300, 75) self.setWindowTitle("Updating") self.vw = QWidget(self) self.vl = QVBoxLayout(self.vw) self.vl.setMargin(10) self.label = QLabel(self.vw) self.label.setText("<b>Downloading:</b> library.zip") self.vl.addWidget(self.label) self.horizontalLayoutWidget = QWidget() self.horizontalLayout = QHBoxLayout(self.horizontalLayoutWidget) self.horizontalLayout.setMargin(0) self.progressbar = QProgressBar(self.horizontalLayoutWidget) self.progressbar.setFixedWidth(260) self.progressbar.setMinimum(0) self.progressbar.setMaximum(100) self.stopButton = QPushButton(self.horizontalLayoutWidget) self.stopButton.setFlat(True) self.stopButton.setIcon(Icons.stop) self.stopButton.setFixedSize(16,16) self.horizontalLayout.addWidget(self.progressbar) self.horizontalLayout.addWidget(self.stopButton) self.vl.addWidget(self.horizontalLayoutWidget) self.stopButton.clicked.connect(self.forceStop)
def __init__(self, parent=None): QDialog.__init__(self) Ui_Dialog.__init__(self) self.setupUi(self) self.flag = False self.pushButton_save_path.clicked.connect(self.set_save_path) self.lineEdit_save_path.setText(basedir)
def __init__(self, item, parent=None): QDialog.__init__(self, parent, Qt.Dialog) self._item = item self.setWindowTitle(self.tr("Project Properties")) vbox = QVBoxLayout(self) self.tab_widget = QTabWidget() self.projectData = ProjectData(self) self.projectExecution = ProjectExecution(self) self.projectMetadata = ProjectMetadata(self) self.tab_widget.addTab(self.projectData, self.tr("Project Data")) self.tab_widget.addTab(self.projectExecution, self.tr("Project Execution")) self.tab_widget.addTab(self.projectMetadata, self.tr("Project Metadata")) vbox.addWidget(self.tab_widget) self.btnSave = QPushButton(self.tr("Save")) self.btnCancel = QPushButton(self.tr("Cancel")) hbox = QHBoxLayout() hbox.addWidget(self.btnCancel) hbox.addWidget(self.btnSave) vbox.addLayout(hbox) self.connect(self.btnCancel, SIGNAL("clicked()"), self.close) self.connect(self.btnSave, SIGNAL("clicked()"), self.save_properties)
def __init__(self, options, title, text, resultReceiver): QDialog.__init__(self) self.options = options self.resultReceiver = resultReceiver self.resize(250, 60) self.setWindowTitle(title) self.setModal(True) self.setSizeGripEnabled(False) label = QLabel(text) grid = QGridLayout() grid.setSpacing(10) grid.addWidget(label, 0, 0, 1, len(options)) position = 0 for option in options: button = QPushButton(option) receiver = lambda item = option: self.chooseOption(item) self.connect(button, SIGNAL('clicked()'), receiver) grid.addWidget(button, 1, position) position += 1 self.setLayout(grid) self.show()
def __init__(self, parent=None): QDialog.__init__(self, parent, Qt.Dialog) self.setWindowTitle(self.tr("About SIDE-C")) self.setMaximumSize(QSize(0, 0)) vbox = QVBoxLayout(self) #Create an icon for the Dialog # pixmap = QPixmap(":img/icon") # self.lblIcon = QLabel() # self.lblIcon.setPixmap(pixmap) hbox = QHBoxLayout() # hbox.addWidget(self.lblIcon) lblTitle = QLabel( '<h1>SIDE - C</h1>\n<i>Simple Integrated Development Environment for C<i>') lblTitle.setTextFormat(Qt.RichText) lblTitle.setAlignment(Qt.AlignLeft) hbox.addWidget(lblTitle) vbox.addLayout(hbox) #Add description vbox.addWidget(QLabel( self.tr("""ALGO ACA"""))) vbox.addWidget(QLabel("Hola")) link_ninja = QLabel( self.tr('Website: ')) vbox.addWidget(link_ninja) link_source = QLabel( self.tr('Source Code')) vbox.addWidget(link_source)
def __init__(self, parent): QDialog.__init__(self, parent) self._createdObjects = [] self._pageForItem = {} from PyQt4 import uic # lazy import for better startup performance uic.loadUi(os.path.join(DATA_FILES_PATH, 'ui/UISettings.ui'), self) self.swPages.setCurrentIndex(0) self.setAttribute( Qt.WA_DeleteOnClose ) # Expand all tree widget items self._pageForItem.update ( {u"General": self.pGeneral, u"File associations": self.pAssociations, u"Editor": self.pEditorGeneral, u"Editor/Auto completion": self.pAutoCompletion, u"Editor/Colours": self.pColours, u"Editor/Indentation": self.pIndentation, u"Editor/Brace matching": self.pBraceMatching, u"Editor/Edge": self.pEdgeMode, u"Editor/Caret": self.pCaret, u"Editor/EOL": self.pEditorVisibility, u"Modes": self.pModes}) # resize to minimum size self.resize( self.sizeHint() )
def __init__(self, parent=None, updateMainSignal = None, recDataSignal = None, toPickSignal = None, sendOrderSignal = None): """ Constructor @param parent reference to the parent widget @type QWidget """ QDialog.__init__(self, parent) self.setupUi(self) #SIGNALS used to update main window self.updateMainSignal = updateMainSignal #SIGNALS used to receive data self.toYingyanFuncSignal = recDataSignal self.toYingyanFuncSignal.connect(self.ExtractCommandData) #发送至pickFunc self.toPickPointSignal= toPickSignal #发送socket命令 self.sendOrderSignal = sendOrderSignal #故障信息存储文件 import os PATH = '/'.join(os.getcwd().split('\\')) self.errorFile = PATH + '/ErrorInfo/BugInfo-'+'-'.join(time.ctime().split(' ')).replace(':','-',10) +'.dat' try: with open(self.errorFile, 'a') as errorFile: errorFile.write('<Error File created at ' + time.ctime()+'>\n') except Exception as e: print ('error in creating errorFile:' ,e.message, 'please reopen the program') #upload data to BAIDU self.uploader = GpsUploader(updateMainSignal=updateMainSignal,toPickPointSignal= toPickSignal)
def __init__(self, layers): """ Constructor """ QDialog.__init__(self) self.__layers = layers self.setWindowTitle(QCoreApplication.translate("VDLTools", "Edition Confirmation")) self.__layout = QGridLayout() titleLabel = QLabel(QCoreApplication.translate("VDLTools", "Do you really want to edit these layers ?")) self.__layout.addWidget(titleLabel, 0, 0, 1, 2) pos = 1 for layer in self.__layers: label = QLabel(" - " + layer.name()) self.__layout.addWidget(label, pos, 0, 1, 2) pos += 1 self.__cancelButton = QPushButton(QCoreApplication.translate("VDLTools", "Cancel")) self.__cancelButton.setMinimumHeight(20) self.__cancelButton.setMinimumWidth(100) pos = len(self.__layers) + 1 self.__layout.addWidget(self.__cancelButton, pos, 0) self.__okButton = QPushButton(QCoreApplication.translate("VDLTools", "OK")) self.__okButton.setMinimumHeight(20) self.__okButton.setMinimumWidth(100) self.__layout.addWidget(self.__okButton, pos, 1) self.setLayout(self.__layout)
def __init__(self, thread, parent): QDialog.__init__(self, parent) self.ui = Ui_PlotPreview() self.ui.setupUi(self) self.parent = parent icon = QIcon() icon.addPixmap(QPixmap(":/icons/reload.png"), QIcon.Normal, QIcon.Off) self.update_btn = QPushButton(icon, "Update") self.ui.buttonBox.addButton(self.update_btn, QDialogButtonBox.ApplyRole) self.update_btn.clicked.connect(self.render_image) self._pix = None self._image_list = None self._thread = thread self.scene = QGraphicsScene() self.scene.setSceneRect(0,0,1,1) self.ui.imageView.setScene(self.scene) self.pix_item = None self.ui.imageView.setEnabled(False) self.ui.imageView.setInteractive(False) self.ui.imageView.setDragMode(QGraphicsView.ScrollHandDrag) self.pic_w = None self.pic_c = None self.show_pic_w = None self.show_pic_c = None timer = QTimer(self) timer.setSingleShot(True) timer.setInterval(500) self.timer = timer timer.timeout.connect(self.render_image) if parameters.instance.use_OpenGL: self.ui.imageView.setViewport(QGLWidget(QGLFormat(QGL.SampleBuffers)))
def __init__(self, parent, channels, refls): QDialog.__init__(self, parent) Reducer.__init__(self, parent, channels, refls) self.ui=UiReduction() self.ui.setupUi(self) self.ui.directoryEntry.setText(paths.results) self.ui.fileNameEntry.setText(paths.export_name) self.set_email_texts() for i in range(4): checkbutton=getattr(self.ui, 'export_'+str(i)) if len(self.channels)>i: checkbutton.setText(self.channels[i]) else: checkbutton.setEnabled(False) checkbutton.hide() if ('++' in self.channels and '--' in self.channels) or ( '+' in self.channels and '-' in self.channels): self.ui.export_SA.setEnabled(True) if FROM_MANTID: self.ui.mantidplot.setEnabled(True) for key, value in export.items(): #@UndefinedVariable option=getattr(self.ui, key) if hasattr(option, 'setChecked'): option.setChecked(value) elif hasattr(option, 'setValue'): option.setValue(value) else: option.setText(value)
def __init__(self, pathProjects, parent=None): #pathProjects must be a list QDialog.__init__(self, parent) self.setWindowTitle(self.tr("Add File to Project")) self.pathSelected = '' vbox = QVBoxLayout(self) self._tree = QTreeWidget() self._tree.header().setHidden(True) self._tree.setSelectionMode(QTreeWidget.SingleSelection) self._tree.setAnimated(True) vbox.addWidget(self._tree) hbox = QHBoxLayout() btnAdd = QPushButton(self.tr("Add here!")) btnCancel = QPushButton(self.tr("Cancel")) hbox.addWidget(btnCancel) hbox.addWidget(btnAdd) vbox.addLayout(hbox) #load folders self._root = None for pathProject in pathProjects: folderStructure = file_manager.open_project(pathProject) self._load_project(folderStructure, pathProject) self.connect(btnCancel, SIGNAL("clicked()"), self.close) self.connect(btnAdd, SIGNAL("clicked()"), self._select_path)
def __init__(self, parent, objets, islabel = False): u"Le paramètre 'label' indique si l'objet à éditer est un label" print "OBJETS:" print objets print unicode(objets[0]) print repr(objets[0]) print objets[0].__class__ print isinstance(objets[0], str) objets[0].titre_complet("du", False) self.parent = parent self.islabel = islabel self.fenetre_principale = self.parent.window() self.panel = self.fenetre_principale.onglets.onglet_actuel self.canvas = self.panel.canvas self.objets = objets if self.islabel: titre = u"du label" else: if len(objets) == 0: self.close() if len(objets) == 1: titre = objets[0].titre_complet("du", False) else: titre = u"des objets" # wx.MiniFrame.__init__(self, parent, -1, u"Propriétés " + titre, style=wx.DEFAULT_FRAME_STYLE | wx.TINY_CAPTION_HORIZ) QDialog.__init__(self, parent) self.setWindowTitle(u"Propriétés " + titre) self.setPalette(white_palette) ##self.SetExtraStyle(wx.WS_EX_BLOCK_EVENTS ) main = QVBoxLayout() self.setLayout(main) self.onglets = OngletsProprietes(self) main.addWidget(self.onglets)
def __init__(self): """ Constructor """ QDialog.__init__(self) self.setWindowTitle(QCoreApplication.translate("VDLTools", "Display Attributes Confirmation")) self.resize(300, 100) self.__layout = QGridLayout() self.__confirmLabel = QLabel( QCoreApplication.translate("VDLTools", "Do you want to display the attributes tables for the selected features ?")) self.__layout.addWidget(self.__confirmLabel, 0, 0, 1, 2) self.__okButton = QPushButton(QCoreApplication.translate("VDLTools", "Yes")) self.__okButton.setMinimumHeight(20) self.__okButton.setMinimumWidth(100) self.__cancelButton = QPushButton(QCoreApplication.translate("VDLTools", "No")) self.__cancelButton.setMinimumHeight(20) self.__cancelButton.setMinimumWidth(100) self.__layout.addWidget(self.__okButton, 1, 0) self.__layout.addWidget(self.__cancelButton, 1, 1) self.setLayout(self.__layout)
def __init__(self, title, widget, parent=None): QDialog.__init__(self, parent) self.setWindowTitle(title) self.setModal(True) self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) self.setWindowFlags(self.windowFlags() & ~Qt.WindowCloseButtonHint) self.setWindowFlags(self.windowFlags() & ~Qt.WindowCancelButtonHint) layout = QVBoxLayout() layout.setSizeConstraint(QLayout.SetFixedSize) # not resizable!!! layout.addWidget(widget) self.__button_layout = QHBoxLayout() self.close_button = QPushButton("Close") self.close_button.setObjectName("CLOSE") self.close_button.clicked.connect(self.accept) self.__button_layout.addStretch() self.__button_layout.addWidget(self.close_button) layout.addStretch() layout.addLayout(self.__button_layout) self.setLayout(layout)
def __init__(self): QDialog.__init__(self) self.setupUi(self) self.settings = MySettings() SettingDialog.__init__(self, self.settings) # new declaration of ProjectFinder since changes can be cancelled self.projectFinder = ProjectFinder(self) # table model self.projectSearchModel = ProjectSearchModel(self.projectFinder) self.proxyModel = QSortFilterProxyModel(self) self.proxyModel.setSourceModel(self.projectSearchModel) self.projectSearchTable.setModel(self.proxyModel) header = self.projectSearchTable.horizontalHeader() header.setResizeMode(QHeaderView.ResizeToContents) # open/create QuickFinder file self.createFileButton.clicked.connect(self.createQFTSfile) self.openFileButton.clicked.connect(self.openQFTSfile) self.readQFTSfile() # project search self.addSearchButton.clicked.connect(self.addProjectSearch) self.removeSearchButton.clicked.connect(self.removeProjectSearch) self.editSearchButton.clicked.connect(self.editProjectSearch) self.refreshButton.clicked.connect(self.refreshProjectSearch) self.projectSearchTable.selectionModel().selectionChanged.connect(self.enableButtons) self.enableButtons() # geomapfish self.geomapfishCrsButton.clicked.connect(self.geomapfishCrsButtonClicked)
def __init__(self, qnotero, firstRun=False): """ Constructor Arguments: qnotero -- a Qnotero instance Keyword arguments: firstRun -- indicates if the first run message should be shown (default=False) """ QDialog.__init__(self) self.qnotero = qnotero self.ui = Ui_Preferences() self.ui.setupUi(self) self.ui.labelLocatePath.hide() if not firstRun: self.ui.labelFirstRun.hide() self.ui.labelTitleMsg.setText( \ self.ui.labelTitleMsg.text().replace(u"[version]", \ self.qnotero.version)) self.ui.pushButtonZoteroPathAutoDetect.clicked.connect( \ self.zoteroPathAutoDetect) self.ui.pushButtonZoteroPathBrowse.clicked.connect( \ self.zoteroPathBrowse) self.ui.checkBoxAutoUpdateCheck.setChecked(getConfig(u"autoUpdateCheck")) self.ui.lineEditZoteroPath.setText(getConfig(u"zoteroPath")) i = 0 import libqnotero._themes themePath = os.path.dirname(libqnotero._themes.__file__) for _, theme, _ in pkgutil.iter_modules([themePath]): self.ui.comboBoxTheme.addItem(theme) if theme == getConfig(u"theme").lower(): self.ui.comboBoxTheme.setCurrentIndex(i) i += 1 self.setStyleSheet(self.qnotero.styleSheet()) self.adjustSize()
def __init__(self, iface, observations, initPoint): QDialog.__init__(self) self.setupUi(self) self.settings = MySettings() SettingDialog.__init__(self, self.settings, UpdateMode.NoUpdate) self.processButton.clicked.connect(self.doIntersection) self.okButton.clicked.connect(self.accept) self.finished.connect(self.resetRubber) self.initPoint = initPoint self.observations = [] self.solution = None self.report = "" self.rubber = QgsRubberBand(iface.mapCanvas(), QGis.Point) self.rubber.setColor(self.settings.value("rubberColor")) self.rubber.setIcon(self.settings.value("rubberIcon")) self.rubber.setIconSize(self.settings.value("rubberSize")) self.observationTableWidget.displayRows(observations) self.observationTableWidget.itemChanged.connect(self.disbaleOKbutton) self.doIntersection()
def __init__(self, grid, cellNum, currentHW, parent=None): QDialog.__init__( self ) # Constructs a dialog with parent parent. self being ImageDailog # Set up the UI from Designer: self.ui = Ui_MoveDialog() self.ui.setupUi(self) self.grid = grid self.cellNum = cellNum self.currentHW = currentHW #what is in dialog: # comboBox_A: first value # comboBox_B: second value # spinBox_A: first constane # spinBox_B: second constant #preload comboboxes: cellSearch(grid, cellNum, self.currentHW).makeNamelistComp(self.ui.comboBox_A) cellSearch(grid, cellNum, self.currentHW).makeNamelistComp(self.ui.comboBox_B)
def __init__(self, grid, cellNum, currentHW, tool, parent=None): QDialog.__init__( self ) # Constructs a dialog with parent parent. self being ImageDailog # Set up the UI from Designer: self.ui = Ui_CompairDialog() self.ui.setupUi(self) self.grid = grid self.cellNum = cellNum self.currentHW = currentHW self.elType = tool if self.elType == "Equals": self.ui.label_8.setText('=') if self.elType == "Greater": self.ui.label_8.setText('>') if self.elType == "Lessthan": self.ui.label_8.setText('<') if self.elType == "GreaterOrEq": self.ui.label_8.setText('>=') if self.elType == "LessOrEq": self.ui.label_8.setText('<=') #what is in dialog: # comboBox_A: first value # comboBox_B: second value # spinBox_A: first constane # spinBox_B: second constant #preload comboboxes: #self,combobox,thingBeingFilled) cellSearch(grid, cellNum, self.currentHW).makeNamelistComp(self.ui.comboBox_A, "source_A", self.elType) cellSearch(grid, cellNum, self.currentHW).makeNamelistComp(self.ui.comboBox_B, "source_B", self.elType) if self.grid[self.cellNum[0]][self.cellNum[1]].const_A != None: self.ui.spinBox_A.setValue( self.grid[self.cellNum[0]][self.cellNum[1]].const_A) if self.grid[self.cellNum[0]][self.cellNum[1]].const_B != None: self.ui.spinBox_B.setValue( self.grid[self.cellNum[0]][self.cellNum[1]].const_B)
def __init__(self, options): QDialog.__init__(self) self.setupUi(self) self.lstLayers.setSelectionMode(QAbstractItemView.ExtendedSelection) self.selectedoptions = options # Additional buttons self.btnAdd = QPushButton(self.tr('Add file')) self.buttonBox.addButton(self.btnAdd, QDialogButtonBox.ActionRole) self.btnRemove = QPushButton(self.tr('Remove file(s)')) self.buttonBox.addButton(self.btnRemove, QDialogButtonBox.ActionRole) self.btnRemoveAll = QPushButton(self.tr('Remove all')) self.buttonBox.addButton(self.btnRemoveAll, QDialogButtonBox.ActionRole) self.btnAdd.clicked.connect(self.addFile) self.btnRemove.clicked.connect(lambda: self.removeRows()) self.btnRemoveAll.clicked.connect(lambda: self.removeRows(True)) self.populateList()
def __init__(self, data, win_parent=None): self.win_parent = win_parent #Init the base class groups = data['groups'] inames = data['inames'] self.imain = data['imain'] self.names = [group.name for group in groups] self.white = (255, 255, 255) self.light_grey = (211, 211, 211) self.inames = inames self.shown_set = data['shown'] self.deleted_groups = set([]) #self.inames = argsort(self.names) #print('inames =', inames) anames = array(self.names) for iname, name in enumerate(anames[self.inames]): print('name[%s] = %r' % (iname, name)) # ignore these... #self._default_name = data['name'] #self._default_coords = data['coords'] #self._default_elements = data['elements'] #self._default_color = data['color'] #self.coords_pound = data['coords_pound'] #self.elements_pound = data['elements_pound'] #self._default_is_discrete = data['is_discrete'] self.out_data = data QDialog.__init__(self, win_parent) #self.setupUi(self) self.setWindowTitle('Groups: Post/View') self.create_widgets() self.create_layout() self.set_connections()
def __init__(self): QDialog.__init__(self) # set up ui self.__ui = Ui_Preferences() self.__ui.setupUi(self) # improve ui on mac if utilities.platform_is_mac(): self.__adjust_for_mac() # connect ui signals to logic self.__ui.lineEditPassword.textChanged.connect( self.__slot_password_changed) self.__ui.lineEditKey.textChanged.connect( self.__slot_validate_key) self.__ui.lineEditSecret.textChanged.connect( self.__slot_validate_secret) self.__ui.buttonBox.button(QDialogButtonBox.Apply).released.connect( self.__slot_validate_credentials) self.do_configfile()
def __init__(self, parent = None): QDialog.__init__(self) self.setupUi(self) self.selectedDevice = None self.listdevices = {} self.devices = Devices() self.logical = Logical() self.combodevice = TreeComboBox() self.gridLayout.addWidget(self.combodevice, 0, 1, 1, 1) self.__model = QStandardItemModel() lidx = 0 if len(self.logical): logicalitems = QStandardItem(self.tr("Logical drives")) self.__model.appendRow(logicalitems) for lidx in range(0, len(self.logical)): logicalitem = QStandardItem(self.logical[lidx].model()) logicalitems.appendRow(logicalitem) self.listdevices[lidx] = self.logical[lidx] lidx += 1 if len(self.devices): physicalitems = QStandardItem(self.tr("Physical drives")) self.__model.appendRow(physicalitems) for pidx in range(0, len(self.devices)): model = self.devices[pidx].model() if model != "Unknown": physicalitem = QStandardItem(self.devices[pidx].blockDevice() + " (" + model + ")") else: physicalitem = QStandardItem(self.devices[pidx].blockDevice()) physicalitems.appendRow(physicalitem) self.listdevices[lidx+pidx] = self.devices[pidx] self.combodevice.setModel(self.__model) self.combodevice.view().expandAll() if len(self.devices): self.setDeviceInformations(self.devices[0], True) self.selectedDevice = self.devices[0] self.connect(self.combodevice, SIGNAL("currentIndexChanged(int)"), self.deviceChanged)
def __init__(self, parent=None): """ Constructor """ QDialog.__init__(self, parent) self.setupUi(self) self.AN24Dict = scan_bt() self.NameList = [] self.Address = '' self.Name = '' self.timerScan = QTimer() self.n = 0 self.startTime = 0 self.allTime = 0 self.Cache = [] QtCore.QObject.connect(self.timerScan, SIGNAL("timeout()"), self.addItems) for key in self.AN24Dict: self.NameList.append(key) self.timerScan.start(1000) self.DlgCntAN24 = CntAN24(self)
def __init__(self, parent, help): QDialog.__init__(self, parent) self.setWindowTitle(i18n("Package Manager Help")) self.resize(700, 500) self.setModal(True) self.layout = QGridLayout(self) self.htmlPart = QTextBrowser(self) self.layout.addWidget(self.htmlPart, 1, 1) locale = setSystemLocale(justGet=True) if locale in ["tr", "es", "en", "fr", "nl", "de", "sv"]: self.htmlPart.setSource( QUrl("/usr/share/kde4/apps/package-manager/help/%s/%s" % (locale, help_files[help]))) else: self.htmlPart.setSource( QUrl("/usr/share/kde4/apps/package-manager/help/en/%s" % help_files[help]))
def __init__(self, iface): QDialog.__init__(self, iface.mainWindow()) self.setupUi(self) self.iface = iface self.workThread = None self.btnOk = self.buttonBox.button(QDialogButtonBox.Ok) self.btnClose = self.buttonBox.button(QDialogButtonBox.Close) QObject.connect(self.chkExternalFiles, SIGNAL("stateChanged( int )"), self.toggleExternalFiles) QObject.connect(self.btnSelectFiles, SIGNAL("clicked()"), self.selectFiles) QObject.connect(self.lstLayers, SIGNAL("itemSelectionChanged()"), self.updateLayerList) QObject.connect(self.btnSelectAll, SIGNAL("clicked()"), self.selectAll) QObject.connect(self.btnSelectNone, SIGNAL("clicked()"), self.selectNone) QObject.connect(self.btnClearList, SIGNAL("clicked()"), self.clearList) self.manageGui()
def __init__(self, parent=None): """ This class checks if the user has accepted the license terms and conditions or not . It shows the terms and conditions if not. :param parent: The container of the dialog :type parent: QMainWindow or None :return: None :rtype: NoneType """ QDialog.__init__(self, parent) self.setupUi(self) self.reg_config = RegistryConfig() self.notice_bar = NotificationBar(self.notifBar) self.accepted = False self.btnAccept.clicked.connect(self.accept_action) self.btnDecline.clicked.connect(self.decline_action) self.label.setStyleSheet(''' QLabel { font: bold; } ''')
def __init__(self, options, parent=None): """ Constructor """ QDialog.__init__(self, parent) self.setupUi(self) self.options = options if self.options.be_verbose == True: self.radioButton.setDown(True) else: self.radioButton_2.setDown(True) self.spinBox.setValue(self.options.cascade_depth) self.doubleSpinBox.setValue(self.options.feature_pool_region_padding) self.spinBox_2.setValue(self.options.feature_pool_size) self.doubleSpinBox_2.setValue(self.options.lambda_param) self.doubleSpinBox_3.setValue(self.options.nu) self.spinBox_3.setValue(self.options.num_test_splits) self.spinBox_4.setValue(self.options.num_trees_per_cascade_level) self.spinBox_5.setValue(self.options.oversampling_amount) self.spinBox_6.setValue(self.options.tree_depth)
def __init__(self, parent=None): """ Constructor """ QDialog.__init__(self, parent) self.state = 0 self.posX = 0 self.posY = 0 self.posW = 0 self.posH = 0 self.setWindowFlags(Qt.Tool | Qt.FramelessWindowHint) self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) # maximize window screen = QDesktopWidget().screenGeometry() self.setGeometry(screen) # set cross cursor self.setCursor(Qt.CursorShape(Qt.CrossCursor)) # display self.show() # create rubberband self.rb = QRubberBand(QRubberBand.Rectangle) self.rb.setWindowOpacity(0.4) # new in v18, to support pyqt5 properly self.snapshotResult = None layout = QVBoxLayout() self.backgroundLabel = QLabel() layout.addWidget(self.backgroundLabel) layout.setContentsMargins(0, 0, 0, 0) self.setLayout(layout)
def __init__(self, parent = None): QDialog.__init__(self, parent) # self.setWindowFlags(QtCore.Qt.FramelessWindowHint|QtCore.Qt.Dialog) self.setWindowFlags(QtCore.Qt.Window|QtCore.Qt.WindowCloseButtonHint) # zx comment: must be ApplicationModal. otherwise, this dialog cannot block following codes in same thread self.setWindowModality(QtCore.Qt.WindowModal) self.setEnabled(True) self._gLayout = QVBoxLayout() # QGridLayout() self._statLabelWidget = QLabel(u'<font color="red">{}</font>'.format(config.STARTUP_TIPS_DIALOG_DISPLAYTEXT)) self._statLabelWidget.setFont(QFont("Timers", 16, QFont.Bold)) self._gLayout.addWidget(self._statLabelWidget) self.setLayout(self._gLayout) self.setWindowTitle(config.STARTUP_TIPS_DIALOG_TITLE) self.resize(1000, 800) utils.centerGuiWidget(self) return
def __init__(self, filename, problems): QDialog.__init__(self) self.ui = Ui_PermitDialog() self.ui.setupUi(self) # XXX: re-enable later, remember does currently not work currectly self.ui.rememberCheck.hide() self.ui.filenameLabel.setText(filename) # XXX: only show specific reasons for found problems self.ui.problemsBrowser.setText(""" <i>Please look into the source for further investigation.</i> <ul> %s </ul> <p>To ensure safe execution importing external modules is not allowed by default because external modules could access your system directly. <br/>Additonally access to "private" attributes is not allowed because accessing them could trigger side-effects which may help to break out of the sandbox.<br/> Unfortunately exceptions are also a security problem because they can change the control flow and you could access the stack frame.</p> """ % "".join(["<li>%s</li>" % p for p in problems])) self.ui.problemsBrowser.hide() self.resize(self.width(), self.sizeHint().height())
def __init__(self, parent, isApp): QDialog.__init__(self, parent) self.ui = Ui_SettingsWindow() self.ui.setupUi(self) # ---------------------------------------------------------------------------------------------------- # Set up GUI self.ui.lw_page.setFixedWidth( 48 + 6 * 4 + QFontMetrics(self.ui.lw_page.font()).width(" WebView ")) if not isApp: self.ui.lw_page.hideRow(self.TAB_INDEX_MAIN) self.ui.lw_page.hideRow(self.TAB_INDEX_HOST) self.ui.cb_webview_verbose.setEnabled(False) self.ui.cb_webview_verbose.setVisible(False) # ---------------------------------------------------------------------------------------------------- # Load Settings self.loadSettings() # ---------------------------------------------------------------------------------------------------- # Set-up connections self.accepted.connect(self.slot_saveSettings) self.ui.buttonBox.button(QDialogButtonBox.Reset).clicked.connect( self.slot_resetSettings) self.ui.tb_main_proj_folder_open.clicked.connect( self.slot_getAndSetProjectPath) self.ui.tb_host_path.clicked.connect(self.slot_getAndSetIngenPath) # ---------------------------------------------------------------------------------------------------- # Post-connect setup self.ui.lw_page.setCurrentCell( self.TAB_INDEX_MAIN if isApp else self.TAB_INDEX_WEBVIEW, 0)
def __init__(self, grid, cellNum, currentHW, parent=None): QDialog.__init__( self ) # Constructs a dialog with parent parent. self being ImageDailog # Set up the UI from Designer: self.ui = Ui_CoilDialog() self.ui.setupUi(self) cellNum[0] self.grid = grid self.cellNum = cellNum self.currentHW = currentHW #what is in dialog: # comboBox: IO list # comboBox_2: name # lineEdit: comment #preload comboboxes: cellSearch(grid, cellNum, self.currentHW).makeNamelistCoil(self.ui.comboBox_2) cellSearch(grid, cellNum, self.currentHW).makeIOlist(self.ui.comboBox, False) cellSearch(grid, cellNum, self.currentHW).fillComment(self.ui.lineEdit)
def __init__(self, grid, cellNum, currentHW): QDialog.__init__( self ) # Constructs a dialog with parent parent. self being ImageDailog # Set up the UI from Designer: self.ui = Ui_ContDialog() self.ui.setupUi(self) self.grid = grid self.cellNum = cellNum self.currentHW = currentHW #connect signalls buttons, texts other stuff here #what is in dialog: # comboBox: IO list # comboBox_2: name # lineEdit: comment #preload comboboxes: cellSearch(grid, cellNum, self.currentHW).makeNamelistCont(self.ui.comboBox_2) cellSearch(grid, cellNum, self.currentHW).makeIOlist(self.ui.comboBox, True) cellSearch(grid, cellNum, self.currentHW).fillComment(self.ui.lineEdit)
def __init__(self): QDialog.__init__(self) loadUi('AuthorizationWindow.ui', self) self.setWindowTitle(U'Авторизация') self.passwordTextEdit.setEchoMode(QtGui.QLineEdit.Password) self.setWindowIcon(QIcon('icon.png')) self.service = Service() self.rememberCheckBoxFlag = False self.remember_data = self.service.get_remember() self.rememberCheckBox.stateChanged.connect(self.checker) self.showPasswordCheckBox.stateChanged.connect(self.hider) self.registrationButton.clicked.connect( self.on_registrationButton_click) self.cancelButton.clicked.connect(self.on_cancelButton_click) self.logInButton.clicked.connect(self.on_logInButton_click) self.forgotPasswordLink.clicked.connect( self.on_forgotPasswordLink_click) self.msg = QMessageBox() self.msg.setWindowIcon(QIcon('icon.png')) self.msg.setWindowTitle("!") self.msg.setStandardButtons(QMessageBox.Ok)
def __init__(self, grid, cellNum, currentHW, parent=None): QDialog.__init__( self ) # Constructs a dialog with parent parent. self being ImageDailog # Set up the UI from Designer: self.ui = Ui_PWMDialog() self.ui.setupUi(self) self.grid = grid self.cellNum = cellNum self.currentHW = currentHW #what is in dialog: # lineEdit: comment # comboBox: output pin # doubleSpinBox: Duty Cycle (setpoint) #preload comboboxes: cellSearch(grid, cellNum, self.currentHW).makeIOlist(self.ui.comboBox, "PWM") if self.grid[self.cellNum[0]][self.cellNum[1]].setPoint != None: self.ui.doubleSpinBox.setValue( self.grid[self.cellNum[0]][self.cellNum[1]].setPoint)
def __init__(self, jobs): """ Constructor :param jobs: all the jobs available for import """ QDialog.__init__(self) self.__jobs = jobs self.setWindowTitle( QCoreApplication.translate("VDLTools", "Choose job")) self.resize(300, 100) self.__layout = QGridLayout() self.__okButton = QPushButton( QCoreApplication.translate("VDLTools", "OK")) self.__okButton.setMinimumHeight(20) self.__okButton.setMinimumWidth(100) self.__cancelButton = QPushButton( QCoreApplication.translate("VDLTools", "Cancel")) self.__cancelButton.setMinimumHeight(20) self.__cancelButton.setMinimumWidth(100) self.__layout.addWidget(self.__okButton, 100, 1) self.__layout.addWidget(self.__cancelButton, 100, 2) label = QLabel(QCoreApplication.translate("VDLTools", "Job : ")) label.setMinimumHeight(20) label.setMinimumWidth(50) self.__layout.addWidget(label, 0, 1) self.__jobCombo = QComboBox() self.__jobCombo.setMinimumHeight(20) self.__jobCombo.setMinimumWidth(50) self.__jobCombo.addItem("") for job in self.__jobs: self.__jobCombo.addItem(job) self.__layout.addWidget(self.__jobCombo, 0, 2) self.__jobCombo.currentIndexChanged.connect(self.__jobComboChanged) self.setLayout(self.__layout)
def __init__(self, parent, form_fields, profile=None): """ :param parent: Owner of this form :type parent: QWidget :param form_fields: form field dictionary containing values from the configuration file if it exists. :type form_fields: Dictionary :param profile: Current configuration profile :type profile: Profile """ QDialog.__init__(self, parent) self.setupUi(self) # self.in_db = form_fields['in_db'] self._source = form_fields['prefix_source'] self._leading_zero = form_fields['leading_zero'] self._separator = form_fields['separator'] self._profile = profile self.none = QApplication.translate('CodeProperty', 'None') self.space = QApplication.translate('CodeProperty', 'Single space') self.hyphen = QApplication.translate('CodeProperty', 'Hyphen') self.forward_slash = QApplication.translate('CodeProperty', 'Forward slash') self.backward_slash = QApplication.translate('CodeProperty', 'Backward slash') self.underscore = QApplication.translate('CodeProperty', 'Underscore') self.separators = { '':self.none, '/':'{} (/)'.format(self.forward_slash), '\\':'{} (\\)'.format(self.backward_slash), '-':'{} (-)'.format(self.hyphen), '_':'{} (_)'.format(self.underscore), ' ':self.space } self.zeros = [self.none, '0', '00', '000', '0000', '00000'] self.init_gui() self.prefix_source_cbo.currentIndexChanged.connect( self._on_prefix_source_selected ) self._on_prefix_source_selected()
def __init__(self, fromSection, editorWidget, parent=None): QDialog.__init__(self, parent, Qt.Dialog) self.setModal(True) self.setWindowTitle('from ... import ...') self._editorWidget = editorWidget self._fromSection = fromSection hbox = QHBoxLayout(self) hbox.addWidget(QLabel('from')) self._lineFrom = QLineEdit() self._completer = QCompleter(fromSection) self._lineFrom.setCompleter(self._completer) hbox.addWidget(self._lineFrom) hbox.addWidget(QLabel('import')) self._lineImport = QLineEdit() hbox.addWidget(self._lineImport) self._btnAdd = QPushButton(self.tr('Add')) hbox.addWidget(self._btnAdd) self.connect(self._lineImport, SIGNAL("returnPressed()"), self._add_import) self.connect(self._btnAdd, SIGNAL("clicked()"), self._add_import)
def __init__(self, parent, layer): ''' Constructor ''' QDialog.__init__(self, parent) self.ui = ui_layerSaveAsDlg() self.ui.setupUi(self) # self.layerSet = layerSet self.baseLayer = layer self.shpFormats = ["ESRI Shapefile", "GeoJSON"] self.fileTypes = ["ESRI Shape file(*.shp )", "GeoJSON(*.geojson)"] self.crsList = ["Layer CRS", "Project CRS", "Selected CRS"] self.ui.cmbFormat.addItems(self.shpFormats) self.ui.cmbCrs.addItems(self.crsList) self.ui.btnBrowse.clicked.connect(self.browse) self.ui.txtCrs.setText("WGS 84") self.ui.txtCrs.setEnabled(False) # self.ui.cmbFormat.currentIndexChanged.connect(self.enableTxtAPV) self.ui.cmbCrs.currentIndexChanged.connect(self.crsSelectChange) self.ui.btnChange.clicked.connect(self.crsChange) self.ui.buttonBox.accepted.connect(self.saveLayer) self.crs = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
def __init__(self, parent): QDialog.__init__(self, parent, Qt.Dialog) self._parent = parent self.setWindowTitle('Plugins Manager') self.resize(700, 500) vbox = QVBoxLayout(self) self._tabs = QTabWidget() vbox.addWidget(self._tabs) self.overlay = Overlay(self) self.overlay.show() self._available = [] self._locals = [] self._updates = [] self.loading = True self.thread = ThreadLoadPlugins(self) self.connect(self.thread, SIGNAL("finished()"), self.load_plugins_data) self.connect(self.thread, SIGNAL("plugin_downloaded(PyQt_PyObject)"), self._after_download_plugin) self.thread.start()
def __init__(self, layer, parent=None): QDialog.__init__(self, parent) p = os.path.split(os.path.abspath(__file__))[0] uic.loadUi(p+"/ui/grayLayerDialog.ui", self) self.setLayername(layer.name) def dbgPrint(a, b): layer.set_normalize(0, (a,b)) print "normalization changed to [%d, %d]" % (a,b) def autoRange(state): if state == 2: self.grayChannelThresholdingWidget.setValue(layer.normalize[0][0], layer.normalize[0][1]) #update gui layer.set_normalize(0,None) self.grayChannelThresholdingWidget.setEnabled(False) if state == 0: self.grayChannelThresholdingWidget.setEnabled(True) layer.set_normalize(0,layer.normalize[0]) self.grayChannelThresholdingWidget.setRange(layer.range[0][0], layer.range[0][1]) self.grayChannelThresholdingWidget.setValue(layer.normalize[0][0], layer.normalize[0][1]) self.grayChannelThresholdingWidget.valueChanged.connect(dbgPrint) self.grayAutoRange.stateChanged.connect(autoRange) self.grayAutoRange.setCheckState(layer._autoMinMax[0]*2)
def __init__(self, xemList, cList, vList, halfCountRealTime, parent = None): """ Constructor """ QDialog.__init__(self, parent) self.setupUi(self) self.move(300, 10) # windows position self.xemList = xemList self.cList = cList self.vList = vList self.halfCountRealTime = halfCountRealTime # self.cList.setWindowTitle('Global Control') #self.cList.show() # self.jointAngle = 0.0 # initial joint # self.best_ForceDiff = 1.0 * 0xFFFF #inital muscle length difference (arbitrary) # self.start = False self.onClkRate(10)
def __init__(self, conn, parent=None): """ Constructor """ QDialog.__init__(self, parent) self.setupUi(self) winflag = self.windowFlags() winflag |= QtCore.Qt.CustomizeWindowHint winflag &= ~QtCore.Qt.WindowMaximizeButtonHint self.setWindowFlags(winflag) self.conn = conn self.rand_pic_url = 'https://kyfw.12306.cn/otn/passcodeNew/getPassCodeNew?module=login&rand=sjrand&' self.rand_check_url = 'https://kyfw.12306.cn/otn/passcodeNew/checkRandCodeAnsyn' self.login_url = 'https://kyfw.12306.cn/otn/login/loginAysnSuggest' self.headers = { "Host": "kyfw.12306.cn", "User-Agent": "Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Firefox/38.0", "Connection": "keep-alive" } self.conn.get('https://kyfw.12306.cn/otn/login/init#', headers=self.headers, verify=False) self.conn.get("https://kyfw.12306.cn/otn/resources/merged/login_js.js", headers=self.headers, verify=False) r = self.conn.get(self.rand_pic_url + "%0.17f" % random.random(), headers=self.headers, verify=False) rand_pic = QtGui.QPixmap() rand_pic.loadFromData(r.content) self.resize(rand_pic.width() + (387 - 293), rand_pic.height() + (312 - 190)) self.lblCaptcha.setPixmap(rand_pic) self.lblCaptcha.mouseReleaseEvent = self.on_lblCaptcha_released self.click_pos = [] self.click_icon = [] self.pos_zero = QtCore.QPoint(0, 30) self.islogin = False
def __init__(self, item, parent=None): QDialog.__init__(self, parent) self.item = item self.setupUi(self) self.db = self.item.database() self.schemas = self.db.schemas() self.hasSchemas = self.schemas != None self.fieldTypes = self.db.connector.fieldTypes() m = TableFieldsModel(self, True) # it's editable self.fields.setModel(m) self.fields.setColumnHidden(3, True) # hide Default column d = TableFieldsDelegate(self.fieldTypes, self) self.fields.setItemDelegate(d) self.fields.setColumnWidth(0,140) self.fields.setColumnWidth(1,140) self.fields.setColumnWidth(2,50) b = QPushButton(self.tr("&Create")) self.buttonBox.addButton(b, QDialogButtonBox.ActionRole) self.connect(self.btnAddField, SIGNAL("clicked()"), self.addField) self.connect(self.btnDeleteField, SIGNAL("clicked()"), self.deleteField) self.connect(self.btnFieldUp, SIGNAL("clicked()"), self.fieldUp) self.connect(self.btnFieldDown, SIGNAL("clicked()"), self.fieldDown) self.connect(b, SIGNAL("clicked()"), self.createTable) self.connect(self.chkGeomColumn, SIGNAL("clicked()"), self.updateUi) self.connect(self.fields.selectionModel(), SIGNAL("selectionChanged(const QItemSelection &, const QItemSelection &)"), self.updateUiFields) self.connect(d, SIGNAL("columnNameChanged()"), self.updatePkeyCombo) self.populateSchemas() self.updateUi() self.updateUiFields()