當前位置: 首頁>>代碼示例>>Python>>正文


Python QFontDatabase.families方法代碼示例

本文整理匯總了Python中PyQt4.Qt.QFontDatabase.families方法的典型用法代碼示例。如果您正苦於以下問題:Python QFontDatabase.families方法的具體用法?Python QFontDatabase.families怎麽用?Python QFontDatabase.families使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt4.Qt.QFontDatabase的用法示例。


在下文中一共展示了QFontDatabase.families方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setupUi

# 需要導入模塊: from PyQt4.Qt import QFontDatabase [as 別名]
# 或者: from PyQt4.Qt.QFontDatabase import families [as 別名]

#.........這裏部分代碼省略.........
     brush = QtGui.QBrush(QtGui.QColor(80, 80, 80))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
     MainWindow.setPalette(palette)
     self.centralwidget = QtGui.QWidget(MainWindow)
     self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
     self.groupBox = QtGui.QGroupBox(self.centralwidget)
     self.groupBox.setGeometry(QtCore.QRect(70, 60, 291, 381))
     self.groupBox.setObjectName(_fromUtf8("groupBox"))
     self.listFonts = QtGui.QListWidget(self.groupBox)
     self.listFonts.setGeometry(QtCore.QRect(20, 30, 251, 331))
     self.listFonts.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
     self.listFonts.setObjectName(_fromUtf8("listFonts"))
     self.label_2 = QtGui.QLabel(self.centralwidget)
     self.label_2.setGeometry(QtCore.QRect(10, 460, 91, 61))
     self.label_2.setObjectName(_fromUtf8("label_2"))
     self.lineTempFolder = QtGui.QLineEdit(self.centralwidget)
     self.lineTempFolder.setGeometry(QtCore.QRect(120, 480, 271, 21))
     self.lineTempFolder.setObjectName(_fromUtf8("lineTempFolder"))
     self.pushQuery = QtGui.QPushButton(self.centralwidget)
     self.pushQuery.setGeometry(QtCore.QRect(150, 570, 99, 41))
     font = QtGui.QFont()
     font.setBold(True)
     font.setWeight(75)
     self.pushQuery.setFont(font)
     self.pushQuery.setObjectName(_fromUtf8("pushQuery"))
     self.label = QtGui.QLabel(self.centralwidget)
     self.label.setGeometry(QtCore.QRect(20, 10, 91, 51))
     self.label.setObjectName(_fromUtf8("label"))
     self.labPaint = QtGui.QLabel(self.centralwidget)
     self.labPaint.setGeometry(QtCore.QRect(20, 20, 591, 471))
     palette = QtGui.QPalette()
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
     brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
     brush.setStyle(QtCore.Qt.SolidPattern)
     palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
     self.labPaint.setPalette(palette)
     font = QtGui.QFont()
     font.setPointSize(18)
     self.labPaint.setFont(font)
     self.labPaint.setAlignment(QtCore.Qt.AlignJustify|QtCore.Qt.AlignTop)
     self.labPaint.setMargin(55)
     self.labPaint.setObjectName(_fromUtf8("labPaint"))
     self.lineWordList = QtGui.QLineEdit(self.centralwidget)
     self.lineWordList.setGeometry(QtCore.QRect(90, 20, 271, 21))
     self.lineWordList.setObjectName(_fromUtf8("lineWordList"))
     self.label_3 = QtGui.QLabel(self.centralwidget)
     self.label_3.setGeometry(QtCore.QRect(10, 520, 91, 61))
     self.label_3.setObjectName(_fromUtf8("label_3"))
     self.lineFolder = QtGui.QLineEdit(self.centralwidget)
     self.lineFolder.setGeometry(QtCore.QRect(120, 540, 271, 21))
     self.lineFolder.setObjectName(_fromUtf8("lineFolder"))
     MainWindow.setCentralWidget(self.centralwidget)
     self.retranslateUi(MainWindow)
     QtCore.QMetaObject.connectSlotsByName(MainWindow)
     
     
     #my code
     self.labPaint.setVisible(False)
     self.lineWordList.setText('/home/phoenix/Desktop/handcraft/lexeis.txt')
     self.lineFolder.setText("/home/phoenix/Desktop/noscale/")
     self.lineTempFolder.setText('/tmp/')
     #get installed fonts
     fontdb=QFontDatabase()
     for font in fontdb.families():
         f=QtGui.QFont(font)
         f.setPointSize(12)
         f.setPixelSize(12)
         it=QtGui.QListWidgetItem()
         it.setFont(f)
         it.setText(font)
         self.listFonts.addItem(it)
         
     
     
     #SLOTS
     QtCore.QObject.connect(self.pushQuery,QtCore.SIGNAL('clicked()'),self.GenerateSynthetic)
開發者ID:Rventric,項目名稱:Bilder,代碼行數:104,代碼來源:KyriaForma.py


注:本文中的PyQt4.Qt.QFontDatabase.families方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。