# -*- coding: utf-8 -*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
QTextCodec.setCodecForTr(QTextCodec.codecForName("utf8"))
class MainWindow(QMainWindow):
def __init__(self,parent=None):
super(MainWindow,self).__init__(parent)
self.setWindowTitle(self.tr("设置字体,字号等格式属性"))
self.text = QTextEdit()
self.setCentralWidget(self.text);
#字体
self.toolBar=self.addToolBar("Font")
self.label1 = QLabel(self.tr("字体:"))
self.fontBox = QFontComboBox()
self.fontBox.setFontFilters(QFontComboBox.ScalableFonts);
self.toolBar.addWidget(self.label1)
self.toolBar.addWidget(self.fontBox)
#字号
self.label2 = QLabel(self.tr("数字:"))
self.sizeBox = QComboBox()
#print dir(self.sizeBox)
self.to