本文整理汇总了Python中PySide.QtGui.QDialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QDialog.__init__方法的具体用法?Python QDialog.__init__怎么用?Python QDialog.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QDialog
的用法示例。
在下文中一共展示了QDialog.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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)
示例3: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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
示例4: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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()
示例5: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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,代码行数:34,代码来源:lowerlimbgenerationdialog.py
示例6: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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 = ''
示例7: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
def __init__(self):
'''
Constructor
'''
QDialog.__init__(self)
self._initGUI()
示例8: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
def __init__(self, parent=None):
"""
Constructor
"""
QDialog.__init__(self, parent)
self._ui = Ui_LicenseDialog()
self._ui.setupUi(self)
示例9: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
def __init__(self, low=True, parent=None):
QDialog.__init__(self, parent)
self.setupUi(self)
self.low = low
self.horizontalSlider.valueChanged.connect(self.update_mask)
self.buttonBox.rejected.connect(self._clear)
self.buttonBox.accepted.connect(self._apply_mask)
示例10: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
def __init__(self, data, GFUnfitted, config, fitFunc, resetCallback, distModes, landmarks=None, 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._distModes = distModes
self._landmarks = landmarks
if self._landmarks is not None:
self._landmarkNames = sorted(self._landmarks.keys())
print(self._landmarkNames)
else:
self._landmarkNames = []
self._worker = _ExecThread(self._fitFunc)
self._worker.update.connect(self._fitUpdate)
self._initViewerObjects()
self._setupGui()
self._initialiseSettings()
self._makeConnections()
self._initialiseObjectTable()
self._refresh()
开发者ID:mapclient-plugins,项目名称:fieldworkpcmeshfittingstep,代码行数:37,代码来源:mayavipcmeshfittingviewerwidget.py
示例11: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
def __init__(self, fig):
QDialog.__init__(self)
self.fig = fig
main_layout = QVBoxLayout()
self.setLayout(main_layout)
top_widget = QWidget()
bottom_widget = QWidget()
main_layout.addWidget(top_widget)
main_layout.addWidget(bottom_widget)
top_layout = QHBoxLayout()
bottom_layout = QHBoxLayout()
top_widget.setLayout(top_layout)
bottom_widget.setLayout(bottom_layout)
self.atext = qHotField("annotation", unicode, "the_text")
top_layout.addWidget(self.atext)
self.segment_number = qHotField("Segment", int, 1)
top_layout.addWidget(self.segment_number)
qmy_button(top_layout, self.annotate_it, "annotate")
self.over = qHotField("over", int, -70)
bottom_layout.addWidget(self.over)
self.up = qHotField('up', int, 30)
bottom_layout.addWidget(self.up)
qmy_button(bottom_layout, self.remove_annotations, "remove all")
qmy_button(bottom_layout, self.remove_last_annotation, "remove last")
self.annotations = []
示例12: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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)
示例13: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
def __init__(self, parent,silhouette,completeness,homogeneity,v_score,AMI,ARS):
QDialog.__init__( self, parent )
layout = QVBoxLayout()
viewLayout = QFormLayout()
viewLayout.addRow(QLabel('Silhouette score: '),QLabel(silhouette))
viewLayout.addRow(QLabel('Completeness: '),QLabel(completeness))
viewLayout.addRow(QLabel('Homogeneity: '),QLabel(homogeneity))
viewLayout.addRow(QLabel('V score: '),QLabel(v_score))
viewLayout.addRow(QLabel('Adjusted mutual information: '),QLabel(AMI))
viewLayout.addRow(QLabel('Adjusted Rand score: '),QLabel(ARS))
viewWidget = QGroupBox()
viewWidget.setLayout(viewLayout)
layout.addWidget(viewWidget)
#Accept cancel
self.acceptButton = QPushButton('Ok')
self.cancelButton = QPushButton('Cancel')
self.acceptButton.clicked.connect(self.accept)
self.cancelButton.clicked.connect(self.reject)
hbox = QHBoxLayout()
hbox.addWidget(self.acceptButton)
hbox.addWidget(self.cancelButton)
ac = QWidget()
ac.setLayout(hbox)
layout.addWidget(ac)
self.setLayout(layout)
示例14: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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)
示例15: __init__
# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import __init__ [as 别名]
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()