How to use the qtpy.QtWidgets.QLabel 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 spyder-ide / spyder / spyder / preferences / maininterpreter.py View on Github external
self.get_option('custom_interpreters_list'),
                                  'custom_interpreter',
                                  filters=filters,
                                  default_line_edit=True,
                                  adjust_to_contents=True
                                  )
        self.def_exec_radio.toggled.connect(self.cus_exec_combo.setDisabled)
        self.cus_exec_radio.toggled.connect(self.cus_exec_combo.setEnabled)
        pyexec_layout.addWidget(self.cus_exec_combo)
        pyexec_group.setLayout(pyexec_layout)

        self.pyexec_edit = self.cus_exec_combo.combobox.lineEdit()

        # UMR Group
        umr_group = QGroupBox(_("User Module Reloader (UMR)"))
        umr_label = QLabel(_("UMR forces Python to reload modules which were "
                             "imported when executing a file in a Python or "
                             "IPython console with the <i>runfile</i> "
                             "function."))
        umr_label.setWordWrap(True)
        umr_enabled_box = newcb(_("Enable UMR"), 'umr/enabled',
                                msg_if_enabled=True, msg_warning=_(
                        "This option will enable the User Module Reloader (UMR) "
                        "in Python/IPython consoles. UMR forces Python to "
                        "reload deeply modules during import when running a "
                        "Python script using the Spyder's builtin function "
                        "<b>runfile</b>."
                        "<br><br><b>1.</b> UMR may require to restart the "
                        "console in which it will be called "
                        "(otherwise only newly imported modules will be "
                        "reloaded when executing files)."
                        "<br><br><b>2.</b> If errors occur when re-running a "
github spyder-ide / spyder / spyder / widgets / findreplace.py View on Github external
adjust_to_minimum=False)

        self.return_shift_pressed.connect(
                lambda:
                self.find(changed=False, forward=False, rehighlight=False,
                          multiline_replace_check = False))

        self.return_pressed.connect(
                     lambda:
                     self.find(changed=False, forward=True, rehighlight=False,
                               multiline_replace_check = False))

        self.search_text.lineEdit().textEdited.connect(
                                                     self.text_has_been_edited)

        self.number_matches_text = QLabel(self)
        self.previous_button = create_toolbutton(self,
                                                 triggered=self.find_previous,
                                                 icon=ima.icon('ArrowUp'),
                                                 tip=_("Find previous"))
        self.next_button = create_toolbutton(self,
                                             triggered=self.find_next,
                                             icon=ima.icon('ArrowDown'),
                                             tip=_("Find next"))
        self.next_button.clicked.connect(self.update_search_combo)
        self.previous_button.clicked.connect(self.update_search_combo)

        self.re_button = create_toolbutton(self, icon=ima.icon('regex'),
                                           tip=_("Regular expression"))
        self.re_button.setCheckable(True)
        self.re_button.toggled.connect(lambda state: self.find())
github hydrusnetwork / hydrus / hydrus / client / gui / QtPorting.py View on Github external
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 )
        
        name_label_font = name_label.font()
        name_label_font.setBold( True )
        name_label.setFont( name_label_font )
        layout.addWidget( name_label, alignment = QC.Qt.AlignHCenter )
        
        layout.addWidget( version_label, alignment = QC.Qt.AlignHCenter )
        
        layout.addWidget( tabwidget, alignment =  QC.Qt.AlignHCenter )
        tabwidget.addTab( desc_panel, 'Description' )
        tabwidget.addTab( credits, 'Credits' )
github QuTech-Delft / qtt / qtt / param_widget.py View on Github external
def __init__(self, name, gates):
        super(paramUpdateWidget, self).__init__()

        self.gates=gates
        self.name = name
        self.delta = 10
        self.label=QtWidgets.QLabel(name)
        val=gates.get(name)
        self.value=QtWidgets.QLabel(str(val))
        
        self.plus=QtWidgets.QPushButton('+')
        self.minus=QtWidgets.QPushButton('-')
        vLayout = QtWidgets.QVBoxLayout()
        vLayout.addWidget(self.plus)
        vLayout.addWidget(self.minus)

        hLayout = QtWidgets.QHBoxLayout()
        hLayout.addWidget(self.label)
        hLayout.addWidget(self.value)
        #hLayout.setStyleSheet(" { margin: 0px; padding: 0px; }");
        #hLayout.addWidget(vLayout)
        hLayout.addLayout(vLayout)
        hLayout.setSpacing(1)
github ColinDuquesnoy / QDarkStyleSheet / example / ui / dw_inputs_no_fields_qtpy_ui.py View on Github external
self.label_22.setMinimumSize(QtCore.QSize(0, 0))
        self.label_22.setMaximumSize(QtCore.QSize(16777215, 16777215))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label_22.setFont(font)
        self.label_22.setObjectName("label_22")
        self.gridLayout.addWidget(self.label_22, 3, 0, 1, 1)
        self.label = QtWidgets.QLabel(self.dockWidgetContents)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 1, 1, 1)
        self.label_50 = QtWidgets.QLabel(self.dockWidgetContents)
        self.label_50.setAlignment(QtCore.Qt.AlignCenter)
        self.label_50.setObjectName("label_50")
        self.gridLayout.addWidget(self.label_50, 9, 0, 1, 3)
        self.label_11 = QtWidgets.QLabel(self.dockWidgetContents)
        self.label_11.setMinimumSize(QtCore.QSize(0, 0))
        self.label_11.setMaximumSize(QtCore.QSize(16777215, 16777215))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label_11.setFont(font)
        self.label_11.setObjectName("label_11")
        self.gridLayout.addWidget(self.label_11, 1, 0, 1, 1)
        self.dialDis = QtWidgets.QDial(self.dockWidgetContents)
        self.dialDis.setEnabled(False)
        self.dialDis.setMinimumSize(QtCore.QSize(0, 0))
        self.dialDis.setMaximumSize(QtCore.QSize(16777215, 16777215))
github Dioptas / Dioptas / dioptas / widgets / integration / control / OverlayWidget.py View on Github external
self._button_layout.addWidget(self.move_down_btn)
        self._layout.addWidget(self.button_widget)

        self.parameter_widget = QtWidgets.QWidget(self)
        self._parameter_layout = QtWidgets.QVBoxLayout()
        self._parameter_layout.setContentsMargins(0, 0, 0, 0)
        self._parameter_layout.setSpacing(5)

        self.scale_step_msb = DoubleMultiplySpinBoxAlignRight()
        self.offset_step_msb = DoubleMultiplySpinBoxAlignRight()

        self._step_gb = QtWidgets.QWidget()
        self._step_layout = QtWidgets.QVBoxLayout()
        self._step_layout.setContentsMargins(0, 0, 0, 0)
        self._step_layout.setSpacing(4)
        self._step_layout.addWidget(QtWidgets.QLabel('Scale Step'))
        self._step_layout.addWidget(self.scale_step_msb)
        self._step_layout.addWidget(QtWidgets.QLabel('Offset Step'))
        self._step_layout.addWidget(self.offset_step_msb)
        self._step_gb.setLayout(self._step_layout)
        self._parameter_layout.addWidget(self._step_gb)
        self._parameter_layout.addWidget(HorizontalLine())

        self._waterfall_gb = QtWidgets.QWidget()
        self.waterfall_separation_msb = DoubleMultiplySpinBoxAlignRight()
        self.waterfall_btn = FlatButton('Waterfall')
        self.waterfall_reset_btn = FlatButton('Reset')

        self._waterfall_layout = QtWidgets.QVBoxLayout()
        self._waterfall_layout.setContentsMargins(0, 0, 0, 0)
        self._waterfall_layout.setSpacing(4)
        self._waterfall_layout.addWidget(self.waterfall_btn)
github 1313e / PRISM / prism / _gui / widgets / helpers.py View on Github external
grid_layout.setColumnStretch(2, 1)
        grid_layout.setRowStretch(3, 1)

        # Set properties of message box
        self.setWindowModality(QC.Qt.ApplicationModal)
        self.setAttribute(QC.Qt.WA_DeleteOnClose)
        self.setWindowTitle("ERROR")
        self.setWindowFlags(
            QC.Qt.MSWindowsOwnDC |
            QC.Qt.Dialog |
            QC.Qt.WindowTitleHint |
            QC.Qt.WindowSystemMenuHint |
            QC.Qt.WindowCloseButtonHint)

        # Set the icon of the exception on the left
        icon_label = QW.QLabel()
        pixmap = QW.QMessageBox.standardIcon(QW.QMessageBox.Critical)
        icon_label.setPixmap(pixmap)
        grid_layout.addWidget(icon_label, 0, 0, 2, 1, QC.Qt.AlignTop)

        # Add a spacer item
        spacer_item = QW.QSpacerItem(7, 1, QW.QSizePolicy.Fixed,
                                     QW.QSizePolicy.Fixed)
        grid_layout.addItem(spacer_item, 0, 1, 2, 1)

        # Set the text of the exception
        exc_str = self.format_exception()
        exc_label = QW.QLabel(exc_str)
        grid_layout.addWidget(exc_label, 0, 2, 1, 1)

        # Create a button box for the buttons
        button_box = QW.QDialogButtonBox()
github ColinDuquesnoy / QDarkStyleSheet / example / ui / dw_displays_qtpy_ui.py View on Github external
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
        self.graphicsView.setSizePolicy(sizePolicy)
        self.graphicsView.setMinimumSize(QtCore.QSize(0, 0))
        self.graphicsView.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.graphicsView.setObjectName("graphicsView")
        self.gridLayout.addWidget(self.graphicsView, 3, 1, 1, 1)
        self.graphicsViewDis = QtWidgets.QGraphicsView(self.dockWidgetContents)
        self.graphicsViewDis.setEnabled(False)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.graphicsViewDis.sizePolicy().hasHeightForWidth())
        self.graphicsViewDis.setSizePolicy(sizePolicy)
        self.graphicsViewDis.setObjectName("graphicsViewDis")
        self.gridLayout.addWidget(self.graphicsViewDis, 3, 2, 1, 1)
        self.label_6 = QtWidgets.QLabel(self.dockWidgetContents)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth())
        self.label_6.setSizePolicy(sizePolicy)
        self.label_6.setMinimumSize(QtCore.QSize(0, 0))
        self.label_6.setMaximumSize(QtCore.QSize(16777215, 16777215))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label_6.setFont(font)
        self.label_6.setObjectName("label_6")
        self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)
        self.calendarWidget = QtWidgets.QCalendarWidget(self.dockWidgetContents)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
github scikit-image / scikit-image / skimage / io / _plugins / skivi.py View on Github external
def __init__(self):
        QFrame.__init__(self)
        self.setFrameStyle(QFrame.Box | QFrame.Sunken)

        self.posx_label = QLabel('X-pos:')
        self.posx_value = QLabel()
        self.posy_label = QLabel('Y-pos:')
        self.posy_value = QLabel()
        self.r_label = QLabel('R:')
        self.r_value = QLabel()
        self.g_label = QLabel('G:')
        self.g_value = QLabel()
        self.b_label = QLabel('B:')
        self.b_value = QLabel()
        self.h_label = QLabel('H:')
        self.h_value = QLabel()
        self.s_label = QLabel('S:')
        self.s_value = QLabel()
        self.v_label = QLabel('V:')
        self.v_value = QLabel()

        self.layout = QGridLayout(self)
        self.layout.addWidget(self.posx_label, 0, 0)
        self.layout.addWidget(self.posx_value, 0, 1)
        self.layout.addWidget(self.posy_label, 1, 0)
        self.layout.addWidget(self.posy_value, 1, 1)
        self.layout.addWidget(self.r_label, 0, 2)
        self.layout.addWidget(self.r_value, 0, 3)
github Ulm-IQO / qudi / qudi / core / gui / main_gui / aboutqudidialog.py View on Github external
| QtCore.Qt.TextBrowserInteraction)
        self.version_label.setOpenExternalLinks(True)

        self.about_label = QtWidgets.QLabel('<p>Qudi is a suite of tools for '
                                            'operating multi-instrument and multi-computer '
                                            'laboratory experiments. Originally built around a '
                                            'confocal fluorescence microscope experiments, it has '
                                            'grown to be a generally applicaple framework for '
                                            'controlling experiments.</p>')
        self.about_label.setWordWrap(True)
        self.about_label.setObjectName('aboutLabel')
        self.about_label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse
                                                 | QtCore.Qt.TextBrowserInteraction)
        self.about_label.setOpenExternalLinks(True)

        self.credits_label = QtWidgets.QLabel('<p><span style="text-decoration:'
                                              ' underline;">Qudi is developed by the Institute for '
                                              'Quantum Optics at Ulm University. </span></p><p>Kay '
                                              'D. Jahnke</p><p>Jan M. Binder</p><p>Alexander Stark'
                                              '</p><p>Lachlan J, Rogers</p><p>Nikolas Tomek</p><p>'
                                              'Florian S. Frank</p><p>Mathias Metsch</p><p>'
                                              'Christoph Müller</p><p>Simon Schmitt</p><p>Thomas '
                                              'Unden</p><p>Jochen Scheuer</p><p>Ou Wang</p><p>External '
                                              'Contributors:</p><p>Tobias Gehring, DTU '
                                              'Copenhagen</p><p>...</p>')
        self.credits_label.setWordWrap(True)
        self.credits_label.setObjectName('creditsLabel')
        self.credits_label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse
                                                   | QtCore.Qt.TextBrowserInteraction)
        self.credits_label.setOpenExternalLinks(True)