How to use the qtpy.QtWidgets.QVBoxLayout function in QtPy

To help you get started, we’ve selected a few QtPy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github avalentino / gsdview / tests / test_gdalbackend_widgets.py View on Github external
def test_gdalinfowidget():
    app = QtWidgets.QApplication(sys.argv)
    dialog = QtWidgets.QDialog()
    layout = QtWidgets.QVBoxLayout()
    layout.addWidget(GDALInfoWidget())
    dialog.setLayout(layout)
    dialog.resize(500, 400)
    dialog.show()
    app.exec_()
github slaclab / pydm / pydm / widgets / rules_editor.py View on Github external
cancel_btn.clicked.connect(self.cancelChanges)
        buttons_layout.addStretch()
        buttons_layout.addWidget(cancel_btn)
        buttons_layout.addWidget(save_btn)

        vlayout.addLayout(buttons_layout)

        # Creating the widgets that we will use to compose the
        # rule parameters
        self.frm_edit = QtWidgets.QFrame()
        self.frm_edit.setEnabled(False)
        self.frm_edit.setLineWidth(1)
        self.frm_edit.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frm_edit.setFrameShape(QtWidgets.QFrame.StyledPanel)

        frm_edit_layout = QtWidgets.QVBoxLayout()
        self.frm_edit.setLayout(frm_edit_layout)

        hlayout.addWidget(self.frm_edit)

        edit_name_layout = QtWidgets.QFormLayout()
        edit_name_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
        lbl_name = QtWidgets.QLabel("Rule Name:")
        self.txt_name = QtWidgets.QLineEdit()
        self.txt_name.editingFinished.connect(self.name_changed)
        edit_name_layout.addRow(lbl_name, self.txt_name)
        lbl_property = QtWidgets.QLabel("Property:")
        self.cmb_property = QtWidgets.QComboBox()
        for name, prop in self.available_properties.items():
            self.cmb_property.addItem(name, prop)
        edit_name_layout.addRow(lbl_property, self.cmb_property)
github hydrusnetwork / hydrus / hydrus / client / gui / QtPorting.py View on Github external
def __init__( self, parent, about_info ):
        
        QW.QDialog.__init__( self, parent )
        
        self.setWindowFlag( QC.Qt.WindowContextHelpButtonHint, on = False )
        
        self.setAttribute( QC.Qt.WA_DeleteOnClose )
        
        self.setWindowIcon( QG.QIcon( HG.client_controller.frame_icon_pixmap ) )
        
        layout = QW.QVBoxLayout( self )
        
        self.setWindowTitle( 'About ' + about_info.name )
        
        icon_label = QW.QLabel( self )
        name_label = QW.QLabel( about_info.name, self )
        version_label = QW.QLabel( about_info.version, self )
        tabwidget = QW.QTabWidget( self )
        desc_panel = QW.QWidget( self )
        desc_label = QW.QLabel( about_info.description, self )
        url_label = QW.QLabel( '<a href="{0}">{0}</a>'.format( about_info.website ), self )
        credits = QW.QTextEdit( self )
        license = QW.QTextEdit( self )
        close_button = QW.QPushButton( 'close', self )
        icon_label.setPixmap( HG.client_controller.frame_icon_pixmap )
        layout.addWidget( icon_label, alignment = QC.Qt.AlignHCenter )
github SteveDoyle2 / pyNastran / pyNastran / gui / menus / preferences / preferences.py View on Github external
grid_nastran.addWidget(self.nastran_is_element_quality_checkbox, irow, 0)
        grid_nastran.addWidget(self.nastran_is_properties_checkbox, irow, 1)
        irow += 1

        grid_nastran.addWidget(self.nastran_is_bar_axes_checkbox, irow, 0)
        irow += 1

        grid_nastran.addWidget(self.nastran_is_shell_mcid_checkbox, irow, 0)
        irow += 1

        grid_nastran.addWidget(self.nastran_is_3d_bars_checkbox, irow, 0)
        grid_nastran.addWidget(self.nastran_is_3d_bars_update_checkbox, irow, 1)
        irow += 1

        #bold_font = make_font(self._default_font_size, is_bold=True)
        vbox_nastran = QVBoxLayout()
        self.nastran_label = QLabel('Nastran:')
        vbox_nastran.addWidget(self.nastran_label)
        vbox_nastran.addLayout(grid_nastran)

        #self.create_legend_widgets()
        #grid2 = self.create_legend_layout()
        ok_cancel_box = QHBoxLayout()
        ok_cancel_box.addWidget(self.apply_button)
        ok_cancel_box.addWidget(self.ok_button)
        ok_cancel_box.addWidget(self.cancel_button)

        vbox = QVBoxLayout()
        vbox.addLayout(grid)
        vbox.addLayout(vbox_nastran)
        #vbox.addStretch()
        #vbox.addLayout(grid2)
github Dioptas / Dioptas / dioptas / widgets / integration / control / PhaseWidget.py View on Github external
self.phase_tw.setColumnWidth(0, 20)
        self.phase_tw.setColumnWidth(1, 25)
        self.phase_tw.horizontalHeader().setResizeMode(2, QtWidgets.QHeaderView.Stretch)
        self.phase_tw.horizontalHeader().setResizeMode(3, QtWidgets.QHeaderView.ResizeToContents)
        self.phase_tw.horizontalHeader().setResizeMode(4, QtWidgets.QHeaderView.ResizeToContents)
        self.phase_tw.setItemDelegate(NoRectDelegate())
        self._body_layout.addWidget(self.phase_tw, 10)
        self._body_layout.addWidget(self.parameter_widget, 0)

        self._layout.addLayout(self._body_layout)

        # label for alternative view:
        self.phase_header_btn = FlatButton('Phase')
        self.phase_header_btn.setEnabled(False)
        self.phase_header_btn.setVisible(False)
        self._main_layout = QtWidgets.QVBoxLayout()
        self._main_layout.setContentsMargins(0, 0, 0, 0)
        self._main_layout.addWidget(self.phase_header_btn)
        self._main_layout.addLayout(self._layout)
        self.setLayout(self._main_layout)
        self.style_widgets()
        self.add_tooltips()

        self.phase_show_cbs = []
        self.phase_color_btns = []
        self.pressure_sbs = []
        self.temperature_sbs = []

        self.show_parameter_in_pattern = True
github slaclab / pydm / pydm / widgets / channel_editor.py View on Github external
self.setLayout(vlayout)

        hlayout = QtWidgets.QHBoxLayout()
        hlayout.setContentsMargins(0, 0, 0, 0)
        hlayout.setSpacing(5)
        vlayout.addLayout(hlayout)

        # Creating the widgets for the String List and
        # buttons to add and remove actions
        self.list_frame = QtWidgets.QFrame(parent=self)
        self.list_frame.setMinimumHeight(300)
        self.list_frame.setMaximumWidth(200)
        self.list_frame.setLineWidth(1)
        self.list_frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.list_frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        lf_layout = QtWidgets.QVBoxLayout()
        self.list_frame.setLayout(lf_layout)

        self.lst_channels = QtWidgets.QListWidget()
        self.lst_channels.setSizePolicy(
            QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                  QtWidgets.QSizePolicy.Expanding)
        )
        self.lst_channels.itemSelectionChanged.connect(self.load_from_list)
        lf_layout.addWidget(self.lst_channels)

        hlayout.addWidget(self.list_frame)

        buttons_layout = QtWidgets.QHBoxLayout()
        save_btn = QtWidgets.QPushButton("Save", parent=self)
        save_btn.setAutoDefault(False)
        save_btn.setDefault(False)
github Ulm-IQO / qudi / gui / manager / managergui.py View on Github external
"""
        # Get the path to the *.ui file
        this_dir = os.path.dirname(__file__)
        ui_file = os.path.join(this_dir, 'ui_manager_window.ui')

        # Load it
        super(ManagerMainWindow, self).__init__()
        uic.loadUi(ui_file, self)
        self.show()

        # Set up the layout
        # this really cannot be done in Qt designer, you cannot set a layout
        # on an empty widget
        self.guilayout = QtWidgets.QVBoxLayout(self.guiscroll)
        self.logiclayout = QtWidgets.QVBoxLayout(self.logicscroll)
        self.hwlayout = QtWidgets.QVBoxLayout(self.hwscroll)
github Fluorescence-Tools / chisurf / chisurf / plots / proteinMC.py View on Github external
def __init__(self, fit):
        super().__init__(
            fit=fit
        )

        self.trajectory = fit.model
        self.source = fit.model

        self.layout = QtWidgets.QVBoxLayout(self)
        area = DockArea()
        self.layout.addWidget(area)
        hide_title = chisurf.settings.gui['plot']['hideTitle']
        d1 = Dock("RMSD")
        d2 = Dock("dRMSD")
        d3 = Dock("Energy")
        d4 = Dock("FRET")

        p1 = pg.PlotWidget()
        p2 = pg.PlotWidget()
        p3 = pg.PlotWidget()
        p4 = pg.PlotWidget()

        d1.addWidget(p1)
        d2.addWidget(p2)
        d3.addWidget(p3)
github spyder-ide / spyder / spyder / plugins / editor.py View on Github external
'realtime_analysis', True)
        saveonly_radio = self.create_radiobutton(
                                            _("Perform analysis only "
                                                    "when saving file"),
                                            'onsave_analysis')
        af_spin = self.create_spinbox("", _(" ms"), 'realtime_analysis/timeout',
                                      min_=100, max_=1000000, step=100)
        af_layout = QHBoxLayout()
        af_layout.addWidget(realtime_radio)
        af_layout.addWidget(af_spin)
        
        run_layout = QVBoxLayout()
        run_layout.addWidget(saveall_box)
        run_group.setLayout(run_layout)
        
        run_selection_layout = QVBoxLayout()
        run_selection_layout.addWidget(focus_box)
        run_selection_group.setLayout(run_selection_layout)
        
        introspection_layout = QVBoxLayout()
        if rope_is_installed:
            introspection_layout.addWidget(calltips_box)
            introspection_layout.addWidget(completion_box)
            introspection_layout.addWidget(case_comp_box)
            introspection_layout.addWidget(comp_enter_box)
            introspection_layout.addWidget(gotodef_box)
        else:
            introspection_layout.addWidget(rope_label)
        introspection_group.setLayout(introspection_layout)
        
        analysis_layout = QVBoxLayout()
        analysis_layout.addWidget(pyflakes_box)
github lneuhaus / pyrpl / pyrpl / widgets / pyrpl_widget.py View on Github external
self.setDockNestingEnabled(True)  # allow dockwidget nesting
        self.setAnimated(True)  # animate docking of dock widgets

        self.dock_widgets = {}
        self.last_docked = None

        self.menu_modules = self.menuBar().addMenu("Modules")
        self.module_actions = []

        for module in self.parent.software_modules:
            self.add_dock_widget(module._create_widget, module.name)
        # self.showMaximized()  # maximized by default

        self.centralwidget = QtWidgets.QFrame()
        self.setCentralWidget(self.centralwidget)
        self.centrallayout = QtWidgets.QVBoxLayout()
        self.centrallayout.setAlignment(QtCore.Qt.AlignCenter)
        self.centralwidget.setLayout(self.centrallayout)
        self.centralbutton = QtWidgets.QPushButton('Click on "Modules" in the '
                                             'upper left corner to load a '
                                             'specific PyRPL module!')
        self.centralbutton.clicked.connect(self.click_menu_modules)
        self.centrallayout.addWidget(self.centralbutton)

        self.set_window_position()
        self.timer_save_pos = QtCore.QTimer()
        self.timer_save_pos.setInterval(1000)
        self.timer_save_pos.timeout.connect(self.save_window_position)
        self.timer_save_pos.start()

        self.timer_toolbar = QtCore.QTimer()
        self.timer_toolbar.setInterval(1000)