Python PyQt5.QtWidgets.QLabel() Examples

The following are code examples for showing how to use PyQt5.QtWidgets.QLabel(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: MusicDownloader   Author: wwwpf   File: about_dialog.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent):
        super().__init__(parent)

        if os.path.exists(ImageConfig.ABOUT_DIALOG_BACKGROUND_FILE):
            self.setWindowTitle("关于 - 仅供学习研究使用")

            label = QLabel(self)
            label.setMaximumSize(self.MAX_LENGTH, self.MAX_LENGTH)
            movie = QMovie(ImageConfig.ABOUT_DIALOG_BACKGROUND_FILE)
            label.setMovie(movie)

            movie.start()
            self.resize(movie.currentImage().size())

        else:
            self.ui = loadUi(os.path.join(
                RESOURCE_PATH, "about_dialog.ui"), self) 
Example 2
Project: Micchinetta   Author: SqrtPapere   File: DatabaseManager.py    MIT License 6 votes vote down vote up
def __init__(self, d):
        """Class constructor that sets up the window layout and allocates attributes"""
        super().__init__()
        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok
                                      | QDialogButtonBox.Cancel)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        self.vLayout = QVBoxLayout()

        self.le_dict = {}

        for key in d:
            h = QHBoxLayout()
            h.addWidget(QLabel(key))
            qe = QLineEdit()
            self.le_dict[key] = qe
            h.addWidget(qe)
            self.vLayout.addLayout(h)

        self.vLayout.addWidget(self.buttonBox)

        self.setLayout(self.vLayout) 
Example 3
Project: libView   Author: liyanqing1987   File: libView.py    GNU General Public License v2.0 6 votes vote down vote up
def initLeakagePowerTabFrame(self):
        # self.leakagePowerTabFrame
        self.leakagePowerTabWhenLabel = QLabel('when:', self.leakagePowerTabFrame)
        self.leakagePowerTabWhenLabel.setAlignment(Qt.AlignRight)
        self.leakagePowerTabWhenCombo = QComboBox(self.leakagePowerTabFrame)
        self.leakagePowerTabWhenCombo.activated.connect(self.updateLeakagePowerTabRelatedPgPinCombo)

        self.leakagePowerTabRelatedPgPinLabel = QLabel('related_pg_pin:', self.leakagePowerTabFrame)
        self.leakagePowerTabRelatedPgPinLabel.setAlignment(Qt.AlignRight)
        self.leakagePowerTabRelatedPgPinCombo = QComboBox(self.leakagePowerTabFrame)
        self.leakagePowerTabRelatedPgPinCombo.activated.connect(self.updateLeakagePowerTabTable)

        self.leakagePowerTabEmptyLabel = QLabel('')

        # self.leakagePowerTabFrame - Grid
        leakagePowerTabFrameGrid = QGridLayout()

        leakagePowerTabFrameGrid.addWidget(self.leakagePowerTabWhenLabel, 0, 0)
        leakagePowerTabFrameGrid.addWidget(self.leakagePowerTabWhenCombo, 0, 1)
        leakagePowerTabFrameGrid.addWidget(self.leakagePowerTabRelatedPgPinLabel, 0, 2)
        leakagePowerTabFrameGrid.addWidget(self.leakagePowerTabRelatedPgPinCombo, 0, 3)
        leakagePowerTabFrameGrid.addWidget(self.leakagePowerTabEmptyLabel, 0, 4, 1, 6)

        self.leakagePowerTabFrame.setLayout(leakagePowerTabFrameGrid) 
Example 4
Project: libView   Author: liyanqing1987   File: libView.py    GNU General Public License v2.0 6 votes vote down vote up
def initTimingTabBundleBusFrame(self):
        # self.timingTabBundleBusFrame
        self.timingTabBundleLabel = QLabel('bundle:', self.timingTabBundleBusFrame)
        self.timingTabBundleLabel.setAlignment(Qt.AlignRight)
        self.timingTabBundleCombo = QComboBox(self.timingTabBundleBusFrame)
        self.timingTabBundleCombo.activated.connect(self.updateTimingTabPinCombo)

        self.timingTabBusLabel = QLabel('bus:', self.timingTabBundleBusFrame)
        self.timingTabBusLabel.setAlignment(Qt.AlignRight)
        self.timingTabBusCombo = QComboBox(self.timingTabBundleBusFrame)
        self.timingTabBusCombo.activated.connect(self.updateTimingTabPinCombo)

        # self.timingTabBundleBusFrame - Grid
        timingTabBundleBusFrameGrid = QGridLayout()

        timingTabBundleBusFrameGrid.addWidget(self.timingTabBundleLabel, 0, 0)
        timingTabBundleBusFrameGrid.addWidget(self.timingTabBundleCombo, 0, 1)
        timingTabBundleBusFrameGrid.addWidget(self.timingTabBusLabel, 1, 0)
        timingTabBundleBusFrameGrid.addWidget(self.timingTabBusCombo, 1, 1)

        self.timingTabBundleBusFrame.setLayout(timingTabBundleBusFrameGrid) 
Example 5
Project: libView   Author: liyanqing1987   File: libView.py    GNU General Public License v2.0 6 votes vote down vote up
def initInternalPowerTabBundleBusFrame(self):
        # self.internalPowerTabBundleBusFrame
        self.internalPowerTabBundleLabel = QLabel('bundle:', self.internalPowerTabBundleBusFrame)
        self.internalPowerTabBundleLabel.setAlignment(Qt.AlignRight)
        self.internalPowerTabBundleCombo = QComboBox(self.internalPowerTabBundleBusFrame)
        self.internalPowerTabBundleCombo.activated.connect(self.updateInternalPowerTabPinCombo)

        self.internalPowerTabBusLabel = QLabel('bus:', self.internalPowerTabBundleBusFrame)
        self.internalPowerTabBusLabel.setAlignment(Qt.AlignRight)
        self.internalPowerTabBusCombo = QComboBox(self.internalPowerTabBundleBusFrame)
        self.internalPowerTabBusCombo.activated.connect(self.updateInternalPowerTabPinCombo)

        # self.internalPowerTabBundleBusFrame - Grid
        internalPowerTabBundleBusFrameGrid = QGridLayout()

        internalPowerTabBundleBusFrameGrid.addWidget(self.internalPowerTabBundleLabel, 0, 0)
        internalPowerTabBundleBusFrameGrid.addWidget(self.internalPowerTabBundleCombo, 0, 1)
        internalPowerTabBundleBusFrameGrid.addWidget(self.internalPowerTabBusLabel, 1, 0)
        internalPowerTabBundleBusFrameGrid.addWidget(self.internalPowerTabBusCombo, 1, 1)

        self.internalPowerTabBundleBusFrame.setLayout(internalPowerTabBundleBusFrameGrid) 
Example 6
Project: pywerami   Author: ondrolexa   File: mainapp.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, version, parent=None):
        """Display a dialog that shows application information."""
        super(AboutDialog, self).__init__(parent)

        self.setWindowTitle('About')
        self.resize(300, 100)

        about = QtWidgets.QLabel('PyWerami {}\nstand-alone program to make an countour/3D plot from a contour data'.format(version))
        about.setAlignment(QtCore.Qt.AlignCenter)

        author = QtWidgets.QLabel('Ondrej Lexa')
        author.setAlignment(QtCore.Qt.AlignCenter)

        github = QtWidgets.QLabel('GitHub: <a href="https://github.com/ondrolexa/pywerami">ondrolexa</a>')
        github.setAlignment(QtCore.Qt.AlignCenter)
        github.setOpenExternalLinks(True)

        self.layout = QtWidgets.QVBoxLayout()
        self.layout.setAlignment(QtCore.Qt.AlignVCenter)

        self.layout.addWidget(about)
        self.layout.addWidget(author)
        self.layout.addWidget(github)

        self.setLayout(self.layout) 
Example 7
Project: dcc   Author: amimo   File: stringswindow.py    Apache License 2.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(StringsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Strings"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.stringswindow = StringsValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.stringswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example 8
Project: dcc   Author: amimo   File: renamewindow.py    Apache License 2.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, element="", info=()):
        super(RenameDialog, self).__init__(parent)

        self.sourceWin = parent
        self.info = info
        self.element = element
        title = "Rename: " + element
        self.setWindowTitle(title)

        layout = QtWidgets.QGridLayout()
        question = QtWidgets.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtWidgets.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtWidgets.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtWidgets.QPushButton("Cancel", self)
        layout.addWidget(self.buttonCancel, 1, 0)

        self.lineEdit.setText(self.element)

        self.setLayout(layout)

        self.buttonCancel.clicked.connect(self.cancelClicked)
        self.buttonOK.clicked.connect(self.okClicked) 
Example 9
Project: dcc   Author: amimo   File: resourceswindow.py    Apache License 2.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(ResourcesWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Resources"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter resource integer pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.resourceswindow = ResourcesValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.resourceswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example 10
Project: dcc   Author: amimo   File: methodswindow.py    Apache License 2.0 6 votes vote down vote up
def __init__(self, parent=None, win=None, session=None):
        super(MethodsWindow, self).__init__(parent)
        self.mainwin = win
        self.session = session
        self.title = "Methods"

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter method name pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.methodswindow = MethodsValueWindow(self, win, session)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.methodswindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example 11
Project: Python_Master_Courses   Author: makelove   File: input_button_clear.py    GNU General Public License v3.0 6 votes vote down vote up
def initUI(self):
        self.inputLabel = QLabel("Input your text")
        self.editLine = QLineEdit()
        self.printButton = QPushButton("Print")
        self.clearButton = QPushButton("Clear")

        self.printButton.clicked.connect(self.printText)
        self.clearButton.clicked.connect(self.clearText)

        inputLayout = QHBoxLayout()
        inputLayout.addWidget(self.inputLabel)
        inputLayout.addWidget(self.editLine)

        buttonLayout = QHBoxLayout()
        buttonLayout.addWidget(self.printButton)
        buttonLayout.addWidget(self.clearButton)

        mainLayout = QVBoxLayout()
        mainLayout.addLayout(inputLayout)
        mainLayout.addLayout(buttonLayout)

        self.setLayout(mainLayout)
        self.setWindowTitle('FristWindow')
        self.show() 
Example 12
Project: kucher   Author: Zubax   File: active_alerts_widget.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent: QWidget):
        super(ActiveAlertsWidget, self).__init__(parent, 'Active alerts', _ICON_OK)

        self._content = QLabel()
        self._content.setWordWrap(True)
        self._content.setAlignment(Qt.AlignCenter)

        font = QFont()
        font.setBold(True)
        font.setPointSize(round(font.pointSize() * 0.8))
        self._content.setFont(font)

        layout = QVBoxLayout()
        layout.addStretch(1)
        layout.addWidget(self._content)
        layout.addStretch(1)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        self.reset() 
Example 13
Project: kucher   Author: Zubax   File: __init__.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent: QWidget):
        super(LogWidget, self).__init__(parent)
        self.setAttribute(Qt.WA_DeleteOnClose)                  # This is required to stop background timers!

        self._clear_button = make_button(self, 'Clear', 'delete-document', on_clicked=self._do_clear)
        self._status_display = QLabel(self)

        self._model = _TableModel(self)
        self._model.layoutChanged.connect(self._on_model_changed)

        self._table_view = _TableView(self, self._model)

        # View setup
        controls_layout = QHBoxLayout()
        controls_layout.addWidget(self._clear_button)
        controls_layout.addStretch(1)
        controls_layout.addWidget(self._status_display)

        layout = QVBoxLayout()
        layout.addLayout(controls_layout)
        layout.addWidget(self._table_view, 1)
        self.setLayout(layout) 
Example 14
Project: MovieHeavens   Author: lt94   File: movies.py    GNU General Public License v2.0 6 votes vote down vote up
def init_widgets(self):
        self.setWindowTitle(self.tr("Search Movies"))
        self.setGeometry(self.left, self.top, self.width, self.height)
        self.movie_name_label = QLabel(self.tr("电影名称:"))
        self.movie_name_line_edit = QLineEdit()

        self.movie_source_label = QLabel(self.tr("选择片源:"))
        self.movie_source_combobox = QComboBox()
        self.movie_source_combobox.addItem(self.tr('电影天堂'))

        self.search_push_button = QPushButton(self.tr("查询"))

        self.tip_label = QLabel(self.tr("未开始查询..."))
        self.search_content_label = QLabel(self.tr("查询内容:"))
        self.search_content_text_list = QListWidget()

        self.menu_bar = self.menuBar()

        return self 
Example 15
Project: LeitnerEmulator   Author: lovac42   File: plan0.py    GNU General Public License v3.0 6 votes vote down vote up
def dconfsetupUi(self, Dialog):
    r=self.gridLayout_3.rowCount()

    self.sm0emu = QtWidgets.QCheckBox(self.tab_3)
    self.sm0emu.setObjectName(_fromUtf8("sm0emu"))
    self.sm0emu.setText(_('Use Custom Intervals'))
    self.gridLayout_3.addWidget(self.sm0emu, r, 0, 1, 3)
    self.sm0emu.toggled.connect(lambda:togglesm0emuCB(self))
    r+=1

    self.sm2HLayout = QtWidgets.QHBoxLayout()
    self.sm2HLayout.setObjectName(_fromUtf8("sm2HLayout"))
    self.sm0StepsLabel = QtWidgets.QLabel(Dialog)
    self.sm0StepsLabel.setObjectName(_fromUtf8("sm0StepsLabel"))
    self.sm0StepsLabel.setText(_("Ivl Steps:"))
    self.sm2HLayout.addWidget(self.sm0StepsLabel)

    self.sm0Steps = QtWidgets.QLineEdit(self.tab_3)
    self.sm0Steps.setObjectName(_fromUtf8("sm0Steps"))
    self.sm2HLayout.addWidget(self.sm0Steps)
    self.gridLayout_3.addLayout(self.sm2HLayout, r, 0, 1, 2) 
Example 16
Project: Python-GUI   Author: arpitj07   File: scorewidnow.py    MIT License 6 votes vote down vote up
def setupUi(self, ScoreWindow):
        ScoreWindow.setObjectName("ScoreWindow")
        ScoreWindow.resize(471, 386)
        self.centralwidget = QtWidgets.QWidget(ScoreWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.Score = QtWidgets.QLineEdit(self.centralwidget)
        self.Score.setGeometry(QtCore.QRect(180, 180, 113, 22))
        self.Score.setObjectName("Score")
        self.teamscore = QtWidgets.QLabel(self.centralwidget)
        self.teamscore.setGeometry(QtCore.QRect(180, 130, 151, 20))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.teamscore.setFont(font)
        self.teamscore.setObjectName("teamscore")
        ScoreWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(ScoreWindow)
        self.statusbar.setObjectName("statusbar")
        ScoreWindow.setStatusBar(self.statusbar)

        self.retranslateUi(ScoreWindow)
        QtCore.QMetaObject.connectSlotsByName(ScoreWindow) 
Example 17
Project: HippMapp3r   Author: mgoubran   File: gui_options.py    GNU General Public License v3.0 6 votes vote down vote up
def print_help(main, helpfun):
    main.setWindowTitle('Help function')
    scrollarea = QtWidgets.QScrollArea()

    helplbl = QtWidgets.QLabel()
    helplbl.setText(helpfun)
    font = QtGui.QFont('Mono', 9, QtGui.QFont.Light)
    helplbl.setFont(font)
    helplbl.setWordWrap(True)

    scrollarea.setWidget(helplbl)
    #scrollarea.setWidgetResizable(False)
    scrollarea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
    scrollarea.setAttribute(QtCore.Qt.WA_DeleteOnClose)
    main.setCentralWidget(scrollarea)

    main.move(QtWidgets.QApplication.desktop().screen().rect().center() - main.rect().center())
    main.show()

    QtWidgets.QApplication.processEvents() 
Example 18
Project: cct   Author: awacha   File: circulator.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def setFlagBackground(self, flag: QtWidgets.QLabel, state: bool, label: Optional[str] = None):
        palette = flag.palette()
        assert isinstance(palette, QtGui.QPalette)
        if state is None:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('gray'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        elif state:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('lightgreen'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        else:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('red'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('white'))
        flag.setPalette(palette)
        flag.setAutoFillBackground(True)
        if label is not None:
            flag.setText(label) 
Example 19
Project: JI-Live-Danmu-Client   Author: SJTU-UMJI-Tech   File: Marquee.py    MIT License 5 votes vote down vote up
def __init__(self, parent, text, color, screenWidth, screenHeight):
        super().__init__(parent)
        self.changeIdx = 0
        self.clrIdx = 0
        self.changeRGB = [0, 0, 0]
        self.label = QLabel(self)
        self.initUi(text, color, screenWidth, screenHeight) 
Example 20
Project: libView   Author: liyanqing1987   File: libView.py    GNU General Public License v2.0 5 votes vote down vote up
def initMainFrame(self):
        """
        Init self.mainFrame.
        """
        # self.mainFram
        self.mainFrame.setFrameShadow(QFrame.Raised)
        self.mainFrame.setFrameShape(QFrame.Box)

        self.libLabel = QLabel('Lib', self.mainFrame)
        self.libLabel.setStyleSheet("font-weight: bold;")
        self.libLine = QLineEdit()

        self.cellLabel = QLabel('Cell', self.mainFrame)
        self.cellLabel.setStyleSheet("font-weight: bold;")
        self.cellLine = QLineEdit()

        self.tabWidget = QTabWidget(self.mainFrame)

        # self.mainFram - Grid
        mainFrameGrid = QGridLayout()

        mainFrameGrid.addWidget(self.libLabel, 0, 0)
        mainFrameGrid.addWidget(self.libLine, 0, 1)
        mainFrameGrid.addWidget(self.cellLabel, 1, 0)
        mainFrameGrid.addWidget(self.cellLine, 1, 1)
        mainFrameGrid.addWidget(self.tabWidget, 2, 0, 1, 2)

        mainFrameGrid.setRowStretch(0, 1)
        mainFrameGrid.setRowStretch(1, 1)
        mainFrameGrid.setRowStretch(2, 10)

        self.mainFrame.setLayout(mainFrameGrid)

        # Init self.tabWidget
        self.initTabWidget() 
Example 21
Project: libView   Author: liyanqing1987   File: libView.py    GNU General Public License v2.0 5 votes vote down vote up
def tabWidgetCurrentChanged(self):
        """
        Update the related QLabel if the current tab is changed. 
        """
        if self.tabWidget.currentIndex() == 0:
            self.updateAreaTabFigure()
        elif self.tabWidget.currentIndex() == 1:
            self.updateLeakagePowerTabFigure()
        elif self.tabWidget.currentIndex() == 2:
            self.updateTimingTabFigure()
        elif self.tabWidget.currentIndex() == 3:
            self.updateInternalPowerTabFigure() 
Example 22
Project: openocd-svd   Author: esynr3z   File: ui_about.py    MIT License 5 votes vote down vote up
def setupUi(self, AboutDialog):
        AboutDialog.setObjectName("AboutDialog")
        AboutDialog.setWindowModality(QtCore.Qt.NonModal)
        AboutDialog.resize(350, 200)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(AboutDialog.sizePolicy().hasHeightForWidth())
        AboutDialog.setSizePolicy(sizePolicy)
        AboutDialog.setMinimumSize(QtCore.QSize(350, 200))
        AboutDialog.setMaximumSize(QtCore.QSize(350, 200))
        AboutDialog.setModal(False)
        self.verticalLayout = QtWidgets.QVBoxLayout(AboutDialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.lab_version = QtWidgets.QLabel(AboutDialog)
        self.lab_version.setAlignment(QtCore.Qt.AlignCenter)
        self.lab_version.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
        self.lab_version.setObjectName("lab_version")
        self.verticalLayout.addWidget(self.lab_version)
        self.label_2 = QtWidgets.QLabel(AboutDialog)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
        self.label_2.setObjectName("label_2")
        self.verticalLayout.addWidget(self.label_2)
        self.label_3 = QtWidgets.QLabel(AboutDialog)
        self.label_3.setAlignment(QtCore.Qt.AlignCenter)
        self.label_3.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
        self.label_3.setObjectName("label_3")
        self.verticalLayout.addWidget(self.label_3)
        self.buttonBox = QtWidgets.QDialogButtonBox(AboutDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(AboutDialog)
        self.buttonBox.clicked['QAbstractButton*'].connect(AboutDialog.close)
        QtCore.QMetaObject.connectSlotsByName(AboutDialog) 
Example 23
Project: idasec   Author: RobinDavid   File: static_opaque_analysis.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def make_progress_bar(self, parent):
        horizontalLayout_2 = QtWidgets.QHBoxLayout()
        horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.loading_stat = QtWidgets.QLabel(parent)
        horizontalLayout_2.addWidget(self.loading_stat)
        self.progressbar_loading = QtWidgets.QProgressBar(parent)
        horizontalLayout_2.addWidget(self.progressbar_loading)
        self.stop_button = QtWidgets.QPushButton(parent)
        self.stop_button.setMaximumSize(QtCore.QSize(50, 30))
        self.stop_button.setText("stop")
        horizontalLayout_2.addWidget(self.stop_button)
        self.stop_button.clicked.connect(self.stop_button_clicked)
        return horizontalLayout_2 
Example 24
Project: dcc   Author: amimo   File: xrefwindow.py    Apache License 2.0 5 votes vote down vote up
def __init__(self,
                 parent=None,
                 win=None,
                 xrefs=None,
                 headers=["Origin", "Method"]):
        super(XrefListView, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.setMinimumSize(600, 400)

        self.filterPatternLineEdit = QtWidgets.QLineEdit()
        self.filterPatternLabel = QtWidgets.QLabel("&Filter origin pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

        self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers)

        sourceLayout = QtWidgets.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example 25
Project: pymovie   Author: bob-anderson-ok   File: aperturesFileTagDialog.py    MIT License 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(600, 102)
        Dialog.setMinimumSize(QtCore.QSize(400, 0))
        Dialog.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.apertureGroupTagEdit = QtWidgets.QLineEdit(Dialog)
        font = QtGui.QFont()
        font.setPointSize(13)
        self.apertureGroupTagEdit.setFont(font)
        self.apertureGroupTagEdit.setFocusPolicy(QtCore.Qt.StrongFocus)
        self.apertureGroupTagEdit.setMaxLength(80)
        self.apertureGroupTagEdit.setObjectName("apertureGroupTagEdit")
        self.verticalLayout.addWidget(self.apertureGroupTagEdit)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Vertical)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.setObjectName("buttonBox")
        self.horizontalLayout.addWidget(self.buttonBox)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example 26
Project: pymovie   Author: bob-anderson-ok   File: ocrProfileNameDialog.py    MIT License 5 votes vote down vote up
def setupUi(self, ocrNameDialog):
        ocrNameDialog.setObjectName("ocrNameDialog")
        ocrNameDialog.resize(859, 203)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(ocrNameDialog.sizePolicy().hasHeightForWidth())
        ocrNameDialog.setSizePolicy(sizePolicy)
        ocrNameDialog.setMinimumSize(QtCore.QSize(0, 0))
        ocrNameDialog.setMaximumSize(QtCore.QSize(16777215, 300))
        self.gridLayout = QtWidgets.QGridLayout(ocrNameDialog)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtWidgets.QLabel(ocrNameDialog)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.profileNameEdit = QtWidgets.QLineEdit(ocrNameDialog)
        self.profileNameEdit.setObjectName("profileNameEdit")
        self.gridLayout.addWidget(self.profileNameEdit, 1, 0, 1, 1)
        self.buttonBox = QtWidgets.QDialogButtonBox(ocrNameDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1)

        self.retranslateUi(ocrNameDialog)
        self.buttonBox.accepted.connect(ocrNameDialog.accept)
        self.buttonBox.rejected.connect(ocrNameDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(ocrNameDialog) 
Example 27
Project: kucher   Author: Zubax   File: utils.py    GNU General Public License v3.0 5 votes vote down vote up
def _unittest_icons():
    import math
    import glob
    from PyQt5.QtWidgets import QApplication, QMainWindow, QGroupBox, QGridLayout, QLabel, QSizePolicy
    from PyQt5.QtGui import QFont, QFontMetrics

    app = QApplication([])

    all_icons = list(map(lambda x: os.path.splitext(os.path.basename(x))[0],
                         glob.glob(os.path.join(get_absolute_path('view', 'icons'), '*'))))
    print('All icons:', len(all_icons), all_icons)

    grid_size = int(math.ceil(math.sqrt(len(all_icons))))

    icon_size = QFontMetrics(QFont()).height()

    def render_icon(name: str, row: int, col: int):
        icon = get_icon(name)
        icon_label = QLabel()
        icon_label.setAlignment(Qt.AlignCenter)
        icon_label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        icon_label.setPixmap(icon.pixmap(icon_size, icon_size))
        layout.addWidget(icon_label, row, col)

    win = QMainWindow()
    container = QGroupBox(win)
    layout = QGridLayout()

    for idx, ic in enumerate(all_icons):
        render_icon(ic, idx // grid_size, idx % grid_size)

    container.setLayout(layout)
    win.setCentralWidget(container)
    win.show()

    for _ in range(1000):
        time.sleep(0.005)
        app.processEvents()

    win.close() 
Example 28
Project: kucher   Author: Zubax   File: __init__.py    GNU General Public License v3.0 5 votes vote down vote up
def _init_overlay_widgets(self):
        # Main widget
        operational = WidgetBase(self)

        operational_layout_top = QHBoxLayout()
        operational_layout_top.addWidget(QLabel('Port:'))
        operational_layout_top.addWidget(self._port_combo, stretch=1)
        operational_layout_top.addWidget(self._connect_button)

        operational_layout_bottom = QHBoxLayout()
        operational_layout_bottom.addWidget(self._status_text)

        operational_layout = QVBoxLayout()
        operational_layout.addLayout(operational_layout_top)
        operational_layout.addLayout(operational_layout_bottom)
        operational_layout.addWidget(self._device_info_widget, 1)

        operational.setLayout(operational_layout)
        self._overlay.addWidget(operational)

        # Progress widget - shown while connecting/disconnecting
        progress = WidgetBase(self)
        progress_layout = QVBoxLayout()
        progress_layout.addStretch(1)
        progress_layout.addWidget(self._connection_progress_bar)
        progress_layout.addStretch(1)
        progress.setLayout(progress_layout)
        self._overlay.addWidget(progress) 
Example 29
Project: kucher   Author: Zubax   File: placeholder_widget.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent: QWidget):
        super(PlaceholderWidget, self).__init__(parent)

        label = QLabel(self)
        label.setText('Task-specific status information is not available')
        label.setWordWrap(True)
        label.setAlignment(Qt.AlignCenter)

        font: QFont = label.font()
        font.setItalic(True)
        label.setFont(font)

        layout = QVBoxLayout()
        layout.addWidget(label)
        self.setLayout(layout) 
Example 30
Project: kucher   Author: Zubax   File: run_status_widget.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent: QWidget):
        super(_DQDisplayWidget, self).__init__(parent)

        def make_label(text: str = '') -> QLabel:
            w = QLabel(text, self)
            w.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
            font = QFont()
            font.setBold(True)
            w.setFont(font)
            return w

        self._ud = make_label()
        self._uq = make_label()
        self._id = make_label()
        self._iq = make_label()

        self._ud.setToolTip('Direct axis voltage')
        self._uq.setToolTip('Quadrature axis voltage')
        self._id.setToolTip('Direct axis current')
        self._iq.setToolTip('Quadrature axis current')

        # 0  1  2
        # 1 Ud Uq
        # 2 Id Iq
        layout = QGridLayout(self)
        layout.addWidget(QLabel('U<sub>DQ</sub>', self), 0, 0)
        layout.addWidget(QLabel('I<sub>DQ</sub>', self), 1, 0)
        layout.addWidget(self._ud, 0, 1)
        layout.addWidget(self._uq, 0, 2)
        layout.addWidget(self._id, 1, 1)
        layout.addWidget(self._iq, 1, 2)
        layout.addWidget(make_label('V'), 0, 3)
        layout.addWidget(make_label('A'), 1, 3)
        layout.setColumnStretch(0, 4)
        layout.setColumnStretch(1, 2)
        layout.setColumnStretch(2, 2)
        layout.setColumnStretch(3, 1)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout) 
Example 31
Project: kucher   Author: Zubax   File: value_display_widget.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self,
                 parent: QWidget,
                 title: str,
                 placeholder_text: typing.Optional[str] = None,
                 with_comment: bool = False,
                 tooltip: typing.Optional[str] = None):
        super(ValueDisplayWidget, self).__init__(parent)

        self._placeholder_text = str(placeholder_text or '')

        self._value_display = QLabel(self)
        self._value_display.setAlignment(Qt.AlignVCenter | Qt.AlignRight)
        bold_font = QFont()
        bold_font.setBold(True)
        self._value_display.setFont(bold_font)

        if with_comment:
            self._comment = _Comment(self)
        else:
            self._comment = None

        self._default_tooltip = str(tooltip or '')
        self.setToolTip(self._default_tooltip)
        self.setStatusTip(self.toolTip())

        title_label = QLabel(title)
        title_label.setAlignment(Qt.AlignVCenter | Qt.AlignLeft)

        layout = QHBoxLayout()
        layout.addWidget(title_label, 1)
        layout.addWidget(self._value_display, 1)
        if self._comment is not None:
            layout.addWidget(self._comment)

        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)
        self.reset() 
Example 32
Project: MovieHeavens   Author: lt94   File: movies.py    GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, resources, title):
        super(ImageWindow, self).__init__()
        self.setWindowTitle(title)

        self.central_widget = QWidget()
        self.setCentralWidget(self.central_widget)
        layout = QVBoxLayout(self.central_widget)

        image = QImage(resources)
        pixmap = QPixmap(resources)
        image_label = QLabel(self)
        image_label.setPixmap(pixmap)
        image_label.resize(pixmap.width(), pixmap.height())
        layout.addWidget(image_label) 
Example 33
Project: CT-Marker   Author: OoO256   File: qt.py    MIT License 5 votes vote down vote up
def addLine(self, idx, name, text, box = 'line', button = None, callback = None):
        self.grid.addWidget(QLabel(text), idx, 0)

        if box is 'line':
            self.lines[name] = QLineEdit()
            self.grid.addWidget(self.lines[name], idx, 1)
        elif box is 'text':
            self.inputs.append(QTextEdit())
            self.grid.addWidget(self.inputs[len(self.inputs) - 1], idx, 1)

        if button is not None:
            self.buttons[name] = QPushButton(button, self)
            self.grid.addWidget(self.buttons[name], idx, 2)

            self.buttons[name].clicked.connect(callback) 
Example 34
Project: rainbow6-siege-danmu-request   Author: fy-meng   File: gui.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, font, font_size, font_color, bg_color):
        super().__init__()
        self.setGeometry(300, 300, 200, 400)
        self.setWindowTitle('Display')
        self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint)
        self.setStyleSheet('QWidget {background-color: ' + bg_color + '}')

        text = 'ATTACKERS:\n' \
               '    BLACKBEARD\n' \
               '    --\n' \
               '    --\n' \
               'DEFENDERS:\n' \
               '    --\n' \
               '    --\n' \
               '    --'
        self._label = QLabel(text, self)
        self._label.setFont(QFont(font, font_size, QFont.Bold))
        self._label.setStyleSheet('QLabel { color: ' + font_color + ';}')

        self._offset = None

        self.show()

        text = 'ATTACKERS:\n' \
               '    --\n' \
               '    --\n' \
               '    --\n' \
               'DEFENDERS:\n' \
               '    --\n' \
               '    --\n' \
               '    --'

        self._label.setText(text) 
Example 35
Project: Python-GUI   Author: arpitj07   File: New.py    MIT License 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.label = QtWidgets.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(100, 40, 201, 81))
        font = QtGui.QFont()
        font.setPointSize(9)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")

        
        self.pushButton = QtWidgets.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(150, 190, 111, 28))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName("pushButton")
        
        self.lineEdit = QtWidgets.QLineEdit(Form)
        self.lineEdit.setGeometry(QtCore.QRect(100, 140, 201, 22))
        self.lineEdit.setObjectName("lineEdit")

        
        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example 36
Project: Python-GUI   Author: arpitj07   File: openWindow.py    MIT License 5 votes vote down vote up
def setupUi(self, OpenWindow):
        OpenWindow.setObjectName("OpenWindow")
        OpenWindow.resize(535, 389)
        self.centralwidget = QtWidgets.QWidget(OpenWindow)
        self.centralwidget.setObjectName("centralwidget")
        
        self.OpenTeam = QtWidgets.QLabel(self.centralwidget)
        self.OpenTeam.setGeometry(QtCore.QRect(150, 120, 231, 20))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.OpenTeam.setFont(font)
        self.OpenTeam.setObjectName("OpenTeam")

        
        self.OpenTheTeam = QtWidgets.QLineEdit(self.centralwidget)
        self.OpenTheTeam.setGeometry(QtCore.QRect(180, 160, 151, 22))
        self.OpenTheTeam.setObjectName("OpenTheTeam")
        
        self.openButton = QtWidgets.QPushButton(self.centralwidget)
        self.openButton.setGeometry(QtCore.QRect(210, 210, 93, 28))
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.openButton.setFont(font)
        self.openButton.setObjectName("openButton")
        
        OpenWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(OpenWindow)
        self.statusbar.setObjectName("statusbar")
        OpenWindow.setStatusBar(self.statusbar)

        self.retranslateUi(OpenWindow)
        QtCore.QMetaObject.connectSlotsByName(OpenWindow) 
Example 37
Project: straditize   Author: Chilipp   File: progress_widget.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, straditizer_widgets, item):
        super().__init__()
        self.init_straditizercontrol(straditizer_widgets, item)

        self.combo_display = QtWidgets.QComboBox()
        self.combo_display.setEditable(False)

        for state in [TASK_TODO, DONE, NOTYET]:
            self.combo_display.addItem(QtGui.QIcon(icons[state]), state)
        self.combo_display.addItem(ALL_TASKS)

        self.progress_list = QtWidgets.QListWidget()
        self.info_label = QtWidgets.QLabel()
        self.info_label.setWordWrap(True)
        self.info_label.setStyleSheet('border: 1px solid black')

        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.combo_display)
        vbox.addWidget(self.progress_list)
        vbox.addWidget(self.info_label)
        self.setLayout(vbox)

        self.populate_list()
        self.setup_menu()
        self.refresh()
        self.combo_display.currentIndexChanged.connect(self.refresh)
        self.progress_list.itemDoubleClicked.connect(self.show_rst)
        self.progress_list.currentItemChanged.connect(self.show_rst)
        self.progress_list.currentItemChanged.connect(self.update_info_label) 
Example 38
Project: pyweed   Author: iris-edu   File: SpinnerWidget.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupUi(self, SpinnerWidget):
        SpinnerWidget.setObjectName("SpinnerWidget")
        SpinnerWidget.resize(306, 207)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(SpinnerWidget.sizePolicy().hasHeightForWidth())
        SpinnerWidget.setSizePolicy(sizePolicy)
        SpinnerWidget.setStyleSheet("QFrame { background-color: rgba(224,224,224,192)} \n"
"QLabel { background-color: transparent }")
        self.verticalLayout = QtWidgets.QVBoxLayout(SpinnerWidget)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.icon = QtWidgets.QLabel(SpinnerWidget)
        self.icon.setText("")
        self.icon.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignHCenter)
        self.icon.setObjectName("icon")
        self.verticalLayout.addWidget(self.icon)
        self.label = QtWidgets.QLabel(SpinnerWidget)
        self.label.setText("")
        self.label.setAlignment(QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.cancelButton = QtWidgets.QPushButton(SpinnerWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cancelButton.sizePolicy().hasHeightForWidth())
        self.cancelButton.setSizePolicy(sizePolicy)
        self.cancelButton.setObjectName("cancelButton")
        self.horizontalLayout.addWidget(self.cancelButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout.setStretch(0, 1)
        self.verticalLayout.setStretch(1, 1)

        self.retranslateUi(SpinnerWidget)
        QtCore.QMetaObject.connectSlotsByName(SpinnerWidget) 
Example 39
Project: pyweed   Author: iris-edu   File: MyTableWidgetImageWidget.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None, imagePath=None):
        super(MyTableWidgetImageWidget, self).__init__(parent)
        pic = QtGui.QPixmap(imagePath)
        # NOTE:  From QPixmap we could use scaledToWidth() but the resulting images aren't so pretty
        # pic = pic.scaledToWidth(500)
        self.setPixmap(pic)
        # NOTE:  From QLabel we could use setScaledContents() but this doesn't preserve the aspect ratio
        # self.setScaledContents(True) 
Example 40
Project: cct   Author: awacha   File: devicestatus.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setLabelBackgroundColor(self, label: QtWidgets.QLabel, color: QtGui.QColor):
        pal = label.palette()
        pal.setColor(QtGui.QPalette.Window, color)
        label.setPalette(pal)
        label.setAutoFillBackground(True) 
Example 41
Project: cct   Author: awacha   File: detector.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setFlagBackground(self, flag: QtWidgets.QLabel, state: str):
        palette = flag.palette()
        assert isinstance(palette, QtGui.QPalette)
        if state == 'ok':
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('green'))
        elif state == 'warning':
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('orange'))
        else:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('red'))
        flag.setPalette(palette)
        flag.setAutoFillBackground(True) 
Example 42
Project: cct   Author: awacha   File: connections.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setupUi(self, Form):
        assert isinstance(self.credo, Instrument)
        self.layout = QtWidgets.QGridLayout(self)
        for i, d in enumerate(sorted(self.credo.devices)):
            dev = self.credo.devices[d]
            assert isinstance(dev, Device)
            self.layout.addWidget(QtWidgets.QLabel(dev.name, self), i, 0)
            self._connectbuttons[d] = QtWidgets.QPushButton('Connect', self)
            self.layout.addWidget(self._connectbuttons[d], i, 1)
            self._connectbuttons[d].clicked.connect(self.onButtonClicked)
            self._disconnectbuttons[d] = QtWidgets.QPushButton('Disconnect', self)
            self.layout.addWidget(self._disconnectbuttons[d], i, 2)
            self._disconnectbuttons[d].clicked.connect(self.onButtonClicked)
        self.setWindowTitle('Connect/disconnect devices')
        self.setWindowIcon(QtGui.QIcon.fromTheme('network-idle')) 
Example 43
Project: cct   Author: awacha   File: xraysource.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setFlagBackground(self, flag: QtWidgets.QLabel, state: bool):
        palette = flag.palette()
        assert isinstance(palette, QtGui.QPalette)
        if state is None:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('gray'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        elif state:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('lightgreen'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        else:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('red'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('white'))
        flag.setPalette(palette)
        flag.setAutoFillBackground(True) 
Example 44
Project: musaic   Author: al165   File: elements.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, engine, *args, **kwargs):
        super(SectionView, self).__init__(*args, **kwargs)

        self.section_layout = QtWidgets.QStackedLayout()

        null_view = QtWidgets.QLabel('No section selected...')
        null_view.setLayout(QtWidgets.QHBoxLayout())
        self.section_layout.insertWidget(0, null_view)

        self._section_paramters = SectionParameters(engine)
        self.section_layout.insertWidget(1, self._section_paramters)

        self.setLayout(self.section_layout) 
Example 45
Project: PyLSS   Author: gmrandazzo   File: gui_aboutdialog.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupUi(self, AboutDialog):
        AboutDialog.setObjectName("AboutDialog")
        AboutDialog.resize(339, 106)
        self.gridLayout = QtWidgets.QGridLayout(AboutDialog)
        self.gridLayout.setObjectName("gridLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(AboutDialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.label_2 = QtWidgets.QLabel(AboutDialog)
        self.label_2.setOpenExternalLinks(True)
        self.label_2.setObjectName("label_2")
        self.verticalLayout.addWidget(self.label_2)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.closeButton = QtWidgets.QPushButton(AboutDialog)
        self.closeButton.setMaximumSize(QtCore.QSize(110, 32))
        self.closeButton.setObjectName("closeButton")
        self.horizontalLayout.addWidget(self.closeButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)

        self.retranslateUi(AboutDialog)
        QtCore.QMetaObject.connectSlotsByName(AboutDialog) 
Example 46
Project: PyLSS   Author: gmrandazzo   File: gui_plotmaps.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def setupUi(self, PlotMaps):
        PlotMaps.setObjectName("PlotMaps")
        PlotMaps.resize(811, 654)
        self.gridLayout = QtWidgets.QGridLayout(PlotMaps)
        self.gridLayout.setObjectName("gridLayout")
        self.label_4 = QtWidgets.QLabel(PlotMaps)
        self.label_4.setObjectName("label_4")
        self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(358, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
        self.modelBox = QtWidgets.QComboBox(PlotMaps)
        self.modelBox.setMinimumSize(QtCore.QSize(260, 26))
        self.modelBox.setObjectName("modelBox")
        self.gridLayout.addWidget(self.modelBox, 0, 2, 1, 1)
        self.plotterBox = QtWidgets.QGroupBox(PlotMaps)
        self.plotterBox.setMinimumSize(QtCore.QSize(551, 311))
        self.plotterBox.setObjectName("plotterBox")
        self.gridLayout.addWidget(self.plotterBox, 1, 0, 1, 4)
        spacerItem1 = QtWidgets.QSpacerItem(932, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 2, 0, 1, 3)
        self.closeButton = QtWidgets.QPushButton(PlotMaps)
        self.closeButton.setMaximumSize(QtCore.QSize(110, 32))
        self.closeButton.setObjectName("closeButton")
        self.gridLayout.addWidget(self.closeButton, 2, 3, 1, 1)
        self.closeButton.raise_()
        self.plotterBox.raise_()

        self.retranslateUi(PlotMaps)
        QtCore.QMetaObject.connectSlotsByName(PlotMaps) 
Example 47
Project: PyQt-multifunctional-uart-helper   Author: IronSublimate   File: Ui_piano.py    MIT License 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.groupBox_settings = QtWidgets.QGroupBox(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox_settings.sizePolicy().hasHeightForWidth())
        self.groupBox_settings.setSizePolicy(sizePolicy)
        self.groupBox_settings.setObjectName("groupBox_settings")
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.groupBox_settings)
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
        self.label_10 = QtWidgets.QLabel(self.groupBox_settings)
        self.label_10.setObjectName("label_10")
        self.horizontalLayout_6.addWidget(self.label_10)
        self.comboBox_transpose = QtWidgets.QComboBox(self.groupBox_settings)
        self.comboBox_transpose.setObjectName("comboBox_transpose")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.comboBox_transpose.addItem("")
        self.horizontalLayout_6.addWidget(self.comboBox_transpose)
        self.gridLayout.addWidget(self.groupBox_settings, 0, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(219, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(375, 208, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem1, 1, 0, 1, 2)

        self.retranslateUi(Form)
        self.comboBox_transpose.setCurrentIndex(3)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example 48
Project: pyaudiorestoration   Author: HENDRIX-ZT2   File: widgets.py    GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, with_canvas=True):
		QtWidgets.QWidget.__init__(self,)
		
		display_l = QtWidgets.QLabel("Display")
		display_l.setFont(myFont)
		
		fft_l = QtWidgets.QLabel("FFT Size")
		self.fft_c = QtWidgets.QComboBox(self)
		self.fft_c.addItems(("64", "128", "256", "512", "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072"))
		self.fft_c.setToolTip("This determines the frequency resolution.")
		self.fft_c.setCurrentIndex(5)
		
		overlap_l = QtWidgets.QLabel("FFT Overlap")
		self.overlap_c = QtWidgets.QComboBox(self)
		self.overlap_c.addItems(("1", "2", "4", "8", "16", "32"))
		self.overlap_c.setToolTip("Increase to improve temporal resolution.")
		self.overlap_c.setCurrentIndex(2)
		
		buttons = [(display_l,), (fft_l, self.fft_c), (overlap_l, self.overlap_c)]
		
		if with_canvas:
			show_l = QtWidgets.QLabel("Show")
			self.show_c = QtWidgets.QComboBox(self)
			self.show_c.addItems(("Both","Traces","Regressions"))
			
			cmap_l = QtWidgets.QLabel("Colors")
			self.cmap_c = QtWidgets.QComboBox(self)
			self.cmap_c.addItems(sorted(color.colormap.get_colormaps().keys()))
			self.cmap_c.setCurrentText("viridis")
		
			
			buttons.extend( ((show_l, self.show_c), (cmap_l,self.cmap_c)) )
			
		vbox(self, grid(buttons))
		
		if with_canvas:
			#only connect in the end
			self.fft_c.currentIndexChanged.connect(self.update_fft_settings)
			self.overlap_c.currentIndexChanged.connect(self.update_fft_settings)
			self.show_c.currentIndexChanged.connect(self.update_show_settings)
			self.cmap_c.currentIndexChanged.connect(self.update_cmap) 
Example 49
Project: pyaudiorestoration   Author: HENDRIX-ZT2   File: widgets.py    GNU General Public License v2.0 5 votes vote down vote up
def __init__(self,):
		QtWidgets.QWidget.__init__(self,)
		align_l = QtWidgets.QLabel("\nAlignment")
		align_l.setFont(myFont)
		
		self.align_abs_b = QtWidgets.QCheckBox("Absolute match")
		self.align_abs_b.setChecked(False)
		self.align_abs_b.setToolTip("Turn on if phase does not match.")
		
		buttons = ((align_l,), (self.align_abs_b, ), )
		vbox(self, grid(buttons)) 
Example 50
Project: pyaudiorestoration   Author: HENDRIX-ZT2   File: widgets.py    GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, ):
		QtWidgets.QWidget.__init__(self,)
		
		resampling_l = QtWidgets.QLabel("\nResampling")
		resampling_l.setFont(myFont)
		mode_l = QtWidgets.QLabel("Mode")
		self.mode_c = QtWidgets.QComboBox(self)
		self.mode_c.addItems(("Linear", "Sinc"))
		self.mode_c.currentIndexChanged.connect(self.toggle_resampling_quality)
		self.sinc_quality_l = QtWidgets.QLabel("Quality")
		self.sinc_quality_s = QtWidgets.QSpinBox()
		self.sinc_quality_s.setRange(1, 100)
		self.sinc_quality_s.setSingleStep(1)
		self.sinc_quality_s.setValue(50)
		self.sinc_quality_s.setToolTip("Number of input samples that contribute to each output sample.\nMore samples = more quality, but slower. Only for sinc mode.")
		self.toggle_resampling_quality()
		
		
		self.mygroupbox = QtWidgets.QGroupBox('Channels')
		self.mygroupbox.setToolTip("Only selected channels will be resampled.")
		self.channel_layout = QtWidgets.QVBoxLayout()
		self.channel_layout.setSpacing(0)
		self.mygroupbox.setLayout(self.channel_layout)
		self.scroll = QtWidgets.QScrollArea()
		self.scroll.setWidget(self.mygroupbox)
		self.scroll.setWidgetResizable(True)
		self.channel_checkboxes = [ ]
		
		buttons = ((resampling_l,), (mode_l, self.mode_c,), (self.sinc_quality_l, self.sinc_quality_s), (self.scroll,))
		vbox(self, grid(buttons))