本文整理汇总了Python中PyQt5.Qt.QScrollArea.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QScrollArea.__init__方法的具体用法?Python QScrollArea.__init__怎么用?Python QScrollArea.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QScrollArea
的用法示例。
在下文中一共展示了QScrollArea.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.Qt import QScrollArea [as 别名]
# 或者: from PyQt5.Qt.QScrollArea import __init__ [as 别名]
def __init__(self, parent=None):
QScrollArea.__init__(self, parent)
self.setWidgetResizable(True)
category_map, category_names = {}, {}
for plugin in preferences_plugins():
if plugin.category not in category_map:
category_map[plugin.category] = plugin.category_order
if category_map[plugin.category] < plugin.category_order:
category_map[plugin.category] = plugin.category_order
if plugin.category not in category_names:
category_names[plugin.category] = (plugin.gui_category if
plugin.gui_category else plugin.category)
self.category_names = category_names
categories = list(category_map.keys())
categories.sort(key=lambda x: category_map[x])
self.category_map = OrderedDict()
for c in categories:
self.category_map[c] = []
for plugin in preferences_plugins():
self.category_map[plugin.category].append(plugin)
for plugins in self.category_map.values():
plugins.sort(key=lambda x: x.name_order)
self.widgets = []
self._layout = QVBoxLayout()
self.container = QWidget(self)
self.container.setLayout(self._layout)
self.setWidget(self.container)
for name, plugins in self.category_map.items():
w = Category(name, plugins, self.category_names[name], parent=self)
self.widgets.append(w)
self._layout.addWidget(w)
w.plugin_activated.connect(self.show_plugin.emit)
self._layout.addStretch(1)
示例2: __init__
# 需要导入模块: from PyQt5.Qt import QScrollArea [as 别名]
# 或者: from PyQt5.Qt.QScrollArea import __init__ [as 别名]
def __init__(self, parent=None):
QScrollArea.__init__(self, parent)
self.setWidgetResizable(True)
self.w = QWidget(self)
self.l = QGridLayout(self.w)
self.setWidget(self.w)
示例3: __init__
# 需要导入模块: from PyQt5.Qt import QScrollArea [as 别名]
# 或者: from PyQt5.Qt.QScrollArea import __init__ [as 别名]
def __init__(self, widget=None, parent=None):
QScrollArea.__init__(self, parent)
self.setFrameShape(self.NoFrame)
self.setWidgetResizable(True)
if widget is not None:
self.setWidget(widget)