Class QFontComboBox

  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.gui.QWidget
                      extended by com.trolltech.qt.gui.QComboBox
                          extended by com.trolltech.qt.gui.QFontComboBox
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QFontComboBox
extends QComboBox

The QFontComboBox widget is a combobox that lets the user select a font family. The combobox is populated with an alphabetized list of font family names, such as Arial, Helvetica, and Times New Roman. Family names are displayed using the actual font when possible. For fonts such as Symbol, where the name is not representable in the font itself, a sample of the font is displayed next to the family name.

QFontComboBox is often used in toolbars, in conjunction with a QComboBox for controlling the font size and two QToolButtons for bold and italic.

When the user selects a new font, the currentFontChanged() signal is emitted in addition to currentIndexChanged() .

Call setWritingSystem() to tell QFontComboBox to show only fonts that support a given writing system, and setFontFilters() to filter out certain types of fonts as e.g. non scalable fonts or monospaced fonts.

See also:
QComboBox, QFont, QFontInfo, QFontMetrics, QFontDatabase, and Character Map Example.

Nested Class Summary
static class QFontComboBox.FontFilter
          This enum can be used to only show certain types of fonts in the font combo box.
static class QFontComboBox.FontFilters
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QComboBox
QComboBox.InsertPolicy, QComboBox.SizeAdjustPolicy
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
Field Summary
 QSignalEmitter.Signal1 currentFontChanged
          This signal takes 1 generic argument(s).
Fields inherited from class com.trolltech.qt.gui.QComboBox
activated, activatedIndex, currentIndexChanged, currentStringChanged, editTextChanged, highlighted, highlightedIndex
Fields inherited from class com.trolltech.qt.gui.QWidget
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
Constructor Summary
          Constructs a font combobox with the given parent.
QFontComboBox(QWidget parent)
          Constructs a font combobox with the given parent.
Method Summary
 QFont currentFont()
          This property holds the currently selected font.
 QFontComboBox.FontFilters fontFilters()
          This property holds the filter for the combobox.
 void setCurrentFont(QFont f)
          This property holds the currently selected font.
 void setFontFilters(QFontComboBox.FontFilter[] filters)
          This is an overloaded method provided for convenience.
 void setFontFilters(QFontComboBox.FontFilters filters)
          This property holds the filter for the combobox.
 void setWritingSystem(QFontDatabase.WritingSystem arg__1)
          This property holds the writing system that serves as a filter for the combobox.
 QFontDatabase.WritingSystem writingSystem()
          This property holds the writing system that serves as a filter for the combobox.
Methods inherited from class com.trolltech.qt.gui.QComboBox
addItem, addItem, addItem, addItem, addItems, clear, clearEditText, completer, count, currentIndex, currentText, duplicatesEnabled, findData, findData, findData, findData, findText, findText, findText, hasFrame, hidePopup, iconSize, initStyleOption, insertItem, insertItem, insertItem, insertItem, insertItems, insertPolicy, insertSeparator, isEditable, itemData, itemData, itemDelegate, itemIcon, itemText, lineEdit, maxCount, maxVisibleItems, minimumContentsLength, model, modelColumn, removeItem, rootModelIndex, setCompleter, setCurrentIndex, setDuplicatesEnabled, setEditable, setEditText, setFrame, setIconSize, setInsertPolicy, setItemData, setItemData, setItemDelegate, setItemIcon, setItemText, setLineEdit, setMaxCount, setMaxVisibleItems, setMinimumContentsLength, setModel, setModelColumn, setRootModelIndex, setSizeAdjustPolicy, setValidator, setView, showPopup, sizeAdjustPolicy, validator, view
Methods inherited from class com.trolltech.qt.gui.QWidget
acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, graphicsProxyWidget, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
Methods inherited from class com.trolltech.qt.core.QObject
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership

Field Detail


public final QSignalEmitter.Signal1 currentFontChanged

This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QFont(named: font)>:

This signal is emitted whenever the current font changes, with the new font.

See also:

Constructor Detail


public QFontComboBox()
Constructs a font combobox with the given parent.


public QFontComboBox(QWidget parent)
Constructs a font combobox with the given parent.

Method Detail


public final QFont currentFont()
This property holds the currently selected font.

See also:
currentFontChanged() , currentIndex, and currentText.


public final QFontComboBox.FontFilters fontFilters()
This property holds the filter for the combobox. By default, all fonts are listed.

See also:


public final void setCurrentFont(QFont f)
This property holds the currently selected font.

See also:
currentFontChanged() , currentIndex, and currentText.


public final void setFontFilters(QFontComboBox.FontFilter[] filters)
This is an overloaded method provided for convenience.


public final void setFontFilters(QFontComboBox.FontFilters filters)
This property holds the filter for the combobox. By default, all fonts are listed.

See also:


public final void setWritingSystem(QFontDatabase.WritingSystem arg__1)
This property holds the writing system that serves as a filter for the combobox. If script is QFontDatabase::Any (the default), all fonts are listed.

See also:


public final QFontDatabase.WritingSystem writingSystem()
This property holds the writing system that serves as a filter for the combobox. If script is QFontDatabase::Any (the default), all fonts are listed.

See also: