Python PySide.QtGui.QLabel() Examples

The following are 30 code examples of PySide.QtGui.QLabel(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtGui , or try the search function .
Example #1
Source File: renamewindow.py    From TimeMachine with GNU Lesser General Public License v3.0 7 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 = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.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 #2
Source File: stringswindow.py    From TimeMachine with GNU Lesser General Public License v3.0 7 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 = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

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

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

        self.setLayout(sourceLayout) 
Example #3
Source File: xrefwindow.py    From TimeMachine with GNU Lesser General Public License v3.0 7 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 = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.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 = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #4
Source File: options.py    From dpa-pipe with MIT License 7 votes vote down vote up
def __init__(self, config, name='root', parent=None):

        super(ActionOptionWidget, self).__init__(name, config)

        show_required_label = False
        for widget in self.widgets:
            if widget.required:
                show_required_label = True
                break

        if show_required_label:
            required_label = QtGui.QLabel(REQUIRED + ' required options')
            required_label.setAlignment(QtCore.Qt.AlignRight)
            self._main_layout.addWidget(required_label)
    
# -----------------------------------------------------------------------------
# register all the option types 
Example #5
Source File: customWidgets.py    From pcloudpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __init__(self, parent=None):
        super(Extent, self).__init__(parent)

        self.xmin_lineedit = LineEdit()
        self.xmax_lineedit = LineEdit()
        self.ymin_lineedit = LineEdit()
        self.ymax_lineedit = LineEdit()
        self.zmin_lineedit = LineEdit()
        self.zmax_lineedit = LineEdit()

        grid = QtGui.QGridLayout()
        grid.addWidget(QtGui.QLabel("xmin"), 0,0)
        grid.addWidget(self.xmin_lineedit, 0,1)
        grid.addWidget(QtGui.QLabel("xmax"), 0,2)
        grid.addWidget(self.xmax_lineedit, 0,3)
        grid.addWidget(QtGui.QLabel("ymin"), 1,0)
        grid.addWidget(self.ymin_lineedit, 1,1)
        grid.addWidget(QtGui.QLabel("ymax"), 1,2)
        grid.addWidget(self.ymax_lineedit, 1,3)
        grid.addWidget(QtGui.QLabel("zmin"), 2,0)
        grid.addWidget(self.zmin_lineedit, 2,1)
        grid.addWidget(QtGui.QLabel("zmax"),2,2 )
        grid.addWidget(self.zmax_lineedit, 2,3)

        self.setLayout(grid) 
Example #6
Source File: imports.py    From dpa-pipe with MIT License 6 votes vote down vote up
def product_selection_page(self):

        if hasattr(self, '_product_selection_page'):
            return self._product_selection_page

        page = QtGui.QWizardPage()
        page.setTitle("Selection")
        page.setSubTitle(
            "Select the products you'd like to import.")

        self._product_widget = EntityTreeWidget(self.importable_products)
        self._product_widget.setFocusPolicy(QtCore.Qt.NoFocus)

        layout = QtGui.QVBoxLayout()
        layout.addWidget(QtGui.QLabel('Available for import :'))
        layout.addWidget(self.product_widget)

        page.setLayout(layout)

        self._product_selection_page = page
        return self._product_selection_page

    # ------------------------------------------------------------------------- 
Example #7
Source File: _import.py    From dpa-pipe with MIT License 6 votes vote down vote up
def sub_selection_page(self):

        if hasattr(self, '_sub_selection_page'):
            return self._sub_selection_page

        page = QtGui.QWizardPage()
        page.setTitle("Selection")
        page.setSubTitle(
            "Select the subs you'd like to import.")

        self._subs_widget = SubscriptionTreeWidget(self.subs, 
            show_categories=self._category_lookup.keys())
        self._subs_widget.setFocusPolicy(QtCore.Qt.NoFocus)

        layout = QtGui.QVBoxLayout()
        layout.addWidget(QtGui.QLabel('Available for import :'))
        layout.addWidget(self._subs_widget)

        page.setLayout(layout)

        self._sub_selection_page = page
        return self._sub_selection_page

    # ------------------------------------------------------------------------- 
Example #8
Source File: universal_tool_template_1112.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def quickMsg(self, msg, block=1):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            layout.addWidget(QtWidgets.QLabel(msg))
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        if block:
            tmpMsg.exec_()
        else:
            tmpMsg.show() 
Example #9
Source File: universal_tool_template_1115.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def quickMsg(self, msg, block=1):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            tmpLabel = QtWidgets.QLabel(msg)
            tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
            layout.addWidget(tmpLabel)
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        if block:
            tmpMsg.exec_()
        else:
            tmpMsg.show() 
Example #10
Source File: ScatterPlotSpeedTestTemplate_pyside.py    From tf-pose with Apache License 2.0 6 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.sizeSpin = QtGui.QSpinBox(Form)
        self.sizeSpin.setProperty("value", 10)
        self.sizeSpin.setObjectName("sizeSpin")
        self.gridLayout.addWidget(self.sizeSpin, 1, 1, 1, 1)
        self.pixelModeCheck = QtGui.QCheckBox(Form)
        self.pixelModeCheck.setObjectName("pixelModeCheck")
        self.gridLayout.addWidget(self.pixelModeCheck, 1, 3, 1, 1)
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.plot = PlotWidget(Form)
        self.plot.setObjectName("plot")
        self.gridLayout.addWidget(self.plot, 0, 0, 1, 4)
        self.randCheck = QtGui.QCheckBox(Form)
        self.randCheck.setObjectName("randCheck")
        self.gridLayout.addWidget(self.randCheck, 1, 2, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #11
Source File: UITranslator.py    From universal_tool_template.py with MIT License 6 votes vote down vote up
def setLang(self, langName):
        uiList_lang_read = self.memoData['lang'][langName]
        for ui_name in uiList_lang_read:
            ui_element = self.uiList[ui_name]
            if type(ui_element) in [ QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox ]:
                # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setText(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QGroupBox, QtWidgets.QMenu ]:
                # uiType: QMenu, QGroupBox
                if uiList_lang_read[ui_name] != "":
                    ui_element.setTitle(uiList_lang_read[ui_name])
            elif type(ui_element) in [ QtWidgets.QTabWidget]:
                # uiType: QTabWidget
                tabCnt = ui_element.count()
                if uiList_lang_read[ui_name] != "":
                    tabNameList = uiList_lang_read[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != "":
                                ui_element.setTabText(i,tabNameList[i])
            elif type(ui_element) == str:
                # uiType: string for msg
                if uiList_lang_read[ui_name] != "":
                    self.uiList[ui_name] = uiList_lang_read[ui_name] 
Example #12
Source File: xrefwindow.py    From AndroBugs_Framework with GNU General Public License v3.0 6 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 = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.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 = QtGui.QVBoxLayout()
        sourceLayout.addWidget(self.xrefwindow)
        sourceLayout.addWidget(self.filterPatternLabel)
        sourceLayout.addWidget(self.filterPatternLineEdit)

        self.setLayout(sourceLayout) 
Example #13
Source File: stringswindow.py    From AndroBugs_Framework with GNU General Public License v3.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 = QtGui.QLineEdit()
        self.filterPatternLabel = QtGui.QLabel("&Filter string pattern:")
        self.filterPatternLabel.setBuddy(self.filterPatternLineEdit)
        self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged)

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

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

        self.setLayout(sourceLayout) 
Example #14
Source File: renamewindow.py    From AndroBugs_Framework with GNU General Public License v3.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 = QtGui.QGridLayout()
        question = QtGui.QLabel("Please enter new name:")
        layout.addWidget(question, 0, 0)
        self.lineEdit = QtGui.QLineEdit()
        layout.addWidget(self.lineEdit, 0, 1)
        self.buttonOK = QtGui.QPushButton("OK", self)
        layout.addWidget(self.buttonOK, 1, 1)
        self.buttonCancel = QtGui.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 #15
Source File: GearBox_template_1010.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontUp_action(self):
        self.memoData['font_size'] += 2
        self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size']) 
Example #16
Source File: universal_tool_template_1020.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontNormal_action(self):
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size']) 
Example #17
Source File: universal_tool_template_1116.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontDown_action(self, uiClass_list=[]):
        if len(uiClass_list) == 0:
            uiClass_list = 'QLabel,QPushButton'.split(',')
        if self.memoData['font_size'] >= self.memoData['font_size_default']:
            self.memoData['font_size'] -= 2
            self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) ) 
Example #18
Source File: universal_tool_template_1115.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def setLang(self, langName):
        lang_data = self.memoData['lang'][langName]
        for ui_name in lang_data.keys():
            if ui_name in self.uiList.keys() and lang_data[ui_name] != '':
                ui_element = self.uiList[ui_name]
                # '' means no translation availdanle in that data file
                if isinstance(ui_element, (QtWidgets.QLabel, QtWidgets.QPushButton, QtWidgets.QAction, QtWidgets.QCheckBox) ):
                    # uiType: QLabel, QPushButton, QAction(menuItem), QCheckBox
                    ui_element.setText(lang_data[ui_name])
                elif isinstance(ui_element, (QtWidgets.QGroupBox, QtWidgets.QMenu) ):
                    # uiType: QMenu, QGroupBox
                    ui_element.setTitle(lang_data[ui_name])
                elif isinstance(ui_element, QtWidgets.QTabWidget):
                    # uiType: QTabWidget
                    tabCnt = ui_element.count()
                    tabNameList = lang_data[ui_name].split(';')
                    if len(tabNameList) == tabCnt:
                        for i in range(tabCnt):
                            if tabNameList[i] != '':
                                ui_element.setTabText(i,tabNameList[i])
                elif isinstance(ui_element, QtWidgets.QComboBox):
                    # uiType: QComboBox
                    itemCnt = ui_element.count()
                    itemNameList = lang_data[ui_name].split(';')
                    ui_element.clear()
                    ui_element.addItems(itemNameList)
                elif isinstance(ui_element, QtWidgets.QTreeWidget):
                    # uiType: QTreeWidget
                    labelCnt = ui_element.headerItem().columnCount()
                    labelList = lang_data[ui_name].split(';')
                    ui_element.setHeaderLabels(labelList)
                elif isinstance(ui_element, QtWidgets.QTableWidget):
                    # uiType: QTableWidget
                    colCnt = ui_element.columnCount()
                    headerList = lang_data[ui_name].split(';')
                    cur_table.setHorizontalHeaderLabels( headerList )
                elif isinstance(ui_element, (str, unicode) ):
                    # uiType: string for msg
                    self.uiList[ui_name] = lang_data[ui_name] 
Example #19
Source File: GearBox_template_1010.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontDown_action(self):
        if self.memoData['font_size'] >= self.memoData['font_size_default']:
            self.memoData['font_size'] -= 2
            self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size']) 
Example #20
Source File: universal_tool_template_1112.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontUp_action(self):
        self.memoData['font_size'] += 2
        self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size']) 
Example #21
Source File: universal_tool_template_1116.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontUp_action(self, uiClass_list=[]):
        if len(uiClass_list) == 0:
            uiClass_list = 'QLabel,QPushButton'.split(',')
        self.memoData['font_size'] += 2
        self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) ) 
Example #22
Source File: universal_tool_template_1116.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontNormal_action(self, uiClass_list=[]):
        if len(uiClass_list) == 0:
            uiClass_list = 'QLabel,QPushButton'.split(',')
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.setStyleSheet( "{0} { font-size: {1}pt;}".format(','.join(uiClass_list), self.memoData['font_size']) ) 
Example #23
Source File: universal_tool_template_1116.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def quickMsg(self, msg, block=1, ask=0):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            tmpLabel = QtWidgets.QLabel(msg)
            tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
            layout.addWidget(tmpLabel)
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        if ask==0:
            tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        else:
            tmpMsg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
        if block:
            value = tmpMsg.exec_()
            if value == QtWidgets.QMessageBox.Ok:
                return 1
            else:
                return 0
        else:
            tmpMsg.show()
            return 0 
Example #24
Source File: exportDialogTemplate_pyside.py    From tf-pose with Apache License 2.0 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(241, 367)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 3)
        self.itemTree = QtGui.QTreeWidget(Form)
        self.itemTree.setObjectName("itemTree")
        self.itemTree.headerItem().setText(0, "1")
        self.itemTree.header().setVisible(False)
        self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3)
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3)
        self.formatList = QtGui.QListWidget(Form)
        self.formatList.setObjectName("formatList")
        self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3)
        self.exportBtn = QtGui.QPushButton(Form)
        self.exportBtn.setObjectName("exportBtn")
        self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1)
        self.closeBtn = QtGui.QPushButton(Form)
        self.closeBtn.setObjectName("closeBtn")
        self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1)
        self.paramTree = ParameterTree(Form)
        self.paramTree.setObjectName("paramTree")
        self.paramTree.headerItem().setText(0, "1")
        self.paramTree.header().setVisible(False)
        self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3)
        self.label_3 = QtGui.QLabel(Form)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3)
        self.copyBtn = QtGui.QPushButton(Form)
        self.copyBtn.setObjectName("copyBtn")
        self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #25
Source File: Shared.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 5 votes vote down vote up
def populateParameterEditor(parameters):
    """Puts the proper controls in the script variable editor pane based on the parameters found"""

    mw = FreeCADGui.getMainWindow()

    # If the widget is open, we need to close it
    dockWidgets = mw.findChildren(QtGui.QDockWidget)
    for widget in dockWidgets:
        if widget.objectName() == "cqVarsEditor":
            gridLayout = QtGui.QGridLayout()

            line = 1

            # Add controls for all the parameters so that they can be edited from the GUI
            for pKey, pVal in list(parameters.items()):
                label = QtGui.QLabel(pKey)

                # We want to keep track of this parameter value field so that we can pull its value later when executing
                value = QtGui.QLineEdit()
                value.setText(str(pVal.default_value))
                value.setObjectName("pcontrol_" + pKey)

                # Add the parameter control sets, one set per line
                gridLayout.addWidget(label, line, 0)
                gridLayout.addWidget(value, line, 1)

                line += 1

            # Create a widget we can put the layout in and add a scrollbar
            newWidget = QtGui.QWidget()
            newWidget.setLayout(gridLayout)

            # Add a scroll bar in case there are a lot of variables in the script
            scrollArea = QtGui.QScrollArea()
            scrollArea.setBackgroundRole(QtGui.QPalette.Light)
            scrollArea.setStyleSheet("QLabel { color : black; }");
            scrollArea.setWidget(newWidget)

            widget.setWidget(scrollArea) 
Example #26
Source File: FinderOverlay.py    From cadquery-freecad-module with GNU Lesser General Public License v3.0 5 votes vote down vote up
def initUI(self):
        # container = QWidget(self)
        # container.resize(200, 100);
        # container.setStyleSheet("background-color:black;")

        font_size = QLabel('Font Size')
        font_size.fillColor = QColor(30, 30, 30, 120)
        font_size.penColor = QColor("#333333")

        grid = QGridLayout()
        grid.setContentsMargins(50, 10, 10, 10)
        grid.addWidget(font_size, 0, 0)
        self.setLayout(grid)

        # palette = QPalette(self.palette())
        # palette.setColor(self.backgroundRole(), Qt.black)
        # palette.setColor(palette.Background, Qt.transparent)

        # self.setPalette(palette)

    # def paintEvent(self, event):        
    #     painter = QPainter()
    #     painter.begin(self)
    #     # painter.setRenderHint(QPainter.Antialiasing)
    #     painter.fillRect(event.rect(), QBrush(QColor(255, 255, 255, 127)))
    #     painter.drawLine(self.width() / 8, self.height() / 8, 7 * self.width() / 8, 7 * self.height() / 8)
    #     painter.drawLine(self.width() / 8, 7 * self.height() / 8, 7 * self.width() / 8, self.height() / 8)
    #     # painter.setPen(QPen(Qt.NoPen)) 
Example #27
Source File: animate_constraint.py    From FreeCAD_assembly2 with GNU Lesser General Public License v2.1 5 votes vote down vote up
def generateWidget( self, parameterDict, constraint_to_animate ):
        return QtGui.QLabel('<b> %s </b>' % self.text if self.bold else self.text) 
Example #28
Source File: animate_constraint.py    From FreeCAD_assembly2 with GNU Lesser General Public License v2.1 5 votes vote down vote up
def Qt_label_widget( label, inputWidget, info_button_text=None ):
    hbox = QtGui.QHBoxLayout()
    hbox.addWidget( QtGui.QLabel(label) )
    hbox.addStretch(1)
    if inputWidget != None:
        hbox.addWidget(inputWidget)
    if info_button_text:
        hbox.addWidget( InfoButton(info_button_text) )
    return hbox 
Example #29
Source File: mainform.py    From Satori with Artistic License 2.0 5 votes vote down vote up
def check_sha_sums(self, files):
        self.verify_scroll_area.setVisible(True)
        self.clear_verify_layout()

        def label_factory(text):
            label = QtGui.QLabel(text)
            label.setStyleSheet("color:white;")
            label.setFont(self.get_default_font(10, True))
            return label

        def bridges_factory(bridge):
            edit = QtGui.QLineEdit(bridge)
            edit.setFont(self.get_default_font(10))
            edit.setStyleSheet("color:white;background:rgba(142, 116, 173, 100);border: 0px;border-radius: 5px;")
            edit.setReadOnly(True)
            return edit

        for file_path in files:
            sum = sha256sum(file_path)
            result = self.search_software(sum)
            layout = QtGui.QVBoxLayout()
            layout.setSpacing(3)
            sum_label = bridges_factory(sum)
            filename_label = label_factory(os.path.basename(file_path))
            filename_label.setStyleSheet("background-color:transparent;color:white;")
            layout.addWidget(filename_label)
            layout.addWidget(sum_label)
            if result:
                found_label = label_factory("Software found: " + result)
                found_label.setStyleSheet("font-style: italic; color: rgb(24, 181, 24);background-color:transparent;")
                found_label.setFont(self.get_default_font(14))
                layout.addWidget(found_label)
            self.verify_layout.addLayout(layout)
        if 1 <= self.verify_layout.count() <= 3:
            self.verify_scroll_area.setFixedHeight(85*self.verify_layout.count())
        else:
            self.verify_scroll_area.setFixedHeight(self.height()-200)
        if self.verify_layout.count() > 0:
            self.verify_layout.addStretch() 
Example #30
Source File: universal_tool_template_1020.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def fontDown_action(self):
        if self.memoData['font_size'] >= self.memoData['font_size_default']:
            self.memoData['font_size'] -= 2
            self.setStyleSheet("QLabel,QPushButton { font-size: %dpt;}" % self.memoData['font_size'])