本文整理汇总了Python中qtpy.uic.loadUi函数的典型用法代码示例。如果您正苦于以下问题:Python loadUi函数的具体用法?Python loadUi怎么用?Python loadUi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loadUi函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initUI
def initUI(self):
plugin_path = os.path.dirname(os.path.abspath(__file__))
ui_dir = os.path.join(plugin_path, "ui")
ui_path = os.path.join(ui_dir, 'general_cutout_tool.ui')
loadUi(ui_path, self)
self.statusBar().showMessage("Waiting for user input")
self.progress_bar = self.progressBar
self.status_bar = self.statusBar
self.progressBar.reset()
self.save_path_display.setDisabled(True)
self.start_button.clicked.connect(self.call_main)
self.target_browse_button.clicked.connect(self.get_target_path)
self.change_save_button.clicked.connect(self.custom_path)
self.image_browse_button.clicked.connect(self.get_img_path)
self.target_user_input.textChanged.connect(self.update_save)
self.preview_button.clicked.connect(self.call_peview)
self.x_user_input.setText(self.cutout_x_size_default)
self.y_user_input.setText(self.cutout_y_size_default)
self.x_user_input.selectAll()
self.y_user_input.selectAll()
self.show()
示例2: __init__
def __init__(self):
super().__init__()
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_threadwidget.ui')
# Load it
uic.loadUi(ui_file, self)
示例3: initUI
def initUI(self):
"""
Set up user interface by loading the .ui file
and configuring items in the GUI.
"""
plugin_path = os.path.dirname(os.path.abspath(__file__))
ui_dir = os.path.join(plugin_path, "ui")
ui_path = os.path.join(ui_dir, 'table_generator.ui')
loadUi(ui_path, self)
self.setWindowTitle(self.title)
self.statusBar().showMessage("Waiting for user input")
#Set up no cutout option
self.no_cutout_radio.setChecked(True)
self._no_cutout_radio_toggled()
#Set up radio buttons
self.no_cutout_radio.toggled.connect(self._no_cutout_radio_toggled)
self.add_cutout_radio.toggled.connect(self._add_cutout_radio_toggled)
#Set up click buttons
self.spectra_browse_button.clicked.connect(self.get_spec_path)
self.add_cutout_button.clicked.connect(self.get_cutout_path)
self.make_cutouts_button.clicked.connect(self.call_cutout)
self.default_filename_button.clicked.connect(self.default_filename)
self.generate_table_button.clicked.connect(self.call_main)
self.change_save_path_button.clicked.connect(self.change_save_path)
#Set up defaults
self.default_filename()
self.default_save_dir()
self.show()
示例4: __init__
def __init__(self, parent=None, *args, **kwargs):
super().__init__(parent=parent, *args, **kwargs)
self.model_items = None
self._smoothing_thread = None # Worker thread
self.kernel = None # One of the sub-dicts in KERNEL_REGISTRY
self.function = None # function from `~specutils.manipulation.smoothing`
self.data = None # Current `~specviz.core.items.DataItem`
self.size = None # Current kernel size
self._already_loaded = False
#
# Do the first-time loading and initialization of the GUI
#
loadUi(os.path.abspath(
os.path.join(os.path.dirname(__file__),
".", "smoothing.ui")), self)
self.smooth_button.clicked.connect(self.accept)
self.cancel_button.clicked.connect(self.close)
self.data_combo.currentIndexChanged.connect(self._on_data_change)
for key in KERNEL_REGISTRY:
kernel = KERNEL_REGISTRY[key]
self.kernel_combo.addItem(kernel["name"], key)
self.kernel_combo.currentIndexChanged.connect(self._on_kernel_change)
# Add integer validator to size input field
self.size_input.setValidator(QIntValidator())
示例5: __init__
def __init__(self, loadfile=None):
""" Create the Manager Window.
"""
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_config_window.ui')
self.log = logging.getLogger(__name__)
# Load it
super().__init__()
uic.loadUi(ui_file, self)
self.mods = dict()
self.globalsection = OrderedDict()
self.currentFile = ''
# palette
self.colors = {
'hardware': palette.c2,
'logic': palette.c1,
'gui': palette.c4,
'': palette.c3
}
# init
self.setupUi()
self.show()
if loadfile is not None:
self.loadConfigFile(loadfile)
示例6: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_odmr_settings.ui')
# Load it
super(ODMRSettingDialog, self).__init__()
uic.loadUi(ui_file, self)
示例7: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_reorient_roi_dialog.ui')
# Load it
super(ReorientRoiDialog, self).__init__()
uic.loadUi(ui_file, self)
示例8: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_console_settings.ui')
# Load it
super().__init__()
uic.loadUi(ui_file, self)
示例9: __init__
def __init__(self, **kwargs):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_slow_counter.ui')
# Load it
super().__init__(**kwargs)
uic.loadUi(ui_file, self)
self.show()
示例10: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_laser.ui')
# Load it
super().__init__()
uic.loadUi(ui_file, self)
self.show()
示例11: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_nuclear_operations_gui.ui')
# Load it
super(NuclearOperationsMainWindow, self).__init__()
uic.loadUi(ui_file, self)
self.show()
示例12: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_gated_counter_gui.ui')
# Load it
super(GatedCounterMainWindow, self).__init__()
uic.loadUi(ui_file, self)
self.show()
示例13: __init__
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Load the ui file and attach it to this instance
loadUi(os.path.join(os.path.dirname(__file__),
"ui", "export_size.ui"), self)
# Add some simple validators to the text boxes
self.height_line_edit.setValidator(QIntValidator())
self.width_line_edit.setValidator(QIntValidator())
示例14: __init__
def __init__(self):
# Get the path to the *.ui file
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_pulsed_extraction_external_gui.ui')
# Load it
super(PulsedExtractionExternalMainWindow, self).__init__()
uic.loadUi(ui_file, self)
self.show()
示例15: __init__
def __init__(self, manager=None, **kwargs):
"""Creates the log widget.
@param object parent: Qt parent object for log widet
"""
super().__init__(**kwargs)
self._manager = manager
this_dir = os.path.dirname(__file__)
ui_file = os.path.join(this_dir, 'ui_logwidget.ui')
# Load it
uic.loadUi(ui_file, self)
self.logLength = 1000
# Set up data model and visibility filter
self.model = LogModel()
self.filtermodel = LogFilter()
self.filtermodel.setSourceModel(self.model)
self.output.setModel(self.filtermodel)
# set up able view properties
# setResizeMode is deprecated in Qt5 (and therefore not available
# in pyqt5
if qtpy.PYQT4 or qtpy.PYSIDE:
self.output.horizontalHeader().setResizeMode(
0, QtWidgets.QHeaderView.Interactive)
self.output.horizontalHeader().setResizeMode(
1, QtWidgets.QHeaderView.ResizeToContents)
self.output.horizontalHeader().setResizeMode(
2, QtWidgets.QHeaderView.ResizeToContents)
self.output.horizontalHeader().setResizeMode(
3, QtWidgets.QHeaderView.ResizeToContents)
self.output.verticalHeader().setResizeMode(
QtWidgets.QHeaderView.ResizeToContents)
else:
self.output.horizontalHeader().setSectionResizeMode(
0, QtWidgets.QHeaderView.Interactive)
self.output.horizontalHeader().setSectionResizeMode(
1, QtWidgets.QHeaderView.ResizeToContents)
self.output.horizontalHeader().setSectionResizeMode(
2, QtWidgets.QHeaderView.ResizeToContents)
self.output.horizontalHeader().setSectionResizeMode(
3, QtWidgets.QHeaderView.ResizeToContents)
self.output.verticalHeader().setSectionResizeMode(
QtWidgets.QHeaderView.ResizeToContents)
self.output.setTextElideMode(QtCore.Qt.ElideRight)
self.output.setItemDelegate(AutoToolTipDelegate(self.output))
# connect signals
self.sigDisplayEntry.connect(self.displayEntry,
QtCore.Qt.QueuedConnection)
self.sigAddEntry.connect(self.addEntry, QtCore.Qt.QueuedConnection)
self.filterTree.itemChanged.connect(self.setCheckStates)