本文整理汇总了Python中qtpy.QtWidgets.QFrame.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.__init__方法的具体用法?Python QFrame.__init__怎么用?Python QFrame.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtWidgets.QFrame
的用法示例。
在下文中一共展示了QFrame.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent=None):
QFrame.__init__(self, parent)
PyDMPrimitiveWidget.__init__(self)
self._template_filename = ""
self._count_shown_in_designer = 1
self._data_source = ""
self._data = []
self._cached_template = None
self._layout_type = LayoutType.Vertical
self.app = QApplication.instance()
self.rebuild()
示例2: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent):
QFrame.__init__(self, parent)
self._webview = WebView(self)
layout = QHBoxLayout()
layout.addWidget(self._webview)
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
self.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
self._webview.linkClicked.connect(self.linkClicked)
示例3: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent=None):
QFrame.__init__(self, parent)
PyDMPrimitiveWidget.__init__(self)
self.app = QApplication.instance()
self._filename = None
self._macros = None
self._embedded_widget = None
self._disconnect_when_hidden = True
self._is_connected = False
self.layout = QVBoxLayout(self)
self.err_label = QLabel(self)
self.err_label.setAlignment(Qt.AlignHCenter)
self.layout.addWidget(self.err_label)
self.layout.setContentsMargins(0, 0, 0, 0)
self.err_label.hide()
if not is_pydm_app():
self.setFrameShape(QFrame.Box)
else:
self.setFrameShape(QFrame.NoFrame)
示例4: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent=None, init_channel=None):
QFrame.__init__(self, parent)
PyDMWritableWidget.__init__(self, init_channel=init_channel)
self.alarmSensitiveContent = True
self.alarmSensitiveBorder = False
# Internal values for properties
self._show_limit_labels = True
self._show_value_label = True
self._user_defined_limits = False
self._needs_limit_info = True
self._minimum = None
self._maximum = None
self._user_minimum = -10.0
self._user_maximum = 10.0
self._num_steps = 101
self._orientation = Qt.Horizontal
# Set up all the internal widgets that make up a PyDMSlider.
# We'll add all these things to layouts when we call setup_widgets_for_orientation
label_size_policy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Fixed)
self.low_lim_label = QLabel(self)
self.low_lim_label.setObjectName("lowLimLabel")
self.low_lim_label.setSizePolicy(label_size_policy)
self.low_lim_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter)
self.value_label = QLabel(self)
self.value_label.setObjectName("valueLabel")
self.value_label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
self.high_lim_label = QLabel(self)
self.high_lim_label.setObjectName("highLimLabel")
self.high_lim_label.setSizePolicy(label_size_policy)
self.high_lim_label.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter)
self._slider = QSlider(parent=self)
self._slider.setOrientation(Qt.Horizontal)
self._slider.sliderMoved.connect(self.internal_slider_moved)
self._slider.sliderPressed.connect(self.internal_slider_pressed)
self._slider.sliderReleased.connect(self.internal_slider_released)
self._slider.valueChanged.connect(self.internal_slider_value_changed)
# self.vertical_layout.addWidget(self._slider)
# Other internal variables and final setup steps
self._slider_position_to_value_map = None
self._mute_internal_slider_changes = False
self.setup_widgets_for_orientation(self._orientation)
self.reset_slider_limits()
示例5: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent=None, init_channel=None):
QFrame.__init__(self, parent)
PyDMWidget.__init__(self, init_channel=init_channel)
self._show_value = True
self._show_limits = True
self.scale_indicator = QScale()
self.value_label = QLabel()
self.lower_label = QLabel()
self.upper_label = QLabel()
self.value_label.setText('<val>')
self.lower_label.setText('<min>')
self.upper_label.setText('<max>')
self._value_position = Qt.TopEdge
self._limits_from_channel = True
self._user_lower_limit = 0
self._user_upper_limit = 0
self.value_label.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
self.setup_widgets_for_orientation(Qt.Horizontal, False, False, self._value_position)
示例6: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, img, layout='vertical', order=['R', 'G', 'B', 'V']):
QFrame.__init__(self)
r, g, b, v = histograms(img, 100)
self.r_hist = ColorHistogram(r, (255, 0, 0))
self.g_hist = ColorHistogram(g, (0, 255, 0))
self.b_hist = ColorHistogram(b, (0, 0, 255))
self.v_hist = ColorHistogram(v, (0, 0, 0))
self.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)
self.layout = QGridLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
order_map = {'R': self.r_hist, 'G': self.g_hist, 'B': self.b_hist,
'V': self.v_hist}
if layout == 'vertical':
for i in range(len(order)):
self.layout.addWidget(order_map[order[i]], i, 0)
elif layout == 'horizontal':
for i in range(len(order)):
self.layout.addWidget(order_map[order[i]], 0, i)
示例7: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self):
QFrame.__init__(self)
self.setFrameStyle(QFrame.Box | QFrame.Sunken)
self.posx_label = QLabel('X-pos:')
self.posx_value = QLabel()
self.posy_label = QLabel('Y-pos:')
self.posy_value = QLabel()
self.r_label = QLabel('R:')
self.r_value = QLabel()
self.g_label = QLabel('G:')
self.g_value = QLabel()
self.b_label = QLabel('B:')
self.b_value = QLabel()
self.h_label = QLabel('H:')
self.h_value = QLabel()
self.s_label = QLabel('S:')
self.s_value = QLabel()
self.v_label = QLabel('V:')
self.v_value = QLabel()
self.layout = QGridLayout(self)
self.layout.addWidget(self.posx_label, 0, 0)
self.layout.addWidget(self.posx_value, 0, 1)
self.layout.addWidget(self.posy_label, 1, 0)
self.layout.addWidget(self.posy_value, 1, 1)
self.layout.addWidget(self.r_label, 0, 2)
self.layout.addWidget(self.r_value, 0, 3)
self.layout.addWidget(self.g_label, 1, 2)
self.layout.addWidget(self.g_value, 1, 3)
self.layout.addWidget(self.b_label, 2, 2)
self.layout.addWidget(self.b_value, 2, 3)
self.layout.addWidget(self.h_label, 0, 4)
self.layout.addWidget(self.h_value, 0, 5)
self.layout.addWidget(self.s_label, 1, 4)
self.layout.addWidget(self.s_value, 1, 5)
self.layout.addWidget(self.v_label, 2, 4)
self.layout.addWidget(self.v_value, 2, 5)
示例8: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent=None):
QFrame.__init__(self, parent)
self.ui = load_ui(__file__, '../../../ui/inelastic/dgs_data_corrections.ui', baseinstance=self)
示例9: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, parent=None, init_channel=None):
QFrame.__init__(self, parent)
PyDMWidget.__init__(self, init_channel=init_channel)
self._disable_on_disconnect = False
self.alarmSensitiveBorder = False
示例10: __init__
# 需要导入模块: from qtpy.QtWidgets import QFrame [as 别名]
# 或者: from qtpy.QtWidgets.QFrame import __init__ [as 别名]
def __init__(self, img):
QFrame.__init__(self)
# self.setFrameStyle(QFrame.Box | QFrame.Sunken)
self.img = img
self.mixer = ColorMixer(self.img)
self.callback = None
#---------------------------------------------------------------
# ComboBox
#---------------------------------------------------------------
self.combo_box_entries = ['RGB Color', 'HSV Color',
'Brightness/Contrast',
'Gamma',
'Gamma (Sigmoidal)']
self.combo_box = QComboBox()
for entry in self.combo_box_entries:
self.combo_box.addItem(entry)
self.combo_box.currentIndexChanged.connect(self.combo_box_changed)
#---------------------------------------------------------------
# RGB color sliders
#---------------------------------------------------------------
# radio buttons
self.rgb_add = QRadioButton('Additive')
self.rgb_mul = QRadioButton('Multiplicative')
self.rgb_mul.toggled.connect(self.rgb_radio_changed)
self.rgb_add.toggled.connect(self.rgb_radio_changed)
# sliders
rs = IntelligentSlider('R', 0.51, -255, self.rgb_changed)
gs = IntelligentSlider('G', 0.51, -255, self.rgb_changed)
bs = IntelligentSlider('B', 0.51, -255, self.rgb_changed)
self.rs = rs
self.gs = gs
self.bs = bs
self.rgb_widget = QWidget()
self.rgb_widget.layout = QGridLayout(self.rgb_widget)
self.rgb_widget.layout.addWidget(self.rgb_add, 0, 0, 1, 3)
self.rgb_widget.layout.addWidget(self.rgb_mul, 1, 0, 1, 3)
self.rgb_widget.layout.addWidget(self.rs, 2, 0)
self.rgb_widget.layout.addWidget(self.gs, 2, 1)
self.rgb_widget.layout.addWidget(self.bs, 2, 2)
#---------------------------------------------------------------
# HSV sliders
#---------------------------------------------------------------
# radio buttons
self.hsv_add = QRadioButton('Additive')
self.hsv_mul = QRadioButton('Multiplicative')
self.hsv_mul.toggled.connect(self.hsv_radio_changed)
self.hsv_mul.toggled.connect(self.hsv_radio_changed)
# sliders
hs = IntelligentSlider('H', 0.36, -180, self.hsv_changed)
ss = IntelligentSlider('S', 0.002, 0, self.hsv_changed)
vs = IntelligentSlider('V', 0.002, 0, self.hsv_changed)
self.hs = hs
self.ss = ss
self.vs = vs
self.hsv_widget = QWidget()
self.hsv_widget.layout = QGridLayout(self.hsv_widget)
self.hsv_widget.layout.addWidget(self.hsv_add, 0, 0, 1, 3)
self.hsv_widget.layout.addWidget(self.hsv_mul, 1, 0, 1, 3)
self.hsv_widget.layout.addWidget(self.hs, 2, 0)
self.hsv_widget.layout.addWidget(self.ss, 2, 1)
self.hsv_widget.layout.addWidget(self.vs, 2, 2)
#---------------------------------------------------------------
# Brightness/Contrast sliders
#---------------------------------------------------------------
# sliders
cont = IntelligentSlider('x', 0.002, 0, self.bright_changed)
bright = IntelligentSlider('+', 0.51, -255, self.bright_changed)
self.cont = cont
self.bright = bright
# layout
self.bright_widget = QWidget()
self.bright_widget.layout = QGridLayout(self.bright_widget)
self.bright_widget.layout.addWidget(self.cont, 0, 0)
self.bright_widget.layout.addWidget(self.bright, 0, 1)
#----------------------------------------------------------------------
# Gamma Slider
#----------------------------------------------------------------------
gamma = IntelligentSlider('gamma', 0.005, 0, self.gamma_changed)
self.gamma = gamma
# layout
self.gamma_widget = QWidget()
self.gamma_widget.layout = QGridLayout(self.gamma_widget)
self.gamma_widget.layout.addWidget(self.gamma, 0, 0)
#---------------------------------------------------------------
# Sigmoid Gamma sliders
#.........这里部分代码省略.........