from PyQt4.QtGui import * app = QApplication([]) combo = QFontComboBox() combo.show() app.exec_()
from PyQt4.QtGui import * app = QApplication([]) label = QLabel("Hello World!") combo = QFontComboBox() combo.currentFontChanged.connect(lambda font: label.setFont(font)) layout = QVBoxLayout() layout.addWidget(label) layout.addWidget(combo) window = QWidget() window.setLayout(layout) window.show() app.exec_()This code creates a QLabel widget with the text "Hello World!" and a QFontComboBox widget. When the user selects a font from the drop-down list, it will change the font family of the displayed text in the QLabel. Package library: PyQt4.