当前位置: 首页>>代码示例>>Python>>正文


Python QFormLayout.setVerticalSpacing方法代码示例

本文整理汇总了Python中AnyQt.QtWidgets.QFormLayout.setVerticalSpacing方法的典型用法代码示例。如果您正苦于以下问题:Python QFormLayout.setVerticalSpacing方法的具体用法?Python QFormLayout.setVerticalSpacing怎么用?Python QFormLayout.setVerticalSpacing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnyQt.QtWidgets.QFormLayout的用法示例。


在下文中一共展示了QFormLayout.setVerticalSpacing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from AnyQt.QtWidgets import QFormLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QFormLayout import setVerticalSpacing [as 别名]
    def __init__(self):
        super().__init__()
        self.selected_node = None
        self.root_node = None
        self.model = None

        box = gui.vBox(
            self.controlArea, 'Tree', addSpace=20,
            sizePolicy=QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed))
        self.infolabel = gui.widgetLabel(box, 'No tree.')

        layout = QFormLayout()
        layout.setVerticalSpacing(20)
        layout.setFieldGrowthPolicy(layout.ExpandingFieldsGrow)
        box = self.display_box = \
            gui.widgetBox(self.controlArea, "Display", addSpace=True,
                          orientation=layout)
        layout.addRow(
            "Zoom: ",
            gui.hSlider(box, self, 'zoom',
                        minValue=1, maxValue=10, step=1, ticks=False,
                        callback=self.toggle_zoom_slider,
                        createLabel=False, addToLayout=False, addSpace=False))
        layout.addRow(
            "Width: ",
            gui.hSlider(box, self, 'max_node_width',
                        minValue=50, maxValue=200, step=1, ticks=False,
                        callback=self.toggle_node_size,
                        createLabel=False, addToLayout=False, addSpace=False))
        policy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
        layout.addRow(
            "Depth: ",
            gui.comboBox(box, self, 'max_tree_depth',
                         items=["Unlimited"] + [
                             "{} levels".format(x) for x in range(2, 10)],
                         addToLayout=False, sendSelectedValue=False,
                         callback=self.toggle_tree_depth, sizePolicy=policy))
        layout.addRow(
            "Edge width: ",
            gui.comboBox(box, self, 'line_width_method',
                         items=['Fixed', 'Relative to root',
                                'Relative to parent'],
                         addToLayout=False,
                         callback=self.toggle_line_width, sizePolicy=policy))
        gui.rubber(self.controlArea)
        self.resize(800, 500)

        self.scene = TreeGraphicsScene(self)
        self.scene_view = TreeGraphicsView(self.scene)
        self.scene_view.setViewportUpdateMode(QGraphicsView.FullViewportUpdate)
        self.mainArea.layout().addWidget(self.scene_view)
        self.toggle_zoom_slider()
        self.scene.selectionChanged.connect(self.update_selection)
开发者ID:janezd,项目名称:orange3,代码行数:55,代码来源:owtreeviewer2d.py

示例2: add_main_layout

# 需要导入模块: from AnyQt.QtWidgets import QFormLayout [as 别名]
# 或者: from AnyQt.QtWidgets.QFormLayout import setVerticalSpacing [as 别名]
    def add_main_layout(self):
        form = QFormLayout()
        form.setFieldGrowthPolicy(form.AllNonFixedFieldsGrow)
        form.setVerticalSpacing(25)
        form.setLabelAlignment(Qt.AlignLeft)
        gui.widgetBox(self.controlArea, True, orientation=form)
        form.addRow(
            "Neurons in hidden layers:",
            gui.lineEdit(
                None, self, "hidden_layers_input",
                orientation=Qt.Horizontal, callback=self.settings_changed,
                tooltip="A list of integers defining neurons. Length of list "
                        "defines the number of layers. E.g. 4, 2, 2, 3.",
                placeholderText="e.g. 10,"))
        form.addRow(
            "Activation:",
            gui.comboBox(
                None, self, "activation_index", orientation=Qt.Horizontal,
                label="Activation:", items=[i for i in self.act_lbl],
                callback=self.settings_changed))

        form.addRow(" ", gui.separator(None, 16))
        form.addRow(
            "Solver:",
            gui.comboBox(
                None, self, "solver_index", orientation=Qt.Horizontal,
                label="Solver:", items=[i for i in self.solv_lbl],
                callback=self.settings_changed))
        self.reg_label = QLabel()
        slider = gui.hSlider(
            None, self, "alpha_index",
            minValue=0, maxValue=len(self.alphas) - 1,
            callback=lambda: (self.set_alpha(), self.settings_changed()),
            createLabel=False)
        form.addRow(self.reg_label, slider)
        self.set_alpha()

        form.addRow(
            "Maximal number of iterations:",
            gui.spin(
                None, self, "max_iterations", 10, 10000, step=10,
                label="Max iterations:", orientation=Qt.Horizontal,
                alignment=Qt.AlignRight, callback=self.settings_changed))

        form.addRow(gui.separator(None))
        form.addRow(
            gui.checkBox(
                None, self, "replicable", label="Replicable training", callback=self.settings_changed),
        )
开发者ID:biolab,项目名称:orange3,代码行数:51,代码来源:owneuralnetwork.py


注:本文中的AnyQt.QtWidgets.QFormLayout.setVerticalSpacing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。