本文整理汇总了Python中AnyQt.QtWidgets.QGraphicsView.viewport方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsView.viewport方法的具体用法?Python QGraphicsView.viewport怎么用?Python QGraphicsView.viewport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtWidgets.QGraphicsView
的用法示例。
在下文中一共展示了QGraphicsView.viewport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OWBoxPlot
# 需要导入模块: from AnyQt.QtWidgets import QGraphicsView [as 别名]
# 或者: from AnyQt.QtWidgets.QGraphicsView import viewport [as 别名]
#.........这里部分代码省略.........
gui.checkBox(self.display_box, self, "show_annotations", "Annotate",
callback=self.display_changed)
self.compare_rb = gui.radioButtonsInBox(
self.display_box, self, 'compare',
btnLabels=["No comparison", "Compare medians", "Compare means"],
callback=self.layout_changed)
# The vertical size policy is needed to let only the list views expand
self.stretching_box = box = gui.vBox(
self.controlArea, box="Display",
sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Fixed))
self.stretching_box.sizeHint = self.display_box.sizeHint
gui.checkBox(
box, self, 'stretched', "Stretch bars",
callback=self.display_changed)
gui.checkBox(
box, self, 'show_labels', "Show box labels",
callback=self.display_changed)
self.sort_cb = gui.checkBox(
box, self, 'sort_freqs', "Sort by subgroup frequencies",
callback=self.display_changed)
gui.rubber(box)
gui.auto_commit(self.controlArea, self, "auto_commit",
"Send Selection", "Send Automatically")
gui.vBox(self.mainArea, addSpace=True)
self.box_scene = QGraphicsScene()
self.box_scene.selectionChanged.connect(self.commit)
self.box_view = QGraphicsView(self.box_scene)
self.box_view.setRenderHints(QPainter.Antialiasing |
QPainter.TextAntialiasing |
QPainter.SmoothPixmapTransform)
self.box_view.viewport().installEventFilter(self)
self.mainArea.layout().addWidget(self.box_view)
e = gui.hBox(self.mainArea, addSpace=False)
self.infot1 = gui.widgetLabel(e, "<center>No test results.</center>")
self.mainArea.setMinimumWidth(300)
self.stats = self.dist = self.conts = []
self.is_continuous = False
self.update_display_box()
def sizeHint(self):
return QSize(900, 500)
def eventFilter(self, obj, event):
if obj is self.box_view.viewport() and \
event.type() == QEvent.Resize:
self.layout_changed()
return super().eventFilter(obj, event)
def reset_attrs(self, domain):
self.attrs[:] = [
var for var in chain(
domain.class_vars, domain.metas, domain.attributes)
if var.is_primitive()]
# noinspection PyTypeChecker
@Inputs.data
def set_data(self, dataset):
if dataset is not None and (