python类QLabel()的实例源码

skelenox.py 文件源码 项目:polichombr 作者: ANSSI-FR 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def PopulateForm(self):
        layout = QVBoxLayout()
        label = QtWidgets.QLabel()
        label.setText("Notes about sample %s" % idc.GetInputMD5())

        self.editor = QtWidgets.QTextEdit()

        self.editor.setFontFamily(self.skel_settings.notepad_font_name)
        self.editor.setFontPointSize(self.skel_settings.notepad_font_size)

        text = self.skel_conn.get_abstract()
        self.editor.setPlainText(text)

        # editor.setAutoFormatting(QtWidgets.QTextEdit.AutoAll)
        self.editor.textChanged.connect(self._onTextChange)

        layout.addWidget(label)
        layout.addWidget(self.editor)
        self.setLayout(layout)
son.py 文件源码 项目:Milis-Yukleyici 作者: sonakinci41 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, ebeveyn=None):
        super(Son, self).__init__(ebeveyn)
        self.e = ebeveyn
        self.kapanacak_mi =False

        kutu = QGridLayout()
        self.setLayout(kutu)

        milis_logo = QLabel()
        milis_logo.setAlignment(Qt.AlignCenter)
        milis_logo.setPixmap(QPixmap("./resimler/milis-logo.svg"))
        kutu.addWidget(milis_logo,0,0,1,2)

        self.veda_label = QLabel()
        self.veda_label.setAlignment(Qt.AlignCenter)
        self.veda_label.setWordWrap(True)
        kutu.addWidget(self.veda_label,1,0,1,2)

        self.denemeye_devam = QRadioButton()
        self.denemeye_devam.setIcon(QIcon("./resimler/cik.svg"))
        self.denemeye_devam.setIconSize(QSize(50,50))
        self.denemeye_devam.toggled.connect(self.degisti)
        kutu.addWidget(self.denemeye_devam,2,0,1,1)
        self.kapat = QRadioButton()
        self.kapat.setIcon(QIcon("./resimler/yeniden-baslat.svg"))
        self.kapat.setIconSize(QSize(50,50))
        self.kapat.toggled.connect(self.degisti)
        kutu.addWidget(self.kapat,2,1,1,1)

        self.denemeye_devam.setChecked(True)
node_monitor.py 文件源码 项目:gui_tool 作者: UAVCAN 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent, node):
        super(NodeMonitorWidget, self).__init__(parent)
        self.setTitle('Online nodes (double click for more options)')

        self._node = node
        self.on_info_window_requested = lambda *_: None

        self._status_update_timer = QTimer(self)
        self._status_update_timer.setSingleShot(False)
        self._status_update_timer.timeout.connect(self._update_status)
        self._status_update_timer.start(500)

        self._table = NodeTable(self, node)
        self._table.info_requested.connect(self._show_info_window)

        self._monitor_handle = self._table.monitor.add_update_handler(lambda _: self._update_status())

        self._status_label = QLabel(self)

        vbox = QVBoxLayout(self)
        vbox.addWidget(self._table)
        vbox.addWidget(self._status_label)
        self.setLayout(vbox)
LogFileWidget.py 文件源码 项目:PINCE 作者: korcankaraokcu 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(582, 558)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.label_FilePath = QtWidgets.QLabel(Form)
        self.label_FilePath.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
        self.label_FilePath.setObjectName("label_FilePath")
        self.gridLayout.addWidget(self.label_FilePath, 0, 0, 1, 1)
        self.textBrowser_LogContent = QtWidgets.QTextBrowser(Form)
        self.textBrowser_LogContent.setLineWrapMode(QtWidgets.QTextEdit.NoWrap)
        self.textBrowser_LogContent.setObjectName("textBrowser_LogContent")
        self.gridLayout.addWidget(self.textBrowser_LogContent, 1, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
GUI.py 文件源码 项目:coliform-project 作者: uprm-research-resto 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def createTopLeftGroupBox(self):
        self.topLeftGroupBox = QGroupBox("Temperature Sensor")

        tempLabel = QLabel('Temperature: ')
        self.tempValLabel = QLabel('NULL')

        plotButton = QPushButton("Show Plot")
        plotButton.clicked.connect(self.tempPlot)
        saveDataButton = QPushButton('Save Data File')
        saveDataButton.clicked.connect(self.savefile)

        vbox1 = QVBoxLayout()
        vbox1.addWidget(tempLabel)
        vbox1.addWidget(self.tempValLabel)

        vbox2 = QVBoxLayout()
        vbox2.addWidget(plotButton)
        vbox2.addWidget(saveDataButton)

        layout = QHBoxLayout()
        layout.addLayout(vbox1)
        layout.addLayout(vbox2)
        layout.addStretch(1)
        self.topLeftGroupBox.setLayout(layout)
GUI.py 文件源码 项目:coliform-project 作者: uprm-research-resto 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def createTopRightGroupBox(self):
        self.topRightGroupBox = QGroupBox('Heater')

        heatLabel = QLabel('Target Temperature(C):')
        heatEntry = QLineEdit()
        heatEntry.textChanged[str].connect(self.tempOnChanged)
        heatEntry.setText('41')

        self.heatButton = QPushButton('Heater ON')
        self.heatButton.clicked.connect(self.heaterPower)

        hbox1 = QHBoxLayout()
        hbox1.addWidget(heatLabel)
        hbox1.addWidget(heatEntry)

        hbox2 = QHBoxLayout()
        hbox2.addWidget(self.heatButton)

        layout = QVBoxLayout()
        layout.addLayout(hbox1)
        layout.addLayout(hbox2)
        layout.addStretch(1)
        self.topRightGroupBox.setLayout(layout)
about.py 文件源码 项目:pytc-gui 作者: harmslab 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def layout(self):
        """
        """
        main_layout = QW.QVBoxLayout(self)
        form_layout = QW.QFormLayout()

        version = pkg_resources.require("pytc-gui")[0].version

        name_label = QW.QLabel("pytc: GUI")
        name_font = name_label.font()
        name_font.setPointSize(20)
        name_label.setFont(name_font)
        name_label.setAlignment(Qt.AlignCenter)

        version_label = QW.QLabel("Version " + version)
        version_font = version_label.font()
        version_font.setPointSize(14)
        version_label.setFont(version_font)
        version_label.setAlignment(Qt.AlignCenter)

        author_info = QW.QLabel("Hiranmayi Duvvuri, Mike Harms")
        author_font = author_info.font()
        author_font.setPointSize(10)
        author_info.setFont(author_font)

        OK_button = QW.QPushButton("OK", self)
        OK_button.clicked.connect(self.close)

        main_layout.addWidget(name_label)
        main_layout.addWidget(version_label)
        main_layout.addWidget(author_info)
        main_layout.addWidget(OK_button)

        self.setWindowTitle("About")
experiment_meta_wrapper.py 文件源码 项目:pytc-gui 作者: harmslab 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def layout(self):
        """
        Create layout.
        """

        self._main_layout = QW.QHBoxLayout(self)

        self._label = QW.QLabel(self._meta_name)
        self._meta = QW.QLineEdit()
        self._meta.textChanged.connect(self._meta_handler)
        self._meta.editingFinished.connect(self._meta_handler)

        self._main_layout.addWidget(self._label)
        self._main_layout.addWidget(self._meta)

        # Load in parameters from FitParameter object
        self.update()
global_dialog.py 文件源码 项目:pytc-gui 作者: harmslab 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def layout(self):
        """
        Populate the window.
        """

        self._main_layout = QW.QVBoxLayout(self)
        self._form_layout = QW.QFormLayout()

        # Input box holding name
        self._global_var_input = QW.QLineEdit(self)
        self._global_var_input.setText("global")
        self._global_var_input.editingFinished.connect(self._check_name)

        # Final OK button
        self._OK_button = QW.QPushButton("OK", self)
        self._OK_button.clicked.connect(self._ok_button_handler)

        # Add to form
        self._form_layout.addRow(QW.QLabel("New Global Variable:"), self._global_var_input)

        # add to main layout
        self._main_layout.addLayout(self._form_layout)
        self._main_layout.addWidget(self._OK_button)

        self.setWindowTitle("Add new global variable")
__init__.py 文件源码 项目:binja_dynamics 作者: nccgroup 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, text="Loading..."):
        super(MessageBox, self).__init__()
        self.setWindowTitle("Messages")

        self.setLayout(QtWidgets.QHBoxLayout())
        self._layout = self.layout()

        self._gif = QtWidgets.QLabel()
        movie = QtGui.QMovie("loading.gif")
        self._gif.setMovie(movie)
        movie.start()
        self._layout.addWidget(self._gif)

        self._message = QtWidgets.QLabel()
        self._message.setText(text)
        self._layout.addWidget(self._message)
        self.setObjectName('Message_Window')
inventory.py 文件源码 项目:activity-browser 作者: LCA-ActivityBrowser 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, parent):
        super(DatabaseWidget, self).__init__(parent)

        # Labels
        self.label_no_database_selected = QtWidgets.QLabel("Select a database (double-click on table).")

        # Buttons
        self.add_default_data_button = QtWidgets.QPushButton(
            'Add Default Data (Biosphere flows, LCIA methods)')
        self.new_database_button = QtWidgets.QPushButton('New Database')
        self.import_database_button = QtWidgets.QPushButton('Import Database')

        # Header widget
        self.header_layout.addWidget(self.add_default_data_button)
        self.header_layout.addWidget(self.new_database_button)
        self.header_layout.addWidget(self.import_database_button)

        # Overall Layout
        self.v_layout.addWidget(self.label_no_database_selected)

        self.connect_signals()
ia.py 文件源码 项目:activity-browser 作者: LCA-ActivityBrowser 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, parent):
        super(CFsTab, self).__init__(parent)
        self.panel = parent
        # Not visible when instantiated
        self.cf_table = CFTable()
        self.no_method_label = QtWidgets.QLabel(self.NO_METHOD)
        container = QtWidgets.QVBoxLayout()
        container.addWidget(header('Characterization Factors:'))
        container.addWidget(horizontal_line())
        container.addWidget(self.no_method_label)
        container.addWidget(self.cf_table)
        container.setAlignment(QtCore.Qt.AlignTop)

        signals.project_selected.connect(self.hide_cfs_table)
        signals.method_selected.connect(self.add_cfs_table)

        self.setLayout(container)
db_import_wizard.py 文件源码 项目:activity-browser 作者: LCA-ActivityBrowser 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        self.wizard = self.parent()
        self.path_edit = QtWidgets.QLineEdit()
        self.registerField('archivepath*', self.path_edit)
        self.browse_button = QtWidgets.QPushButton('Browse')
        self.browse_button.clicked.connect(self.get_archive)

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(QtWidgets.QLabel(
            'Choose location of 7z archive:'))
        layout.addWidget(self.path_edit)
        browse_lay = QtWidgets.QHBoxLayout()
        browse_lay.addWidget(self.browse_button)
        browse_lay.addStretch(1)
        layout.addLayout(browse_lay)
        self.setLayout(layout)
db_import_wizard.py 文件源码 项目:activity-browser 作者: LCA-ActivityBrowser 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        self.wizard = self.parent()
        self.complete = False
        self.description_label = QtWidgets.QLabel('Login to the ecoinvent homepage:')
        self.username_edit = QtWidgets.QLineEdit()
        self.username_edit.setPlaceholderText('ecoinvent username')
        self.password_edit = QtWidgets.QLineEdit()
        self.password_edit.setPlaceholderText('ecoinvent password'),
        self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.login_button = QtWidgets.QPushButton('login')
        self.login_button.clicked.connect(self.login)
        self.login_button.setCheckable(True)
        self.password_edit.returnPressed.connect(self.login_button.click)
        self.success_label = QtWidgets.QLabel('')
        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.description_label)
        layout.addWidget(self.username_edit)
        layout.addWidget(self.password_edit)
        hlay = QtWidgets.QHBoxLayout()
        hlay.addWidget(self.login_button)
        hlay.addStretch(1)
        layout.addLayout(hlay)
        layout.addWidget(self.success_label)
        self.setLayout(layout)
direct_download.py 文件源码 项目:tvlinker 作者: ozmartian 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent, f=Qt.WindowCloseButtonHint):
        super(DirectDownload, self).__init__(parent, f)
        self.parent = parent
        self.setWindowTitle('Download Progress')
        self.setWindowModality(Qt.ApplicationModal)
        self.setMinimumWidth(485)
        self.setContentsMargins(20, 20, 20, 20)
        layout = QVBoxLayout()
        self.progress_label = QLabel(alignment=Qt.AlignCenter)
        self.progress = QProgressBar(self.parent)
        self.progress.setMinimum(0)
        self.progress.setMaximum(100)
        layout.addWidget(self.progress_label)
        layout.addWidget(self.progress)
        self.setLayout(layout)
about.py 文件源码 项目:Qyoutube-dl 作者: lzambella 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(401, 117)
        About.setMinimumSize(QtCore.QSize(401, 117))
        About.setMaximumSize(QtCore.QSize(401, 117))
        self.buttonBox = QtWidgets.QDialogButtonBox(About)
        self.buttonBox.setGeometry(QtCore.QRect(10, 80, 381, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.setObjectName("buttonBox")
        self.label = QtWidgets.QLabel(About)
        self.label.setGeometry(QtCore.QRect(0, 20, 401, 21))
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(About)
        self.label_2.setGeometry(QtCore.QRect(0, 40, 401, 20))
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName("label_2")

        self.retranslateUi(About)
        self.buttonBox.clicked['QAbstractButton*'].connect(About.close)
        QtCore.QMetaObject.connectSlotsByName(About)
wb_git_credentials_dialog.py 文件源码 项目:scm-workbench 作者: barry-scott 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__( self, app, parent ):
        self.app = app

        super().__init__( parent )

        self.setWindowTitle( T_('Git Credentials - %s') % (' '.join( app.app_name_parts ),) )

        self.url = QtWidgets.QLabel()
        self.username = QtWidgets.QLineEdit()
        self.password = QtWidgets.QLineEdit()
        self.password.setEchoMode( self.password.Password )

        self.username.textChanged.connect( self.nameTextChanged )
        self.password.textChanged.connect( self.nameTextChanged )

        em = self.fontMetrics().width( 'M' )

        self.addRow( T_('URL'), self.url )
        self.addRow( T_('Username'), self.username, min_width=50*em )
        self.addRow( T_('Password'), self.password )
        self.addButtons()
wb_svn_info_dialog.py 文件源码 项目:scm-workbench 作者: barry-scott 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def addRow( self, label, value ):
        value = str(value)

        label_ctrl = QtWidgets.QLabel( label )
        label_ctrl.setAlignment( QtCore.Qt.AlignRight )

        if '\n' in value:
            value_ctrl = QtWidgets.QPlainTextEdit()

        else:
            value_ctrl = QtWidgets.QLineEdit()


        value_ctrl.setMinimumWidth( 600 )
        value_ctrl.setReadOnly( True )
        value_ctrl.setText( value )

        row = self.grid.rowCount()
        self.grid.addWidget( label_ctrl, row, 0 )
        self.grid.addWidget( value_ctrl, row, 1 )
wb_svn_credential_dialogs.py 文件源码 项目:scm-workbench 作者: barry-scott 项目源码 文件源码 阅读 125 收藏 0 点赞 0 评论 0
def __init__( self, parent, trust_info ):
        super().__init__( parent )

        self.setWindowTitle( T_('SVN SSL Server Trust') )

        self.realm = QtWidgets.QLabel( trust_info['realm'] )
        self.save_trust = QtWidgets.QCheckBox()
        self.save_trust.setCheckState( QtCore.Qt.Unchecked )

        em = self.fontMetrics().width( 'M' )

        self.addRow( T_('Hostname'), trust_info['hostname'], min_width=50*em )
        self.addRow( T_('Finger Print'), trust_info['finger_print'] )
        self.addRow( T_('Valid From'), trust_info['valid_from'] )
        self.addRow( T_('Valid Until'), trust_info['valid_until'] )
        self.addRow( T_('Issuer Dname'), trust_info['issuer_dname'] )
        self.addRow( T_('Realm'), trust_info['realm'] )
        self.addRow( T_('Save Trust'), self.save_trust )
        self.addButtons()
wb_scm_main_window.py 文件源码 项目:scm-workbench 作者: barry-scott 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def setupStatusBar( self, s ):
        self.status_general = QtWidgets.QLabel()
        self.status_progress = QtWidgets.QLabel()
        self.status_action = QtWidgets.QLabel()

        self.status_progress.setFrameStyle( QtWidgets.QFrame.Panel|QtWidgets.QFrame.Sunken )
        self.status_action.setFrameStyle( QtWidgets.QFrame.Panel|QtWidgets.QFrame.Sunken )

        s.addWidget( self.status_general, 1 )
        s.addWidget( self.status_progress, 1 )
        s.addWidget( self.status_action, 1 )

        self.setStatusGeneral()
        self.setStatusAction()

        self.progress = wb_scm_progress.WbScmProgress( self.status_progress )
wb_diff_side_by_side_view.py 文件源码 项目:scm-workbench 作者: barry-scott 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def setupStatusBar( self, s ):
        self.status_message = QtWidgets.QLabel()
        s.addWidget( self.status_message )

        prefs = self.app.prefs.diff_window

        key = QtWidgets.QLabel()
        key.setTextFormat( QtCore.Qt.RichText )
        key.setText( '<font color="%(normal)s">Key: </font>'
                     '<font color="%(insert)s">Inserted text </font>'
                     '<font color="%(delete)s">Deleted text </font>'
                     '<font color="%(change)s">Changed text </font>' %
                        {'normal': prefs.colour_normal.fg
                        ,'insert': prefs.colour_insert_line.fg
                        ,'delete': prefs.colour_delete_line.fg
                        ,'change': prefs.colour_change_line.fg} )
        key.setFrameStyle( QtWidgets.QFrame.Panel|QtWidgets.QFrame.Sunken )

        self.status_bar_key_field = key
        s.addPermanentWidget( self.status_bar_key_field )

    #------------------------------------------------------------
widgets.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, option, value):
        # Make sure the value is a boolean
        if isinstance(value, str):
            if value.lower() in ['yes', "true", "on"]:
                value = True
            elif value in ['no', "false", "off"]:
                value = False
        super().__init__(option)

        self.check_box = QW.QCheckBox()
        self.check_box.setChecked(value)

        self.answer = QW.QLabel()
        self.switch_answer()

        self.check_box.clicked.connect(self.switch_answer)

        self.layout.addWidget(self.check_box)
        self.layout.addWidget(self.answer)
sequana_gui.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, run_button, combobox):
        super(SequanaFactory, self).__init__("sequana", run_button)
        self._imported_config = None
        self._choice_button = combobox

        # Some widgets to be used: a file browser for paired files
        fastq_filter = "Fastq file (*.fastq *.fastq.gz *.fq *.fq.gz)"
        self._sequana_paired_tab = FileBrowser(paired=True, file_filter=fastq_filter)
        self._sequana_readtag_label2 = QW.QLabel("Read tag (e.g. _[12].fastq)")
        self._sequana_readtag_lineedit2 = QW.QLineEdit("_R[12]_")

        # Set the file browser input_directory tab
        self._sequana_directory_tab = FileBrowser(directory=True)
        self._sequana_readtag_label = QW.QLabel("Read tag (e.g. _[12].fastq)")
        self._sequana_readtag_lineedit = QW.QLineEdit("_R[12]_")
        self._sequana_pattern_label = QW.QLabel(
            "<div><i>Optional</i> pattern (e.g., Samples_1?/*fastq.gz)</div>")
        self._sequana_pattern_lineedit = QW.QLineEdit()

        # triggers/connectors
        self._sequana_directory_tab.clicked_connect(self._switch_off_run)
        self._choice_button.activated.connect(self._switch_off_run)
        self._sequana_paired_tab.clicked_connect(self._switch_off_run)
snakemake.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def _get_value(self):
        """Return a string"""
        if isinstance(self.widget, QW.QSpinBox):
            value = self.widget.text()
        elif isinstance(self.widget, QW.QLabel):
            value = self.widget.text()
        elif isinstance(self.widget, FileBrowser):
            if self.widget.path_is_setup()  is False:
                value = ""
            else:
                value = self.widget.get_filenames()
        else:
            try:
                value = self.widget.text()
            except:
                print("unknown widget" + str(type(self.widget)))
                value = ""
        return value
window.py 文件源码 项目:MusicNet 作者: vidursatija 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def drawUI(self, song_name="blank", song_artist="blank"):
        self.art = QLabel(self)
        self.art.resize(50, 50)
        #self.art.setPixmap(QPixmap("".join([song_name,'.jpg'])).scaled(50, 50, Qt.KeepAspectRatio, Qt.SmoothTransformation))

        self.song_label = QLabel(self)
        self.song_label.setText(song_name)
        self.song_label.setStyleSheet("border-image: rgba(0, 0, 0, 0); color: rgba(255, 255, 255); font-size: 12pt; font-weight: 600;")
        self.song_label.move(60, 10)
        self.song_label.resize(180, 15)

        self.artist_label = QLabel(self)
        self.artist_label.setText(song_artist)
        self.artist_label.setStyleSheet("border-image: rgba(0, 0, 0, 0); color: rgba(255, 255, 255); font-size: 12pt; font-weight: 200;")
        self.artist_label.move(60, 25)
        self.artist_label.resize(180, 15)
Progress.py 文件源码 项目:LearningPyQt 作者: manashmndl 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def init_ui(self):
        # Creating a label
        self.progressLabel = QLabel('Progress Bar:', self)

        # Creating a progress bar and setting the value limits
        self.progressBar = QProgressBar(self)
        self.progressBar.setMaximum(100)
        self.progressBar.setMinimum(0)

        # Creating a Horizontal Layout to add all the widgets
        self.hboxLayout = QHBoxLayout(self)

        # Adding the widgets
        self.hboxLayout.addWidget(self.progressLabel)
        self.hboxLayout.addWidget(self.progressBar)

        # Setting the hBoxLayout as the main layout
        self.setLayout(self.hboxLayout)
        self.setWindowTitle('Dialog with Progressbar')

        self.show()
OpenDialog.py 文件源码 项目:kodi-remote 作者: chatper 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, addons, parent):
        super().__init__()

        self.setGeometry(300, 300, 300, 300)
        self.setWindowTitle('Open Addon')
        self.setWindowIcon(QIcon(ICON_PATH))

        label = QLabel('Choose the addon you want to open.')

        grid = QGridLayout()
        grid.setSpacing(4)

        grid.addWidget(label, 0, 0)

        self.addonList = addons.split('-')
        self.addonList.remove('')
        self.parent = parent

        for i,j in enumerate(self.addonList):
            l = QLabel(str(i)+' -> '+j)
            grid.addWidget(l, i+1, 0)

        self.setLayout(grid)
        self.show()
main.py 文件源码 项目:axopy 作者: ucdrascal 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self):
        app = get_qtapp()
        super(MainWindow, self).__init__()

        app.installEventFilter(self)

        self._central_widget = QtWidgets.QWidget(self)
        self._layout = QtWidgets.QStackedLayout(self._central_widget)
        self.setCentralWidget(self._central_widget)

        status_bar = QtWidgets.QStatusBar(self)
        self.setStatusBar(status_bar)
        self._statusbar_label = QtWidgets.QLabel("status")
        status_bar.addPermanentWidget(self._statusbar_label)

        self.show()
prompts.py 文件源码 项目:axopy 作者: ucdrascal 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def paintEvent(self, event):
        """
        Overrides the QLabel method. Shouldn't need to be called directly.
        """
        super().paintEvent(event)

        if self._pixmap_src is None:
            return

        self._pixmap = self._pixmap_src.scaled(
            self.size(), QtCore.Qt.KeepAspectRatio)

        x = (self.width() - self._pixmap.width())/2
        y = (self.height() - self._pixmap.height())/2

        painter = QtGui.QPainter(self)
        painter.drawPixmap(x, y, self._pixmap)
adventure.py 文件源码 项目:networkzero 作者: tjguk 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(Adventure, self).__init__(parent)

        #
        # Top-half of the
        #
        self.image_panel = QtWidgets.QLabel()
        self.image_panel.setAlignment(QtCore.Qt.AlignCenter)
        self.image = QtGui.QPixmap("image.jpg")
        self.image_panel.setPixmap(self.image)

        self.text_panel = QtWidgets.QTextEdit()
        self.text_panel.setReadOnly(True)
        self.text_panel.setTextBackgroundColor(QtGui.QColor("blue"))
        self.text_panel.setHtml("""<h1>Hello, World!</h1>

        <p>You are in a spacious ballroom with the sound of music playing all around you.</p>
        """)

        self.data_panel = QtWidgets.QTextEdit()
        self.data_panel.setReadOnly(True)

        self.input = QtWidgets.QLineEdit()

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.image_panel, 1)
        hlayout = QtWidgets.QHBoxLayout()
        hlayout.addWidget(self.text_panel, 3)
        hlayout.addWidget(self.data_panel, 1)
        layout.addLayout(hlayout, 1)
        layout.addWidget(self.input)

        self.setLayout(layout)
        self.setWindowTitle("Westpark Adventure")


问题


面经


文章

微信
公众号

扫码关注公众号