Python PyQt4.QtGui 模块,QFont() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PyQt4.QtGui.QFont()

项目:pip-gui    作者:GDGVIT    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(582, 317)
        self.verticalLayoutWidget = QtGui.QWidget(Form)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 561, 261))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.labelProgress = QtGui.QLabel(self.verticalLayoutWidget)
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.labelProgress.setFont(font)
        self.labelProgress.setObjectName(_fromUtf8("labelProgress"))
        self.verticalLayout.addWidget(self.labelProgress)
        self.textEdit = QtGui.QTextEdit(self.verticalLayoutWidget)
        self.textEdit.setObjectName(_fromUtf8("textEdit"))
        self.verticalLayout.addWidget(self.textEdit)
        self.btnContinue = QtGui.QPushButton(Form)
        self.btnContinue.setGeometry(QtCore.QRect(450, 280, 90, 28))
        self.btnContinue.setObjectName(_fromUtf8("btnContinue"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:PyFRAP    作者:alexblaessle    | 项目源码 | 文件源码
def main():

    #Creating application
    #font=QtGui.QFont()
    app = QtGui.QApplication(sys.argv)
    font=app.font()
    font.setPointSize(12)
    app.setFont(font)

    #Check if stout/sterr should be redirected
    try:
        print sys.argv[1]
        redirect=bool(int(sys.argv[1]))
        print redirect
    except:
        redirect=True

    mainWin = pyfrp(redirect=redirect)
    mainWin.show()

    sys.exit(app.exec_())
项目:pyDashboard    作者:jtsmith2    | 项目源码 | 文件源码
def resizeEvent(self, e):

        fontsize = 1

        font = self.label.font()

        while(True):


                f = QtGui.QFont(font)
                f.setPixelSize(fontsize)
                r = QtGui.QFontMetrics(f).boundingRect(self.label.text())
                if (r.height() < self.height()-30 and r.width() < self.width()-30):
                        fontsize += 1
                else:
                        break

        font.setPixelSize(fontsize)
        self.label.setFont(font)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def __init__(self, parent, title='', padding=1, ratio=1., ani_range=5):
        QtGui.QWidget.__init__(self, parent)
        self.font = QtGui.QFont('Droid Sans', 14, QtGui.QFont.Bold)
        self.font_metrics = QtGui.QFontMetrics(self.font)
        self.setFocusPolicy(QtCore.Qt.ClickFocus)
        self.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Preferred)
        self.padding = padding
        if title:
            self.title = title
            top_margin = self.font_metrics.height()+self.padding+4
        else:
            self.title = None
            top_margin = 0
        self.setContentsMargins(2, 2+top_margin, 2, 2)

        self._fgd_line = self.fgd_lines[0]
        self.border_anim = QtCore.QPropertyAnimation(self, 'fgd_line')
        self.border_anim.setStartValue(self.fgd_lines[0])
        self.border_anim.setEndValue(self.fgd_lines[1])
        self.border_anim.valueChanged.connect(lambda value: self.update())
项目:ddt4all    作者:cedricp    | 项目源码 | 文件源码
def getXMLFont(xml, scale = 1):
    font = getChildNodesByName(xml, "Font")[0]
    font_name = font.getAttribute("Name")
    font_size = float(font.getAttribute("Size").replace(',', '.'))
    font_bold = font.getAttribute("Bold")
    font_italic = font.getAttribute("Italic")

    if font_bold == '1':
        fnt_flags = gui.QFont.Bold
    else:
        fnt_flags = gui.QFont.Normal

    if font_italic == '1':
        fnt_flags |= gui.QFont.StyleItalic

    font_size = font_size / float(scale) * 12.
    qfnt = gui.QFont(font_name, font_size, fnt_flags)

    return qfnt
项目:ddt4all    作者:cedricp    | 项目源码 | 文件源码
def jsonFont(fnt, scale):
    font_name = fnt['name']
    font_size = fnt['size']
    if 'bold' in fnt:
        font_bold = fnt['bold']
    else:
        font_bold = '0'
    if 'italic' in fnt:
        font_italic = fnt['italic']
    else:
        font_italic = '0'

    if font_bold == '1':
        fnt_flags = gui.QFont.Bold
    else:
        fnt_flags = gui.QFont.Normal

    if font_italic == '1':
        fnt_flags |= gui.QFont.StyleItalic

    font_size = font_size / float(scale) * 12.

    qfnt = gui.QFont(font_name, font_size, fnt_flags);

    return qfnt
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def setupUi(self):
        Form = self
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(800, 600)
        self.frame = QtGui.QFrame(Form)
        self.frame.setGeometry(QtCore.QRect(10, 10, 781, 581))
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.label = QtGui.QLabel(self.frame)
        self.label.setGeometry(QtCore.QRect(10, 10, 261, 21))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.ms_data_text = QtGui.QPlainTextEdit(self.frame)
        self.ms_data_text.setGeometry(QtCore.QRect(10, 40, 761, 531))
        self.ms_data_text.setReadOnly(True)
        self.ms_data_text.setOverwriteMode(False)
        self.ms_data_text.setObjectName(_fromUtf8("ms_data_text"))

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:barium    作者:barium-project    | 项目源码 | 文件源码
def makeLayout(self, title, labels):
        layout = QtGui.QGridLayout()
        title = QtGui.QLabel(title)
        title.setFont(QtGui.QFont('MS Shell Dlg 2',pointSize=16))
        layout.addWidget(title, 0,0,1,3)

        #editable fields

        self.TTLswitch = TextChangingButton(labels)
        self.TTLswitch.setAutoDefault(True)
        layout.addWidget(self.TTLswitch, 2,0, 2,1)

        self.enableSwitch = QtGui.QCheckBox('Enable Shutter')
        layout.addWidget(self.enableSwitch, 1,0, 1,1)

        self.setLayout(layout)
项目:ChiantiPy    作者:chianti-atomic    | 项目源码 | 文件源码
def setupUi(self, selectorDialogForm):
        selectorDialogForm.setObjectName("selectorDialogForm")
        selectorDialogForm.setWindowModality(QtCore.Qt.WindowModal)
        selectorDialogForm.setModal(False)
#        selectorDialogForm.setWindowModality(QtCore.Qt.ApplicationModal)
        selectorDialogForm.resize(500,300)
        self.buttonBox = QtGui.QDialogButtonBox(selectorDialogForm)
        self.buttonBox.setGeometry(QtCore.QRect(30,240,341,32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.listWidget = QtGui.QListWidget(selectorDialogForm)
        self.listWidget.setGeometry(QtCore.QRect(70,20,360,200))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.listWidget.setFont(font)
        self.listWidget.setObjectName("listWidget")
        self.retranslateUi(selectorDialogForm)
        QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("accepted()"),selectorDialogForm.accept)
        QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("rejected()"),selectorDialogForm.reject)
        QtCore.QMetaObject.connectSlotsByName(selectorDialogForm)
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def labels(self, Form):
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(10, 20, 581, 31))
        font = QtGui.QFont()
        font.setPointSize(20)
        font.setWeight(50)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.label_2 = QtGui.QLabel(self.groupBox)
        self.label_2.setGeometry(QtCore.QRect(20, 40, 201, 17))
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.label_3 = QtGui.QLabel(self.groupBox)
        self.label_3.setGeometry(QtCore.QRect(340, 40, 201, 17))
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.label_4 = QtGui.QLabel(self.groupBox)
        self.label_4.setGeometry(QtCore.QRect(20, 110, 201, 17))
        self.label_4.setObjectName(_fromUtf8("label_4"))
        self.label_5 = QtGui.QLabel(self.groupBox)
        self.label_5.setGeometry(QtCore.QRect(340, 110, 201, 17))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.label_6 = QtGui.QLabel(self.groupBox)
        self.label_6.setGeometry(QtCore.QRect(340, 180, 91, 17))
        self.label_6.setObjectName(_fromUtf8("label_6"))
项目:python_mini_projeler    作者:o11    | 项目源码 | 文件源码
def resultArea(self, Form):
        self.gbSonuclar = QtGui.QGroupBox(Form)
        self.gbSonuclar.setGeometry(QtCore.QRect(20, 279, 291, 101))
        self.gbSonuclar.setTitle(_fromUtf8(""))
        self.gbSonuclar.setVisible(False)
        self.gbSonuclar.setObjectName(_fromUtf8("gbSonuclar"))
        self.lblFaiz = QtGui.QLabel(self.gbSonuclar)
        self.lblFaiz.setGeometry(QtCore.QRect(20, 60, 241, 17))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.lblFaiz.setFont(font)
        self.lblFaiz.setObjectName(_fromUtf8("lblFaiz"))
        self.lblTaksit = QtGui.QLabel(self.gbSonuclar)
        self.lblTaksit.setGeometry(QtCore.QRect(20, 30, 241, 17))
        font = QtGui.QFont()
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.lblTaksit.setFont(font)
        self.lblTaksit.setObjectName(_fromUtf8("lblTaksit"))
项目:AnimeWatch    作者:kanishka-linux    | 项目源码 | 文件源码
def shufflePlaylist(self):
        global epnArrList,site
        if site == "Local" or site =="Video" or site == "Music" or site == "PlayLists" or epnArrList:

            t = epnArrList[0]
            if '    ' in t:
                print ("++++++++++++++++")
                m = random.sample(epnArrList,len(epnArrList))
                epnArrList[:]=[]
                epnArrList=m
                self.list2.clear()
                for i in epnArrList:
                    i = i.replace('\n','')
                    if '    ' in i:
                        i = i.split('   ')[0]
                        if '#' in i:
                            i = '#'+i
                            self.list2.item(i).setFont(QtGui.QFont('SansSerif', 10,italic=True))
                        else:
                            self.list2.addItem((i))
项目:PH5    作者:PIC-IRIS    | 项目源码 | 文件源码
def paintEvent(self, e):
        qp = QtGui.QPainter()

        qp.begin(self)  
        pen = QtGui.QPen(QtCore.Qt.blue, 1.7, QtCore.Qt.DashLine)
        qp.setFont(QtGui.QFont('Decorative', 9))
        qp.setPen(pen)
        #print "paintEvent"
        index = 0
        for lbl in self.canvas.labelPos:
            if lbl.has_key('y'):
                indent = 6*(6-len(lbl['text']))
                indent = indent if indent>0 else 0
                #print "%s => indent=%s" % (lbl['text'], indent)
                qp.drawText(1+indent, lbl['y']+5, lbl['text'])
            else:
                #print "text:'%s' len(lbl)=%s" % (lbl['text'], len(lbl['text']))
                qp.drawText(int(lbl['x']-len(lbl['text'])*3.5), self.height()-10, lbl['text'])
            index += 1

        qp.end()
项目:PH5    作者:PIC-IRIS    | 项目源码 | 文件源码
def cbhelp (self) :
        if self.settings['inFormat'] == 'receiver' :
            cols = RECEIVER_CFG
        else :
            cols = EVENT_CFG


        help = "{0:<25}{1}".format ("Ignore:", "Ignore this entire column.\n\n")
        keys = cols.keys ()
        keys.sort ()
        for k in keys : 
            help += "{0:<25}{1}\n\n".format (k + ':', str (cols[k]['help']).strip ())

        mb = MyMessageBox (parent=None)
        mb.setFont (QtGui.QFont ('Courier', 10, QtGui.QFont.Bold))
        mb.setWindowTitle ('Socorro')
        mb.setText (help)
        mb.setModal (False)
        mb.open ()
        mb.exec_ ()
项目:GraduationDesign    作者:pstreeplus    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QWidget.__init__(self)
        self.setGeometry(300, 300, 600, 400)
        self.setWindowTitle('OCR Model')
        self.hbox = QtGui.QHBoxLayout(self)
        self.pic_lb = QtGui.QLabel(self)
        self.pic_lb.setFont(QtGui.QFont("Roman times",30,QtGui.QFont.Bold))
        self.pic_lb.setAlignment(QtCore.Qt.AlignCenter)
        self.hbox.addWidget(self.pic_lb)
        self.setLayout(self.hbox)
        start = QtGui.QPushButton('Start', self)
        start.setGeometry(185, 10, 60, 40)
        start.clicked.connect(self.launch)
        self.next_pic = QtGui.QPushButton('Next', self)
        self.prev_pic = QtGui.QPushButton('Prev', self)
        self.next_pic.setGeometry(265, 10, 60, 40)
        self.prev_pic.setGeometry(345, 10, 60, 40)
项目:BTCeTrader    作者:ch3ll0v3k    | 项目源码 | 文件源码
def INIT_CHAT_COMBO(self):

        # -------------------------------------------------------------------
        for LANG in self.CONF["USER"]["CHAT_LANGS"]:
            self.LANG_COMBO.addItem(LANG.upper());

        for i in xrange(0, self.LANG_COMBO.__len__()):

            self.LANG_COMBO.setItemData( i, QColor("#333"),Qt.BackgroundRole );
            self.LANG_COMBO.setItemData( i, QColor("#fff"),Qt.ForegroundRole );
            #self.LANG_COMBO.setItemData( i, QFont('monospace', 16, -1, False), Qt.FontRole);
        # -------------------------------------------------------------------

    # =======================================================================

###################################################################################################
项目:BTCeTrader    作者:ch3ll0v3k    | 项目源码 | 文件源码
def CREATE_PAIRS_SELECTOR(self, ALL=False):

        # -------------------------------------------------------------------
        if not ALL:
            for PAIR in self.CONF["API"]["PAIRS"]:
                self.PAIR_COMBO.addItem(PAIR.upper());

        else:
            for PAIR in self.CONF["API"]["ALL_PAIRS"]:
                self.PAIR_COMBO.addItem(PAIR.upper());

        for i in xrange(0, self.PAIR_COMBO.__len__()):

            self.PAIR_COMBO.setItemData( i, QColor("#333"),Qt.BackgroundRole );
            self.PAIR_COMBO.setItemData( i, QColor("#fff"),Qt.ForegroundRole );
            #self.PAIR_COMBO.setItemData( i, QFont('monospace', 16, -1, False), Qt.FontRole);
        # -------------------------------------------------------------------

    # =======================================================================
项目:BTCeTrader    作者:ch3ll0v3k    | 项目源码 | 文件源码
def CREATE_PAIRS_SELECTOR(self, ALL=False):

        # -------------------------------------------------------------------
        if not ALL:
            for PAIR in self.CONF["API"]["PAIRS"]:
                self.PAIR_COMBO.addItem(PAIR.upper());

        else:
            for PAIR in self.CONF["API"]["ALL_PAIRS"]:
                self.PAIR_COMBO.addItem(PAIR.upper());

        for i in xrange(0, self.PAIR_COMBO.__len__()):

            self.PAIR_COMBO.setItemData( i, QColor("#333"),Qt.BackgroundRole );
            self.PAIR_COMBO.setItemData( i, QColor("#fff"),Qt.ForegroundRole );
            #self.PAIR_COMBO.setItemData( i, QFont('monospace', 16, -1, False), Qt.FontRole);
        # -------------------------------------------------------------------

    # =======================================================================
项目:BioNanoAnalyst    作者:AppliedBioinformatics    | 项目源码 | 文件源码
def setupUi(self, Manual):
        Manual.setObjectName(_fromUtf8("Manual"))
        Manual.resize(740, 450)
        Manual.setMinimumSize(QtCore.QSize(740, 450))
        Manual.setMaximumSize(QtCore.QSize(740, 450))
        self.textBrowser = QtGui.QTextBrowser(Manual)
        self.textBrowser.setGeometry(QtCore.QRect(10, 40, 721, 371))
        self.textBrowser.setObjectName(_fromUtf8("textBrowser"))
        self.label = QtGui.QLabel(Manual)
        self.label.setGeometry(QtCore.QRect(10, 10, 271, 21))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Arial"))
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.manual_bn = QtGui.QPushButton(Manual)
        self.manual_bn.setGeometry(QtCore.QRect(650, 420, 75, 23))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Arial"))
        self.manual_bn.setFont(font)
        self.manual_bn.setObjectName(_fromUtf8("manual_bn"))

        self.retranslateUi(Manual)
        QtCore.QMetaObject.connectSlotsByName(Manual)
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(529, 329)
        self.selInfoWidget = QtGui.QWidget(Form)
        self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
        self.selInfoWidget.setObjectName(_fromUtf8("selInfoWidget"))
        self.gridLayout = QtGui.QGridLayout(self.selInfoWidget)
        self.gridLayout.setMargin(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.selDescLabel = QtGui.QLabel(self.selInfoWidget)
        self.selDescLabel.setText(_fromUtf8(""))
        self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.selDescLabel.setWordWrap(True)
        self.selDescLabel.setObjectName(_fromUtf8("selDescLabel"))
        self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1)
        self.selNameLabel = QtGui.QLabel(self.selInfoWidget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.selNameLabel.setFont(font)
        self.selNameLabel.setText(_fromUtf8(""))
        self.selNameLabel.setObjectName(_fromUtf8("selNameLabel"))
        self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1)
        self.selectedTree = DataTreeWidget(self.selInfoWidget)
        self.selectedTree.setObjectName(_fromUtf8("selectedTree"))
        self.selectedTree.headerItem().setText(0, _fromUtf8("1"))
        self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2)
        self.hoverText = QtGui.QTextEdit(Form)
        self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81))
        self.hoverText.setObjectName(_fromUtf8("hoverText"))
        self.view = FlowchartGraphicsView(Form)
        self.view.setGeometry(QtCore.QRect(0, 0, 256, 192))
        self.view.setObjectName(_fromUtf8("view"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:NeoAnalysis    作者:neoanalysis    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(529, 329)
        self.selInfoWidget = QtGui.QWidget(Form)
        self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
        self.selInfoWidget.setObjectName(_fromUtf8("selInfoWidget"))
        self.gridLayout = QtGui.QGridLayout(self.selInfoWidget)
        self.gridLayout.setMargin(0)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.selDescLabel = QtGui.QLabel(self.selInfoWidget)
        self.selDescLabel.setText(_fromUtf8(""))
        self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.selDescLabel.setWordWrap(True)
        self.selDescLabel.setObjectName(_fromUtf8("selDescLabel"))
        self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1)
        self.selNameLabel = QtGui.QLabel(self.selInfoWidget)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.selNameLabel.setFont(font)
        self.selNameLabel.setText(_fromUtf8(""))
        self.selNameLabel.setObjectName(_fromUtf8("selNameLabel"))
        self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1)
        self.selectedTree = DataTreeWidget(self.selInfoWidget)
        self.selectedTree.setObjectName(_fromUtf8("selectedTree"))
        self.selectedTree.headerItem().setText(0, _fromUtf8("1"))
        self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2)
        self.hoverText = QtGui.QTextEdit(Form)
        self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81))
        self.hoverText.setObjectName(_fromUtf8("hoverText"))
        self.view = FlowchartGraphicsView(Form)
        self.view.setGeometry(QtCore.QRect(0, 0, 256, 192))
        self.view.setObjectName(_fromUtf8("view"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:linkchecker-gui    作者:linkcheck    | 项目源码 | 文件源码
def __init__ (self, parent=None):
        """Set Scintilla options for font, colors, etc."""
        super(Editor, self).__init__(parent)
        # Use Courier font with fixed width
        font = QtGui.QFont("Consolas", 11)
        font.setFixedPitch(True)

        # Set the default font of the editor
        # and take the same font for line numbers
        self.setFont(font)
        self.setMarginsFont(font)

        # line number margin for 4 digits (plus 2px extra space)
        margin = QtGui.QFontMetrics(font).width("0"*4)+2
        # Display line numbers, margin 0 is for line numbers
        self.setMarginWidth(0, margin)
        self.setMarginLineNumbers(0, True)

        # Show whitespace to help detect whitespace errors
        self.setWhitespaceVisibility(True)

        # Use boxes as folding visual
        self.setFolding(self.BoxedTreeFoldStyle)

        # Braces matching
        self.setBraceMatching(self.SloppyBraceMatch)

        # Editing line color
        self.setCaretLineVisible(True)
        self.setCaretLineBackgroundColor(QtGui.QColor("#e5e5cb"))

        # line numbers margin colors
        self.setMarginsBackgroundColor(QtGui.QColor("#e5e5e5"))
        self.setMarginsForegroundColor(QtGui.QColor("#333333"))

        # folding margin colors (foreground,background)
        self.setFoldMarginColors(QtGui.QColor("#f5f5dc"),
                                 QtGui.QColor("#aaaaaa"))
项目:linkchecker-gui    作者:linkcheck    | 项目源码 | 文件源码
def __init__ (self, parent=None):
        """Setup the debug message dialog."""
        super(LinkCheckerDebug, self).__init__(parent)
        self.setupUi(self)
        font = QtGui.QFont("Consolas", 11)
        font.setFixedPitch(True)
        self.textEdit.document().setDefaultFont(font)
        self.log_msg_signal.connect(self.textEdit.appendPlainText)
        self.reset()
项目:linkchecker-gui    作者:linkcheck    | 项目源码 | 文件源码
def __init__ (self, parent):
        """Initialize line numbering."""
        super(Editor, self).__init__(parent)
        font = QtGui.QFont("Consolas", 11)
        font.setFixedPitch(True)
        self.document().setDefaultFont(font)
        self.lineNumberArea = LineNumberArea(self)
        self.blockCountChanged.connect(self.updateLineNumberAreaWidth)
        self.updateRequest.connect(self.updateLineNumberArea)
        self.cursorPositionChanged.connect(self.highlightCurrentLine)
        self.updateLineNumberAreaWidth(0)
        self.highlightCurrentLine()
项目:InplusTrader_Linux    作者:zhengwsh    | 项目源码 | 文件源码
def loadFont():
    """??????"""
    fileName = 'VT_setting.json'
    path = os.path.abspath(os.path.dirname(__file__)) 
    fileName = os.path.join(path, fileName)  

    try:
        f = file(fileName)
        setting = json.load(f)
        family = setting['fontFamily']
        size = setting['fontSize']
        font = QtGui.QFont(family, size)
    except:
        font = QtGui.QFont(u'????', 12)
    return font
项目:SameKeyProxy    作者:xzhou    | 项目源码 | 文件源码
def fixedWidthFont(self):
        f = QtGui.QFont("Courier")
        return f
项目:SameKeyProxy    作者:xzhou    | 项目源码 | 文件源码
def fixedWidthFont(self):
        f = QtGui.QFont("Courier")
        return f
项目:TPN    作者:myfavouritekk    | 项目源码 | 文件源码
def draw_predictions(file_path, predictions, class_index,
                     score_low, score_high):
    img = QtGui.QImage(file_path)
    painter = QtGui.QPainter(img)
    for i, pred in enumerate(predictions):
        if class_index > 0 and pred.class_index != class_index: continue
        if pred.score < score_low or pred.score > score_high: continue
        class_name = CLASS_NAMES[pred.class_index]
        x1, y1, x2, y2 = map(int, pred.bbox)
        # bbox
        painter.setPen(QtGui.QPen(PRESET_COLORS[pred.class_index], 10.0))
        # painter.setPen(QtGui.QPen(QtGui.QColor(0, 116, 217), 10.0))
        painter.setBrush(QtGui.QBrush())
        painter.drawRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1)
        # label background rect
        painter.setPen(QtGui.QPen(PRESET_COLORS[pred.class_index], 2.0))
        painter.setBrush(QtGui.QBrush(PRESET_COLORS[pred.class_index]))
        # painter.setPen(QtGui.QPen(QtGui.QColor(0, 116, 217), 2.0))
        # painter.setBrush(QtGui.QBrush(QtGui.QColor(0, 116, 217)))
        if class_index > 0:
            painter.drawRect(x1, y1, min(x2 - x1 + 1, 100), 30)
        else:
            painter.drawRect(x1, y1, min(x2 - x1 + 1, 200), 30)
        # label text
        painter.setPen(QtGui.QPen(QtGui.QColor(255, 255, 255)))
        painter.setBrush(QtGui.QBrush())
        painter.setFont(QtGui.QFont('Arial', 20, QtGui.QFont.Bold))
        if class_index > 0:
            painter.drawText(x1 + 4, y1 + 24, '{:.2f}'.format(pred.score))
        else:
            painter.drawText(x1 + 4, y1 + 24,
                             '{} {:.2f}'.format(class_name, pred.score))
    return img
项目:siren    作者:ozsolarwind    | 项目源码 | 文件源码
def initUI(self):
        self.grid = QtGui.QGridLayout()
        self.checkbox = []
        i = 0
        bold = QtGui.QFont()
        bold.setBold(True)
        for plot in range(len(self.plot_order)):
            if self.plot_order[plot] in self.spacers:
                label = QtGui.QLabel(self.spacers[self.plot_order[plot]])
                label.setFont(bold)
                self.grid.addWidget(label, i, 0)
                i += 1
            self.checkbox.append(QtGui.QCheckBox(self.hdrs[self.plot_order[plot]], self))
            if self.plots[self.plot_order[plot]]:
                self.checkbox[plot].setCheckState(QtCore.Qt.Checked)
            self.grid.addWidget(self.checkbox[-1], i, 0)
            i += 1
        self.grid.connect(self.checkbox[0], QtCore.SIGNAL('stateChanged(int)'), self.check_all)
        show = QtGui.QPushButton('Proceed', self)
        show.clicked.connect(self.showClicked)
        self.grid.addWidget(show, i, 0)
        frame = QtGui.QFrame()
        frame.setLayout(self.grid)
        self.scroll = QtGui.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(frame)
        self.layout = QtGui.QVBoxLayout(self)
        self.layout.addWidget(self.scroll)
        commnt = QtGui.QLabel('Nearest weather files:\n' + self.comment)
        self.layout.addWidget(commnt)
        self.setWindowTitle('SIREN - Weather dialog for ' + str(self.base_year))
        QtGui.QShortcut(QtGui.QKeySequence('q'), self, self.quitClicked)
        self.show_them = False
        self.show()
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(312, 31)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Sunken)
        self.frame.setLineWidth(2)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame)
        self.horizontalLayout.setSpacing(4)
        self.horizontalLayout.setMargin(0)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label = QtGui.QLabel(self.frame)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.items = QtGui.QComboBox(self.frame)
        self.items.setObjectName(_fromUtf8("items"))
        self.horizontalLayout.addWidget(self.items)
        self.button = QtGui.QPushButton(self.frame)
        self.button.setMaximumSize(QtCore.QSize(60, 16777215))
        self.button.setObjectName(_fromUtf8("button"))
        self.horizontalLayout.addWidget(self.button)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.button, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.clicked)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(312, 31)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Sunken)
        self.frame.setLineWidth(2)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame)
        self.horizontalLayout.setSpacing(4)
        self.horizontalLayout.setMargin(0)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label = QtGui.QLabel(self.frame)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.items = QtGui.QComboBox(self.frame)
        self.items.setObjectName(_fromUtf8("items"))
        self.horizontalLayout.addWidget(self.items)
        self.button = QtGui.QPushButton(self.frame)
        self.button.setMaximumSize(QtCore.QSize(60, 16777215))
        self.button.setObjectName(_fromUtf8("button"))
        self.horizontalLayout.addWidget(self.button)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.button, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.clicked)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(300, 31)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Sunken)
        self.frame.setLineWidth(2)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame)
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setMargin(0)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.button = QtGui.QPushButton(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button.sizePolicy().hasHeightForWidth())
        self.button.setSizePolicy(sizePolicy)
        self.button.setObjectName(_fromUtf8("button"))
        self.horizontalLayout.addWidget(self.button)
        self.label = QtGui.QLabel(self.frame)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.button, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.clicked)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(312, 31)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Sunken)
        self.frame.setLineWidth(2)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame)
        self.horizontalLayout.setSpacing(4)
        self.horizontalLayout.setMargin(0)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label = QtGui.QLabel(self.frame)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.items = QtGui.QComboBox(self.frame)
        self.items.setObjectName(_fromUtf8("items"))
        self.horizontalLayout.addWidget(self.items)
        self.button = QtGui.QPushButton(self.frame)
        self.button.setMaximumSize(QtCore.QSize(60, 16777215))
        self.button.setObjectName(_fromUtf8("button"))
        self.horizontalLayout.addWidget(self.button)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.button, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.clicked)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(300, 31)
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        self.frame.setFrameShape(QtGui.QFrame.Box)
        self.frame.setFrameShadow(QtGui.QFrame.Sunken)
        self.frame.setLineWidth(2)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame)
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setMargin(0)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.button = QtGui.QPushButton(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button.sizePolicy().hasHeightForWidth())
        self.button.setSizePolicy(sizePolicy)
        self.button.setObjectName(_fromUtf8("button"))
        self.horizontalLayout.addWidget(self.button)
        self.label = QtGui.QLabel(self.frame)
        font = QtGui.QFont()
        font.setBold(True)
        font.setWeight(75)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.button, QtCore.SIGNAL(_fromUtf8("clicked()")), Form.clicked)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:Open-Browser    作者:EricsonWillians    | 项目源码 | 文件源码
def createWidgets(self):
        self.dbx_grid = QtGui.QGridLayout()
        self.dbx_code_label = QtGui.QLabel('Enter the code here: ')
        self.dbx_code_label.setFont(QtGui.QFont("Arial", weight=QtGui.QFont.Bold))
        self.dbx_getCode = QtGui.QLineEdit()
        self.dbx_grid.addWidget(self.dbx_code_label,0,1)
        self.dbx_grid.addWidget(self.dbx_getCode,0,2)
        self.dbx_save_button = QtGui.QPushButton('Save')
        self.dbx_save_button.setFixedWidth(90)
        self.dbx_save_button.clicked.connect(self.createAppFolder)
        self.dbx_grid.addWidget(self.dbx_save_button,0,3)
        self.dbx_grid.addWidget(self.dbx_tabWidget,3,1,1,3)
        self.generateCode()
        self.setLayout(self.dbx_grid)
项目:EasyStorj    作者:lakewik    | 项目源码 | 文件源码
def setupUi(self, InitialWindow):
        InitialWindow.setObjectName(_fromUtf8("InitialWindow"))
        InitialWindow.resize(820, 202)
        self.label = QtGui.QLabel(InitialWindow)
        self.label.setGeometry(QtCore.QRect(10, 0, 801, 61))
        self.label.setObjectName(_fromUtf8("label"))
        self.line = QtGui.QFrame(InitialWindow)
        self.line.setGeometry(QtCore.QRect(10, 50, 801, 20))
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.login_bt = QtGui.QPushButton(InitialWindow)
        self.login_bt.setGeometry(QtCore.QRect(10, 70, 401, 71))
        font = QtGui.QFont()
        font.setPointSize(18)
        self.login_bt.setFont(font)
        self.login_bt.setObjectName(_fromUtf8("login_bt"))
        self.register_bt = QtGui.QPushButton(InitialWindow)
        self.register_bt.setGeometry(QtCore.QRect(420, 70, 391, 71))
        font = QtGui.QFont()
        font.setPointSize(18)
        self.register_bt.setFont(font)
        self.register_bt.setObjectName(_fromUtf8("register_bt"))
        self.about_bt = QtGui.QPushButton(InitialWindow)
        self.about_bt.setGeometry(QtCore.QRect(10, 150, 801, 41))
        font = QtGui.QFont()
        font.setPointSize(18)
        self.about_bt.setFont(font)
        self.about_bt.setObjectName(_fromUtf8("about_bt"))

        self.retranslateUi(InitialWindow)
        QtCore.QMetaObject.connectSlotsByName(InitialWindow)
项目:WxNeteaseMusic    作者:yaphone    | 项目源码 | 文件源码
def drawText(self, event, qp):
            osdlyrics_color = config.get_item("osdlyrics_color")
            osdlyrics_font = config.get_item("osdlyrics_font")
            font = QtGui.QFont(osdlyrics_font[0], osdlyrics_font[1])
            pen = QtGui.QColor(osdlyrics_color[0], osdlyrics_color[1],
                               osdlyrics_color[2])
            qp.setFont(font)
            qp.setPen(pen)
            qp.drawText(event.rect(), QtCore.Qt.AlignCenter |
                        QtCore.Qt.TextWordWrap, self.text)
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self, itemMenu, parent=None):
        super(DiagramScene, self).__init__(parent)

        self.myItemMenu = itemMenu
        self.myMode = self.MoveItem
        self.myItemType = DiagramItem.Step
        self.line = None
        self.textItem = None
        self.myItemColor = QtCore.Qt.white
        self.myTextColor = QtCore.Qt.black
        self.myLineColor = QtCore.Qt.black
        self.myFont = QtGui.QFont()
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def handleFontChange(self):
        font = self.fontCombo.currentFont()
        font.setPointSize(self.fontSizeCombo.currentText().toInt()[0])
        if self.boldAction.isChecked():
            font.setWeight(QtGui.QFont.Bold)
        else:
            font.setWeight(QtGui.QFont.Normal)
        font.setItalic(self.italicAction.isChecked())
        font.setUnderline(self.underlineAction.isChecked())

        self.scene.setFont(font)
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def itemSelected(self, item):
        font = item.font()
        color = item.defaultTextColor()
        self.fontCombo.setCurrentFont(font)
        self.fontSizeCombo.setEditText(QtCore.QString().setNum(font.pointSize()))
        self.boldAction.setChecked(font.weight() == QtGui.QFont.Bold)
        self.italicAction.setChecked(font.italic())
        self.underlineAction.setChecked(font.underline())
项目:PyQt-Udemy-Course-    作者:Pythondeveloper6    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(606, 268)
        self.lineEdit = QtGui.QLineEdit(Form)
        self.lineEdit.setGeometry(QtCore.QRect(270, 50, 271, 41))
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.lineEdit_2 = QtGui.QLineEdit(Form)
        self.lineEdit_2.setGeometry(QtCore.QRect(270, 110, 271, 41))
        self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(90, 50, 121, 41))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Impact"))
        font.setPointSize(17)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.label_2 = QtGui.QLabel(Form)
        self.label_2.setGeometry(QtCore.QRect(90, 100, 131, 51))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Impact"))
        font.setPointSize(17)
        self.label_2.setFont(font)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.pushButton = QtGui.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(220, 190, 161, 41))
        font = QtGui.QFont()
        font.setFamily(_fromUtf8("Impact"))
        font.setPointSize(25)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pip-gui    作者:GDGVIT    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(428, 457)
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(10, 20, 401, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.listWidget = QtGui.QListWidget(Form)
        self.listWidget.setGeometry(QtCore.QRect(10, 60, 261, 381))
        self.listWidget.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
        self.listWidget.setObjectName(_fromUtf8("listWidget"))
        self.verticalLayoutWidget = QtGui.QWidget(Form)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(290, 60, 121, 98))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.btnUninstall = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnUninstall.setObjectName(_fromUtf8("btnUninstall"))
        self.verticalLayout.addWidget(self.btnUninstall)
        self.btnUninstallAll = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnUninstallAll.setObjectName(_fromUtf8("btnUninstallAll"))
        self.verticalLayout.addWidget(self.btnUninstallAll)
        self.btnBack = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnBack.setObjectName(_fromUtf8("btnBack"))
        self.verticalLayout.addWidget(self.btnBack)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pip-gui    作者:GDGVIT    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(427, 456)
        self.listWidget = QtGui.QListWidget(Form)
        self.listWidget.setGeometry(QtCore.QRect(10, 60, 261, 381))
        self.listWidget.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
        self.listWidget.setObjectName(_fromUtf8("listWidget"))
        self.verticalLayoutWidget = QtGui.QWidget(Form)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(290, 60, 121, 98))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.btnUpdate = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnUpdate.setObjectName(_fromUtf8("btnUpdate"))
        self.verticalLayout.addWidget(self.btnUpdate)
        self.btnUpdateAll = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnUpdateAll.setObjectName(_fromUtf8("btnUpdateAll"))
        self.verticalLayout.addWidget(self.btnUpdateAll)
        self.btnBack = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnBack.setObjectName(_fromUtf8("btnBack"))
        self.verticalLayout.addWidget(self.btnBack)
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(10, 20, 401, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:pip-gui    作者:GDGVIT    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(440, 538)
        self.verticalLayoutWidget = QtGui.QWidget(Form)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(300, 140, 121, 98))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.btnInstall = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnInstall.setObjectName(_fromUtf8("btnInstall"))
        self.verticalLayout.addWidget(self.btnInstall)
        self.btnBack = QtGui.QPushButton(self.verticalLayoutWidget)
        self.btnBack.setObjectName(_fromUtf8("btnBack"))
        self.verticalLayout.addWidget(self.btnBack)
        self.listWidget = QtGui.QListWidget(Form)
        self.listWidget.setGeometry(QtCore.QRect(20, 140, 261, 381))
        self.listWidget.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
        self.listWidget.setObjectName(_fromUtf8("listWidget"))
        self.label = QtGui.QLabel(Form)
        self.label.setGeometry(QtCore.QRect(20, 100, 401, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label.setFont(font)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayoutWidget = QtGui.QWidget(Form)
        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(20, 10, 401, 80))
        self.horizontalLayoutWidget.setObjectName(_fromUtf8("horizontalLayoutWidget"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.label_2 = QtGui.QLabel(self.horizontalLayoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout.addWidget(self.label_2)
        self.packageInput = QtGui.QLineEdit(self.horizontalLayoutWidget)
        self.packageInput.setObjectName(_fromUtf8("packageInput"))
        self.horizontalLayout.addWidget(self.packageInput)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:Modular_Rigging_Thesis    作者:LoganKelly    | 项目源码 | 文件源码
def addText(self):
        font = QtGui.QFont("SansSerif", 14)
        font.setStyleHint(QtGui.QFont.Helvetica)
        font.setStretch(100)
        self.displayText = QtGui.QGraphicsTextItem(self.displayText, self)
        self.displayText.setFlag(QtGui.QGraphicsItem.ItemIsSelectable,False)
        self.displayText.setFont(font)
        self.displayText.setDefaultTextColor(QtGui.QColor(QtCore.Qt.white))
        self.displayText.setPos(self.boundingRect().center().x() - (self.displayText.boundingRect().width()/2) + 5, self.sceneBoundingRect().center().y()/2 + 5)
项目:Modular_Rigging_Thesis    作者:LoganKelly    | 项目源码 | 文件源码
def addText(self):
        font = QtGui.QFont("SansSerif", 14)
        font.setStyleHint(QtGui.QFont.Helvetica)
        font.setStretch(100)
        self.displayText = QtGui.QGraphicsTextItem(self.displayText, self)
        self.displayText.setFont(font)
        self.displayText.setDefaultTextColor(QtGui.QColor(QtCore.Qt.white))
        self.displayText.setPos(self.boundingRect().center().x() - (self.displayText.boundingRect().width()/2) + 5, self.sceneBoundingRect().center().y()/2 + 5)
项目:Modular_Rigging_Thesis    作者:LoganKelly    | 项目源码 | 文件源码
def addText(self):
        font = QtGui.QFont("SansSerif", 14)
        font.setStyleHint(QtGui.QFont.Helvetica)
        font.setStretch(100)
        self.displayText = QtGui.QGraphicsTextItem(self.displayText, self)
        self.displayText.setFont(font)
        self.displayText.setDefaultTextColor(QtGui.QColor(QtCore.Qt.white))
        self.displayText.setPos(self.boundingRect().center().x() - (self.displayText.boundingRect().width()/2) + 5, self.sceneBoundingRect().center().y()/2 + 5)
项目:Modular_Rigging_Thesis    作者:LoganKelly    | 项目源码 | 文件源码
def addText(self):
        font = QtGui.QFont("SansSerif", 14)
        font.setStyleHint(QtGui.QFont.Helvetica)
        font.setStretch(100)
        self.displayText = QtGui.QGraphicsTextItem(self.displayText, self)
        self.displayText.setFont(font)
        self.displayText.setDefaultTextColor(QtGui.QColor(QtCore.Qt.white))
        self.displayText.setPos(self.boundingRect().center().x() - (self.displayText.boundingRect().width()/2) + 5, self.sceneBoundingRect().center().y()/2 + 5)
项目:RasWxNeteaseMusic    作者:yaphone    | 项目源码 | 文件源码
def drawText(self, event, qp):
            osdlyrics_color = config.get_item("osdlyrics_color")
            osdlyrics_font = config.get_item("osdlyrics_font")
            font = QtGui.QFont(osdlyrics_font[0], osdlyrics_font[1])
            pen = QtGui.QColor(osdlyrics_color[0], osdlyrics_color[1],
                               osdlyrics_color[2])
            qp.setFont(font)
            qp.setPen(pen)
            qp.drawText(event.rect(), QtCore.Qt.AlignCenter |
                        QtCore.Qt.TextWordWrap, self.text)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def __init__(self, parent=None, text='', text_align=QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter, label_pos=RIGHT, path=None):
        QtGui.QWidget.__init__(self, parent)
        self.text = text
        self.text_align = text_align
        self.font = QtGui.QFont('Droid Sans', 9, QtGui.QFont.Bold)
        self.font_metrics = QtGui.QFontMetrics(self.font)
        text_split = text.split('\n')
        text_height = self.font_metrics.height()*len(text_split)
        text_width = max([self.font_metrics.width(t) for t in text_split])
        self.label_rect = QtCore.QRectF(0, 0, text_width, text_height)
#        self.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        if path:
            self.path = path
            self.path_rect = self.path.boundingRect()
        if not self.path_rect:
            self.setMinimumSize(self.label_rect.width(), self.label_rect.height())
        else:
            self.label_pos = label_pos
            if label_pos in (TOP, BOTTOM):
                self.setMinimumSize(max(self.label_rect.width(), self.path_rect.width()), self.label_rect.height()+self.path_rect.height()+2)
                self.label_rect.setWidth(max(self.label_rect.width(), self.path_rect.width()))
            else:
                self.setMinimumSize(self.label_rect.width()+self.path_rect.width()+2, max(self.label_rect.height(), self.path_rect.height()))
                self.label_rect.setHeight(max(self.label_rect.height(), self.path_rect.height()))
            if label_pos == TOP:
                self.path_rect.moveTop(self.label_rect.bottom()+2)
                if self.path_rect.width() < self.label_rect.width():
                    self.path_rect.moveLeft((self.label_rect.width()-self.path_rect.width())/2)
            elif label_pos == BOTTOM:
                self.label_rect.moveTop(self.path_rect.bottom()+2)
                if self.path_rect.width() < self.label_rect.width():
                    self.path_rect.moveLeft((self.label_rect.width()-self.path_rect.width())/2)
            elif label_pos == LEFT:
                self.path_rect.moveLeft(self.label_rect.right()+2)
                if self.path_rect.height() < self.label_rect.height():
                    self.path_rect.moveTop((self.label_rect.height()-self.path_rect.height())/2)
            else:
                self.label_rect.moveLeft(self.path_rect.right()+2)
                if self.path_rect.height() < self.label_rect.height():
                    self.path_rect.moveTop((self.label_rect.height()-self.path_rect.height())/2)