本文整理汇总了Python中PySide.QtGui.QDialog类的典型用法代码示例。如果您正苦于以下问题:Python QDialog类的具体用法?Python QDialog怎么用?Python QDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, wdg_detector, key='', parent=None):
QDialog.__init__(self, parent)
self.setWindowTitle(wdg_detector.accessibleName())
# Widgets
self._txt_key = QLineEdit()
self._txt_key.setValidator(QRegExpValidator(QRegExp(r"^(?!\s*$).+")))
self._txt_key.setText(key)
self._wdg_detector = wdg_detector
buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
# Layouts
layout = QFormLayout()
layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) # Fix for Mac OS
layout.addRow('Key', self._txt_key)
layout.addRow(self._wdg_detector)
layout.addRow(buttons)
self.setLayout(layout)
# Signals
self._txt_key.textChanged.connect(self._onChanged)
self._txt_key.textChanged.emit('')
buttons.accepted.connect(self._onOk)
buttons.rejected.connect(self.reject)
示例2: __init__
def __init__(self, parent=None):
'''
Constructor
'''
QDialog.__init__(self, parent)
self._ui = Ui_CreditsDialog()
self._ui.setupUi(self)
creditsTab = QTabWidget()
creditSections = info.CREDITS.keys()
for creditSection in creditSections:
creditTab = QWidget()
creditsTab.addTab(creditTab, creditSection)
vbox = QVBoxLayout(creditTab)
creditList = ""
for person in info.CREDITS[creditSection]:
creditList += ("\n%s [%s]" % (person['name'], person['email']))
creditLabel = QLabel()
creditLabel.setStyleSheet("QLabel { background-color : white}")
creditLabel.setText(creditList)
creditLabel.setAlignment(Qt.AlignTop | Qt.AlignLeft)
vbox.addWidget(creditLabel)
vbox = QVBoxLayout()
vbox.setContentsMargins(0, 0, 0, 0)
vbox.addWidget(creditsTab)
self._ui.frame_CreditsTab.setLayout(vbox)
示例3: __init__
def __init__(self, data, doneExecution, parent=None):
'''
Constructor
'''
QDialog.__init__(self, parent)
self._ui = Ui_Dialog()
self._ui.setupUi(self)
self._scene = self._ui.MayaviScene.visualisation.scene
self._scene.background = self.backgroundColour
self.data = data
self.data.regCallback = self._regCallback
self.doneExecution = doneExecution
self._lockManualRegUpdate = False
self.selectedObjectName = None
self._worker = _ExecThread(self.data.register)
self._worker.update.connect(self._regUpdate)
self._worker.callback.connect(self._regCallback)
# print 'init...', self._config
### FIX FROM HERE ###
# create self._objects
self._initViewerObjects()
self._setupGui()
self._makeConnections()
self._initialiseObjectTable()
self._updateConfigs()
self._refresh()
开发者ID:mapclient-plugins,项目名称:fieldworklowerlimb2sidegenerationstep,代码行数:32,代码来源:lowerlimbgenerationdialog.py
示例4: __init__
def __init__(self, parent=None):
"""
Constructor
"""
QDialog.__init__(self, parent)
self._ui = Ui_LicenseDialog()
self._ui.setupUi(self)
示例5: __init__
def __init__(self, updates, streetdb):
QDialog.__init__(self)
self.setupUi(self)
table = self.tableWidget
table.setRowCount(len(updates)+1)
table.setColumnCount(len(common.ATT))
self.setWindowTitle("Overview")
for i in range(len(common.ATT)):
item = QTableWidgetItem(common.ATT_HR[common.ATT[i]])
table.setItem(0, i, item)
for i, street in enumerate(updates):
changes = updates[street]
row = []
for z in range(len(common.ATT)):
found = False
att = common.ATT[z]
print(att)
for change in changes:
split = change.split(":")
if split[0] == att:
row.append(split[1])
found = True
if not found:
try:
row.append(streetdb[street][att])
except KeyError:
"""print("Error building diagram in Street:", street, " Attribute: ", att) ## Missing field"""
for x, update in enumerate(row):
item = QTableWidgetItem(update)
if "->" in update:
item.setForeground(Qt.red)
print(i+1, x, update)
table.setItem(i+1, x, item)
self.load_settings()
示例6: __init__
def __init__(self, app, *args, **kwargs):
QDialog.__init__(self, *args, **kwargs)
self.app = app
self.closed = False
self.sort_order = None
self.ui = Ui_List()
self.ui.setupUi(self)
self.setWindowIcon(get_icon())
self.notebooksModel = QStandardItemModel()
self.ui.notebooksList.setModel(self.notebooksModel)
self.ui.notebooksList.selection.connect(self.selection_changed)
self.ui.notebooksList.setContextMenuPolicy(Qt.CustomContextMenu)
self.ui.notebooksList.customContextMenuRequested.connect(self.notebook_context_menu)
self.notesModel = QStandardItemModel()
self.notesModel.setHorizontalHeaderLabels(
[self.tr('Title'), self.tr('Last Updated')])
self.ui.notesList.setModel(self.notesModel)
self.ui.notesList.doubleClicked.connect(self.note_dblclicked)
self.ui.notesList.setContextMenuPolicy(Qt.CustomContextMenu)
self.ui.notesList.customContextMenuRequested.connect(self.note_context_menu)
self.ui.notesList.header().sortIndicatorChanged.connect(self.sort_order_updated)
self.ui.newNotebookBtn.setIcon(QIcon.fromTheme('folder-new'))
self.ui.newNotebookBtn.clicked.connect(self.new_notebook)
self.ui.newNoteBtn.setIcon(QIcon.fromTheme('document-new'))
self.ui.newNoteBtn.clicked.connect(self.new_note)
self.ui.newNoteBtn.setShortcut(QKeySequence(self.tr('Ctrl+n')))
self.ui.newNotebookBtn.setShortcut(QKeySequence(self.tr('Ctrl+Shift+n')))
QShortcut(QKeySequence(self.tr('Ctrl+q')), self, self.close)
示例7: accept
def accept(self, *args, **kwargs):
#Validate the input, returning if invalid.
#The configuration name cannot be empty or only whitespace.
configuration_name = self.txtName.text().strip()
if not configuration_name:
QMessageBox.critical(self, "Missing Name", "You must give this server configuration a name.")
self.txtName.selectAll()
self.txtName.setFocus()
return
#We check to see if the user entered a valid server configuration.
if self.ServerTypeTabs.currentWidget() is self.LocalServerTab:
if not self.validateLocalServerPath():
QMessageBox.critical(self, "Invalid Path", "The path you entered does not point to a valid Sage installation.")
self.txtPath.selectAll()
self.txtPath.setFocus()
return
elif self.ServerTypeTabs.currentWidget() is self.NotebookServerTab:
if not self.validateNotebookServer():
QMessageBox.critical(self, "Invalid Notebook Server", "The Sage Notebook Server settings you provided are not valid.")
return
#Input is valid, so accept.
QDialog.accept(self)
示例8: __init__
def __init__(self, list_options, parent=None):
QDialog.__init__(self, parent)
# Variables
model = _AvailableOptionsListModel()
for options in list_options:
model.addOptions(options)
# Widgets
lbltext = QLabel('Select the options to import')
self._combobox = QComboBox()
self._combobox.setModel(model)
buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
# Layouts
layout = QVBoxLayout()
layout.addWidget(lbltext)
layout.addWidget(self._combobox)
layout.addWidget(buttons)
self.setLayout(layout)
# Signals
buttons.accepted.connect(self.accept)
buttons.rejected.connect(self.reject)
示例9: __init__
def __init__(self, data, GFUnfitted, config, fitFunc, resetCallback, parent=None):
'''
Constructor
'''
QDialog.__init__(self, parent)
self._ui = Ui_Dialog()
self._ui.setupUi(self)
self._scene = self._ui.MayaviScene.visualisation.scene
self._scene.background = self.backgroundColour
self.selectedObjectName = None
self._data = data
self._GFUnfitted = GFUnfitted
self._GFFitted = copy.deepcopy(self._GFUnfitted)
self._fitFunc = fitFunc
self._config = config
self._resetCallback = resetCallback
self._worker = _ExecThread(self._fitFunc)
self._worker.finalUpdate.connect(self._fitUpdate)
self._worker.update.connect(self._fitCallback)
# create self._objects
self._objects = MayaviViewerObjectsContainer()
self._objects.addObject('data', MayaviViewerDataPoints('data', self._data, renderArgs=self._dataRenderArgs))
self._objects.addObject('GF Unfitted', MayaviViewerFieldworkModel('GF Unfitted', self._GFUnfitted, self._GFD, renderArgs=self._GFUnfittedRenderArgs))
self._objects.addObject('GF Fitted', MayaviViewerFieldworkModel('GF Fitted', self._GFFitted, self._GFD, renderArgs=self._GFFittedRenderArgs))
self._makeConnections()
self._initialiseObjectTable()
self._initialiseSettings()
self._refresh()
示例10: __init__
def __init__(self, landmarks, config, predictFunc, predMethods, popClasses, parent=None):
'''
Constructor
'''
QDialog.__init__(self, parent)
self._ui = Ui_Dialog()
self._ui.setupUi(self)
self._scene = self._ui.MayaviScene.visualisation.scene
self._scene.background = self.backgroundColour
self.selectedObjectName = None
self._landmarks = landmarks
self._landmarkNames = sorted(self._landmarks.keys())
self._predictFunc = predictFunc
self._predMethods = predMethods
self._popClasses = popClasses
self._config = config
# print 'init...', self._config
### FIX FROM HERE ###
# create self._objects
self._initViewerObjects()
self._setupGui()
self._makeConnections()
self._initialiseObjectTable()
self._initialiseSettings()
self._refresh()
# self.testPlot()
# self.drawObjects()
print 'finished init...', self._config
示例11: __init__
def __init__(self, step, parent=None):
'''
Constructor
'''
QDialog.__init__(self, parent)
self._ui = Ui_Dialog()
self._ui.setupUi(self)
self._scene = self._ui.MayaviScene.visualisation.scene
self._scene.background = self.backgroundColour
self.selectedObjectName = None
self._step = step
self._worker = _ExecThread(self._step._segment)
self._worker.update.connect(self._segUpdate)
self._initViewerObjects()
self._setupGui()
self._initialiseSettings()
self._makeConnections()
self._initialiseObjectTable()
self._refresh()
self._previousProfileModelFile = ''
示例12: __init__
def __init__(self, low=True, parent=None):
QDialog.__init__(self, parent)
self.setupUi(self)
def bind_slider(check, action):
def inner(x):
if check(x):
action(x)
return inner
bind1 = bind_slider(lambda x: self.slider_from.value() > x,
lambda x: self.slider_from.setValue(max(0, x-1)))
bind2 = bind_slider(lambda x: self.slider_to.value() < x,
lambda x: self.slider_to.setValue(min(100, x+1)))
self.slider_to.valueChanged.connect(bind1)
self.slider_from.valueChanged.connect(bind2)
self.slider_to.valueChanged.connect(self.update_mask)
self.slider_from.valueChanged.connect(self.update_mask)
self.check_inverse.stateChanged.connect(self.update_mask)
self.buttonBox.rejected.connect(self._clear)
self.buttonBox.accepted.connect(self._apply_mask)
示例13: __init__
def __init__(self):
'''
Constructor
'''
QDialog.__init__(self)
self._initGUI()
示例14: __init__
def __init__(self, app, *args, **kwargs):
QDialog.__init__(self, *args, **kwargs)
self.app = app
self.closed = False
self.startup_path = os.path.expanduser('~/.config/autostart/')
self.startup_file = os.path.join(self.startup_path, 'everpad.desktop')
self.ui = Ui_Dialog()
self.ui.setupUi(self)
self.ui.webView.hide()
self.setWindowIcon(get_icon())
for delay in (5, 10, 15, 30):
self.ui.syncDelayBox.addItem(self.tr('%d minutes') % delay,
userData=str(delay * 60 * 1000),
)
self.ui.syncDelayBox.addItem(self.tr('One hour'), userData='3600000')
self.ui.syncDelayBox.addItem(self.tr('Manual'), userData='-1')
active_index = self.ui.syncDelayBox.findData(str(
self.app.provider.get_sync_delay(),
))
self.ui.syncDelayBox.setCurrentIndex(active_index)
self.ui.syncDelayBox.currentIndexChanged.connect(self.delay_changed)
self.ui.tabWidget.currentChanged.connect(self.update_tabs)
self.ui.authBtn.clicked.connect(self.change_auth)
self.ui.autoStart.stateChanged.connect(self.auto_start_state)
self.ui.noteFont.currentFontChanged.connect(self.font_changed)
self.ui.noteSize.valueChanged.connect(self.font_size_changed)
self.ui.blackTray.stateChanged.connect(self.tray_changed)
self.update_tabs()
示例15: accept
def accept(self):
settings = QSettings()
settings.setValue("DB/File", self.file.text())
settings.setValue("SMTP/Server", self.smtp_server.text())
settings.setValue("HTTP Proxy/IP", self.http_proxy_ip.text())
settings.setValue("HTTP Proxy/Enabled", bool(self.http_proxy.isChecked()) and bool(self.http_proxy_ip.text()))
QDialog.accept(self)