本文整理匯總了Python中qtpy.QtWidgets.QMainWindow.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python QMainWindow.__init__方法的具體用法?Python QMainWindow.__init__怎麽用?Python QMainWindow.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qtpy.QtWidgets.QMainWindow
的用法示例。
在下文中一共展示了QMainWindow.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None):
QMainWindow.__init__(self,parent)
self.ui = load_ui(__file__, 'converter.ui', baseinstance=self)
self.ui.InputVal.setValidator(QDoubleValidator(self.ui.InputVal))
self.ui.totalFlightPathInput.setValidator(QDoubleValidator(self.ui.totalFlightPathInput))
self.ui.scatteringAngleInput.setValidator(QDoubleValidator(self.ui.scatteringAngleInput))
self.ui.convertButton.clicked.connect(self.convert)
self.ui.helpButton.clicked.connect(self.helpClicked)
self.ui.inputUnits.currentIndexChanged.connect(self.setInstrumentInputs)
self.ui.outputUnits.currentIndexChanged.connect(self.setInstrumentInputs)
self.setInstrumentInputs()
##defaults
self.flightpath = -1.0
self.Theta = -1.0
self.output = 0.0
#help
self.assistant_process = QtCore.QProcess(self)
# pylint: disable=protected-access
import mantid
self.mantidplot_name='TOF Converter'
self.collection_file = os.path.join(mantid._bindir, '../docs/qthelp/MantidProject.qhc')
version = ".".join(mantid.__version__.split(".")[:2])
self.qt_url = 'qthelp://org.sphinx.mantidproject.' + version + '/doc/interfaces/TOF Converter.html'
self.external_url = 'http://docs.mantidproject.org/nightly/interfaces/TOF Converter.html'
try:
import mantid
#register startup
mantid.UsageService.registerFeatureUsage("Interface","TofConverter",False)
except ImportError:
pass
示例2: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self):
QMainWindow.__init__(self)
# -- instance attributes --
self.setWindowTitle("Mantid Workbench")
self.setObjectName("Mantid Workbench")
# widgets
self.messagedisplay = None
self.ipythonconsole = None
self.workspacewidget = None
self.editor = None
self.algorithm_selector = None
self.plot_selector = None
self.widgets = []
# Widget layout map: required for use in Qt.connection
self._layout_widget_info = None
# Menus
self.file_menu = None
self.file_menu_actions = None
self.editor_menu = None
self.view_menu = None
self.view_menu_actions = None
self.interfaces_menu = None
# Allow splash screen text to be overridden in set_splash
self.splash = SPLASH
# Layout
self.setDockOptions(self.DOCKOPTIONS)
# Project
self.project = None
示例3: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, *args, **kwargs):
ui_module = MyWidgetUI
try: self.ui = ui_module.Ui_Form() #enable autocomplete
except: pass
QMainWindow.__init__(self, *args, **kwargs)
self.widget = QtWidgetLoader(ui_module=ui_module, parent=self, action_receiver=self)
self.widget.ui.lineEdit.setText("MyWidget")
self.show()
示例4: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None):
self.parent = parent
QMainWindow.__init__(self, parent=parent)
self.ui = load_ui('jobStatus.ui', baseinstance=self)
self.init_table()
self.launch_table_update_thread()
示例5: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None):
self.parent = parent
QMainWindow.__init__(self, parent=parent)
self.ui = load_ui('advanced_window.ui', baseinstance=self)
self.setWindowTitle("Advanced Window for Super User Only !")
self.init_widgets()
示例6: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, main_window=None, key=None):
self.main_window = main_window
self.key = key
QMainWindow.__init__(self, parent=main_window)
self.ui = load_ui('manual_key_value_input.ui', baseinstance=self)
self.init_widgets()
示例7: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self):
QMainWindow.__init__(self)
self.mplwidget = MatplotlibWidget(self, title='Example',
xlabel='Linear scale',
ylabel='Log scale',
hold=True, yscale='log')
self.mplwidget.setFocus()
self.setCentralWidget(self.mplwidget)
self.plot(self.mplwidget.axes)
示例8: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, canvas, parent=None):
QMainWindow.__init__(self, parent=parent)
# attributes
self._canvas = weakref.proxy(canvas)
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.setWindowIcon(QIcon(':/images/MantidIcon.ico'))
self.close_signal.connect(self._run_close)
self.setAcceptDrops(True)
示例9: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None, key=None, data_type='sample'):
self.parent = parent
self.key = key
self.data_type = data_type
QMainWindow.__init__(self, parent=parent)
self.ui = load_ui('mass_density.ui', baseinstance=self)
self.init_widgets()
self.set_column_index()
示例10: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None, button_name=''):
QMainWindow.__init__(self, parent)
self.parent = parent
self.button_name = button_name
self.ui = load_ui('helpGui.ui', baseinstance=self)
self.init_global_gui()
self.init_table()
示例11: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None, json_conflicts={}):
self.parent = parent
self.json_conflicts = json_conflicts
QMainWindow.__init__(self, parent=parent)
self.ui = load_ui('solve_import_conflicts.ui', baseinstance=self)
#self.ui = UiMainWindow()
#self.ui.setupUi(self)
self.init_widgets()
示例12: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None, text=None, filename=None):
self.parent = parent
QMainWindow.__init__(self, parent=parent)
self.ui = load_ui('preview_ascii.ui', baseinstance=self)
_title = filename
self.setWindowTitle(_title)
self.ui.preview_ascii_text_edit.setText(text)
示例13: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None, key=None, data_type='sample'):
self.parent = parent
self.data_type = data_type
self.key = key
QMainWindow.__init__(self, parent=parent)
self.ui = load_ui('placzek.ui', baseinstance=self)
self.init_widgets()
self.set_column()
示例14: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, parent=None, next_ui='from_database_ui', next_function=None):
QMainWindow.__init__(self, parent=parent)
self.parent = parent
self.next_ui = next_ui
self.next_function = next_function
self.ui = load_ui('oncat_authentication.ui', baseinstance=self)
self.center()
self.init_widgets()
self.ui.password.setFocus()
示例15: __init__
# 需要導入模塊: from qtpy.QtWidgets import QMainWindow [as 別名]
# 或者: from qtpy.QtWidgets.QMainWindow import __init__ [as 別名]
def __init__(self, arr, mgr):
QMainWindow.__init__(self)
self.setWindowTitle('skimage')
self.mgr = mgr
self.main_widget = QWidget()
self.layout = QGridLayout(self.main_widget)
self.setCentralWidget(self.main_widget)
self.label = ImageLabel(self, arr)
self.layout.addWidget(self.label, 0, 0)
self.layout.addLayout
self.mgr.add_window(self)
self.main_widget.show()