本文整理汇总了Python中widgets.Qt4_data_path_widget.DataPathWidget.setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:Python DataPathWidget.setFixedHeight方法的具体用法?Python DataPathWidget.setFixedHeight怎么用?Python DataPathWidget.setFixedHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类widgets.Qt4_data_path_widget.DataPathWidget
的用法示例。
在下文中一共展示了DataPathWidget.setFixedHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EnergyScanParametersWidget
# 需要导入模块: from widgets.Qt4_data_path_widget import DataPathWidget [as 别名]
# 或者: from widgets.Qt4_data_path_widget.DataPathWidget import setFixedHeight [as 别名]
class EnergyScanParametersWidget(QtGui.QWidget):
def __init__(self, parent = None, name = "energy_scan_tab_widget"):
QtGui.QWidget.__init__(self, parent)
if name is not None:
self.setObjectName(name)
# Hardware objects ----------------------------------------------------
# Internal variables --------------------------------------------------
self.energy_scan_model = queue_model_objects.EnergyScan()
self._tree_view_item = None
# Graphic elements ----------------------------------------------------
_top_widget = QtGui.QWidget(self)
_parameters_widget = QtGui.QWidget(_top_widget)
self.periodic_table_widget = PeriodicTableWidget(_parameters_widget)
self.data_path_widget = DataPathWidget(_parameters_widget)
# LNLS
# self.data_path_widget.data_path_layout.file_name_label.setText('')
# self.data_path_widget.data_path_layout.file_name_label.hide()
# self.data_path_widget.data_path_layout.file_name_value_label.hide()
# ---------------------------------------------------------------------
# LNLS
self.data_path_widget.setFixedHeight(140)
# ---------------------------------------------------------------------
_snapshot_widget = QtGui.QWidget(self)
# Snapshot of current position
self.position_widget = uic.loadUi(os.path.join(os.path.dirname(__file__),
'ui_files/Qt4_snapshot_widget_layout.ui'))
# LNLS
self.position_widget.setFixedSize(450, 340)
# Graphics
self.scan_plot_widget = TwoAxisPlotWidget(self, True)
self.result_plot_widget = TwoAxisPlotWidget(self, False)
# Layout -------------------------------------------------------------
_parameters_widget_layout = QtGui.QVBoxLayout()
_parameters_widget_layout.addWidget(self.periodic_table_widget)
_parameters_widget_layout.addWidget(self.data_path_widget)
_parameters_widget_layout.addStretch(0)
_parameters_widget_layout.setSpacing(2)
_parameters_widget_layout.setContentsMargins(0, 0, 0, 0)
_parameters_widget.setLayout(_parameters_widget_layout)
_snapshots_vlayout = QtGui.QVBoxLayout(_snapshot_widget)
_snapshots_vlayout.addWidget(self.position_widget)
_snapshots_vlayout.setContentsMargins(0, 0, 0, 0)
_snapshots_vlayout.setSpacing(2)
# LNLS
# _snapshots_vlayout.addStretch(10)
_snapshots_vlayout.addStretch(0)
_snapshot_widget.setLayout(_snapshots_vlayout)
# ----
_top_widget_hlayout = QtGui.QHBoxLayout(self)
_top_widget_hlayout.addWidget(_parameters_widget)
_top_widget_hlayout.addWidget(_snapshot_widget)
_top_widget_hlayout.addStretch(0)
_top_widget_hlayout.setSpacing(2)
_top_widget_hlayout.setContentsMargins(0, 0, 0, 0)
_top_widget.setLayout(_top_widget_hlayout)
_main_vlayout = QtGui.QVBoxLayout(self)
_main_vlayout.addWidget(_top_widget)
_main_vlayout.addWidget(self.scan_plot_widget)
_main_vlayout.addWidget(self.result_plot_widget)
_main_vlayout.setSpacing(5)
_main_vlayout.setContentsMargins(2, 2, 2, 2)
_main_vlayout.addStretch(0)
self.setLayout(_main_vlayout)
# SizePolicies --------------------------------------------------------
self.scan_plot_widget.setSizePolicy(QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Expanding)
self.result_plot_widget.setSizePolicy(QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Expanding)
# Qt signal/slot connections ------------------------------------------
#qt.QObject.connect(self.periodic_table_widget, qt.PYSIGNAL('edgeSelected'),
# self.element_clicked)
self.data_path_widget.data_path_layout.prefix_ledit.\
textChanged.connect(self._prefix_ledit_change)
self.data_path_widget.data_path_layout.run_number_ledit.\
textChanged.connect(self._run_number_ledit_change)
# Other ---------------------------------------------------------------
def _prefix_ledit_change(self, new_value):
self.energy_scan_model.set_name(str(new_value))
self._tree_view_item.setText(0, self.energy_scan_model.get_name())
#.........这里部分代码省略.........