本文整理汇总了Python中PyQt5.QtWidgets.QStackedWidget.setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:Python QStackedWidget.setFixedHeight方法的具体用法?Python QStackedWidget.setFixedHeight怎么用?Python QStackedWidget.setFixedHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QStackedWidget
的用法示例。
在下文中一共展示了QStackedWidget.setFixedHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainView
# 需要导入模块: from PyQt5.QtWidgets import QStackedWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QStackedWidget import setFixedHeight [as 别名]
#.........这里部分代码省略.........
# create dropdowns
for combobox in alg.drop_downs:
empty_flag = False
#print(alg.get_name() + ": add combobox.")
groupOfSliderssLayout.addWidget(
ComboBoxWidget(combobox.name, combobox.options, combobox.set_value, combobox.value), 0, Qt.AlignTop)
if empty_flag:
label = QLabel()
label.setText("This algorithm has no Settings.")
groupOfSliderssLayout.addWidget(label, 0, Qt.AlignHCenter)
groupOfSliders.setLayout(groupOfSliderssLayout)
return groupOfSliders
def create_cat_alg_dropdown(self, cat_position, pipe_entry_widget, settings_widget):
"""
Args:
last_cat (object):
"""
layout = self.select_cat_alg_vbox_layout
cat = self.pipeline.executed_cats[cat_position]
last_cat = None
# Show only allowed categories in dropdown
if len(self.pipeline.executed_cats) > 1:
last_cat = self.pipeline.executed_cats[cat_position - 1]
# Combobox for selecting Category
self.ComboxCategories.show()
self.ComboxCategories.setFixedHeight(30)
self.ComboxCategories.addItem("<Please Select Category>")
self.stackedWidgetComboxesAlgorithms = QStackedWidget()
self.stackedWidgetComboxesAlgorithms.setFixedHeight(30)
self.stackedWidgetComboxesAlgorithms.hide()
def setCurrentIndexCat(index):
#print("Set Cat")
if self.ComboxCategories.currentIndex() == 0:
self.stackedWidgetComboxesAlgorithms.hide()
else:
self.stackedWidgetComboxesAlgorithms.show()
self.stackedWidgetComboxesAlgorithms.setCurrentIndex(index - 1)
for category_name in self.pipeline.report_available_cats(last_cat):
# Add Category to combobox
self.ComboxCategories.addItem(category_name)
tmp1 = QComboBox()
tmp1.addItem("<Please Select Algorithm>")
tmp1.setFixedHeight(30)
category = self.pipeline.get_category(category_name)
#self.current_index = -1
def setCurrentIndexAlg(index):
if self.ComboxCategories.currentIndex() == 0 or self.stackedWidgetComboxesAlgorithms.currentWidget().currentIndex() == 0:
pass
else: #self.current_index != index:
self.change_pip_entry_alg(self.pipeline.get_index(cat), self.ComboxCategories.currentText(),
self.stackedWidgetComboxesAlgorithms.currentWidget().currentText(),
pipe_entry_widget, settings_widget)
#self.current_index = index