How to use the qtpy.QtWidgets.QWidget 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 Ulm-IQO / qudi / gui / testgui.py View on Github external
def on_activate(self):
        """This creates all the necessary UI elements.
        """
        self._mw = QtWidgets.QMainWindow()
        self._mw.setGeometry(300,300,500,100)
        self._mw.setWindowTitle('TEST')
        self.cwdget = QtWidgets.QWidget()
        self.button = QtWidgets.QPushButton(self.buttonText)
        self.buttonerror = QtWidgets.QPushButton('Giff Error!')
        self.checkbutton = QtWidgets.QPushButton('Status Error')
        self.checkbutton.setCheckable(True)
        self.button.clicked.connect(self.handleButton)
        self.buttonerror.clicked.connect(self.handleButtonError)
        self.layout = QtWidgets.QVBoxLayout()
        self.layout.addWidget(self.button)
        self.layout.addWidget(self.buttonerror)
        self.layout.addWidget(self.checkbutton)
        self.cwdget.setLayout(self.layout)
        self._mw.setCentralWidget(self.cwdget)
        self._mw.show()
github Fluorescence-Tools / chisurf / chisurf / structure / potential / widgets.py View on Github external
return int(self.spinBox_2.value())

    @n_av_samples.setter
    def n_av_samples(self, v):
        self.spinBox_2.setValue(int(v))

    @property
    def min_av(self):
        return int(self.spinBox_2.value())

    @min_av.setter
    def min_av(self, v):
        self.spinBox.setValue(int(v))


class AsaWidget(ASA, QtWidgets.QWidget):

    def __init__(
            self,
            structure: chisurf.structure.Structure,
            parent: QtWidgets.QWidget = None,
            **kwargs
    ):
        super(QtWidgets.QWidget, self).__init__(
            parent=parent
        )
        uic.loadUi(
            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),
                "Potential_Asa.ui"
            ),
            self
github Fluorescence-Tools / chisurf / chisurf / structure / potential / widgets.py View on Github external
return float(self.doubleSpinBox.value())

    @cutoffH.setter
    def cutoffH(self, v):
        self.doubleSpinBox.setValue(float(v))

    @property
    def cutoffCA(self):
        return float(self.doubleSpinBox_2.value())

    @cutoffCA.setter
    def cutoffCA(self, v):
        self.doubleSpinBox_2.setValue(float(v))


class GoPotentialWidget(GoPotential, QtWidgets.QWidget):

    @chisurf.decorators.init_with_ui(
        ui_filename="Potential-CaLJ.ui"
    )
    def __init__(
            self,
            structure: chisurf.structure.Structure = None,
            **kwargs
    ):
        self.lineEdit.textChanged['QString'].connect(self.setGo)
        self.lineEdit_2.textChanged['QString'].connect(self.setGo)
        self.lineEdit_3.textChanged['QString'].connect(self.setGo)

    @property
    def native_cutoff_on(self):
        return bool(self.checkBox.isChecked())
github ColinDuquesnoy / QDarkStyleSheet / example / ui / dw_containers_tabs_ui.py View on Github external
self.tabWidgetNorth.addTab(self.tab_8, "")
        self.gridLayout_5.addWidget(self.tabWidgetNorth, 1, 0, 1, 1)
        self.tabWidgetNorth_2 = QtWidgets.QTabWidget(self.dockWidgetContents)
        self.tabWidgetNorth_2.setEnabled(False)
        self.tabWidgetNorth_2.setDocumentMode(False)
        self.tabWidgetNorth_2.setTabsClosable(True)
        self.tabWidgetNorth_2.setObjectName("tabWidgetNorth_2")
        self.tab_9 = QtWidgets.QWidget()
        self.tab_9.setObjectName("tab_9")
        self.gridLayout_10 = QtWidgets.QGridLayout(self.tab_9)
        self.gridLayout_10.setObjectName("gridLayout_10")
        self.label_53 = QtWidgets.QLabel(self.tab_9)
        self.label_53.setObjectName("label_53")
        self.gridLayout_10.addWidget(self.label_53, 0, 0, 1, 1)
        self.tabWidgetNorth_2.addTab(self.tab_9, "")
        self.tab_10 = QtWidgets.QWidget()
        self.tab_10.setObjectName("tab_10")
        self.gridLayout_19 = QtWidgets.QGridLayout(self.tab_10)
        self.gridLayout_19.setObjectName("gridLayout_19")
        self.label_49 = QtWidgets.QLabel(self.tab_10)
        self.label_49.setObjectName("label_49")
        self.gridLayout_19.addWidget(self.label_49, 0, 0, 1, 1)
        self.tabWidgetNorth_2.addTab(self.tab_10, "")
        self.gridLayout_5.addWidget(self.tabWidgetNorth_2, 1, 1, 1, 1)
        self.tabWidgetWest = QtWidgets.QTabWidget(self.dockWidgetContents)
        self.tabWidgetWest.setTabPosition(QtWidgets.QTabWidget.West)
        self.tabWidgetWest.setObjectName("tabWidgetWest")
        self.tab_5 = QtWidgets.QWidget()
        self.tab_5.setObjectName("tab_5")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.tab_5)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.label_39 = QtWidgets.QLabel(self.tab_5)
github git-cola / git-cola / cola / widgets / diff.py View on Github external
'These changes cannot be recovered.'),
                               N_('Revert the uncommitted changes?'),
                               ok_text, default=True, icon=icons.undo()):
            return
        self.process_diff_selection(reverse=True, apply_to_worktree=True)

    def process_diff_selection(self, reverse=False, apply_to_worktree=False):
        """Implement un/staging of the selected line(s) or hunk."""
        if selection.selection_model().is_empty():
            return
        first_line_idx, last_line_idx = self.selected_lines()
        cmds.do(cmds.ApplyDiffSelection, first_line_idx, last_line_idx,
                self.has_selection(), reverse, apply_to_worktree)


class DiffWidget(QtWidgets.QWidget):

    def __init__(self, notifier, parent, is_commit=False):
        QtWidgets.QWidget.__init__(self, parent)

        self.runtask = qtutils.RunTask(parent=self)

        author_font = QtGui.QFont(self.font())
        author_font.setPointSize(int(author_font.pointSize() * 1.1))

        summary_font = QtGui.QFont(author_font)
        summary_font.setWeight(QtGui.QFont.Bold)

        policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                       QtWidgets.QSizePolicy.Minimum)

        self.gravatar_label = gravatar.GravatarLabel()
github spyder-ide / spyder / spyder / plugins / explorer / widgets / explorer.py View on Github external
def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        vlayout = QVBoxLayout()
        self.setLayout(vlayout)
        self.treewidget = FilteredDirView(self)
        self.treewidget.setup_view()
        self.treewidget.set_root_path(osp.dirname(osp.abspath(__file__)))
        self.treewidget.set_folder_names(['variableexplorer'])
        self.treewidget.setup_project_view()
        vlayout.addWidget(self.treewidget)
github ColinDuquesnoy / QDarkStyleSheet / example / ui / dw_containers_tabs_ui.py View on Github external
self.tabWidgetNorth.addTab(self.tab_7, "")
        self.tab_8 = QtWidgets.QWidget()
        self.tab_8.setObjectName("tab_8")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_8)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_48 = QtWidgets.QLabel(self.tab_8)
        self.label_48.setObjectName("label_48")
        self.gridLayout_4.addWidget(self.label_48, 0, 0, 1, 1)
        self.tabWidgetNorth.addTab(self.tab_8, "")
        self.gridLayout_5.addWidget(self.tabWidgetNorth, 1, 0, 1, 1)
        self.tabWidgetNorth_2 = QtWidgets.QTabWidget(self.dockWidgetContents)
        self.tabWidgetNorth_2.setEnabled(False)
        self.tabWidgetNorth_2.setDocumentMode(False)
        self.tabWidgetNorth_2.setTabsClosable(True)
        self.tabWidgetNorth_2.setObjectName("tabWidgetNorth_2")
        self.tab_9 = QtWidgets.QWidget()
        self.tab_9.setObjectName("tab_9")
        self.gridLayout_10 = QtWidgets.QGridLayout(self.tab_9)
        self.gridLayout_10.setObjectName("gridLayout_10")
        self.label_53 = QtWidgets.QLabel(self.tab_9)
        self.label_53.setObjectName("label_53")
        self.gridLayout_10.addWidget(self.label_53, 0, 0, 1, 1)
        self.tabWidgetNorth_2.addTab(self.tab_9, "")
        self.tab_10 = QtWidgets.QWidget()
        self.tab_10.setObjectName("tab_10")
        self.gridLayout_19 = QtWidgets.QGridLayout(self.tab_10)
        self.gridLayout_19.setObjectName("gridLayout_19")
        self.label_49 = QtWidgets.QLabel(self.tab_10)
        self.label_49.setObjectName("label_49")
        self.gridLayout_19.addWidget(self.label_49, 0, 0, 1, 1)
        self.tabWidgetNorth_2.addTab(self.tab_10, "")
        self.gridLayout_5.addWidget(self.tabWidgetNorth_2, 1, 1, 1, 1)
github uvemas / ViTables / vitables / plugins / dbstreesort / aboutpage.py View on Github external
from qtpy import QtGui
from qtpy import QtWidgets
from qtpy.uic import loadUiType

__docformat__ = 'restructuredtext'

# This method of the PyQt5.uic module allows for dynamically loading user
# interfaces created by QtDesigner. See the PyQt5 Reference Guide for more
# info.
Ui_DBsTreeSortPage = \
    loadUiType(os.path.join(os.path.dirname(__file__),
                            'dbs_tree_sort_page.ui'))[0]


class AboutPage(QtWidgets.QWidget, Ui_DBsTreeSortPage):
    """
    Widget for describing and customizing the Sorting of DBs Tree plugin.

    By loading UI files at runtime we can:

        - create user interfaces at runtime (without using pyuic)
        - use multiple inheritance, MyParentClass(BaseClass, FormClass)

    This widget is inserted as a page in the stacked widget of the
    Preferences dialog when the sorting of DBs Tree item is clicked in the
    selector tree.

    """

    def __init__(self, desc, parent=None):
        """Fill and customize the widget describing the DBs sorting plugin.