|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QComboBox
com.trolltech.qt.gui.QFontComboBox
public class QFontComboBox
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.
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
This QFlag class provides flags for the int enum. |
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.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<QFont> |
currentFontChanged
This signal is emitted whenever the current font changes, with the new f. |
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 |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QFontComboBox()
Equivalent to QFontComboBox(0). |
|
QFontComboBox(QWidget parent)
Constructs a font combobox with the given parent. |
Method Summary | |
---|---|
QFont |
currentFont()
Returns the currently selected font. |
boolean |
event(QEvent e)
This is the main event handler; it handles event arg__1. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead. Key press and release events are treated differently from other events. event checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event calls keyPressEvent. Mouse and tablet event handling is also slightly special: only when the widget is enabled, event will call the specialized handlers such as mousePressEvent; otherwise it will discard the event. This function returns true if the event was recognized, otherwise it returns false. If the recognized event was accepted (see QEvent::accepted), any further processing such as event propagation to the parent widget stops. |
QFontComboBox.FontFilters |
fontFilters()
Returns the filter for the combobox. |
static QFontComboBox |
fromNativePointer(QNativePointer nativePointer)
This function returns the QFontComboBox instance pointed to by nativePointer |
void |
setCurrentFont(QFont f)
Sets the currently selected font to f. |
void |
setFontFilters(QFontComboBox.FontFilter... filters)
Sets the filter for the combobox to filters. |
void |
setFontFilters(QFontComboBox.FontFilters filters)
Sets the filter for the combobox to filters. |
void |
setWritingSystem(QFontDatabase.WritingSystem arg__1)
Sets the writing system that serves as a filter for the combobox to arg__1. |
QSize |
sizeHint()
Returns the recommended size for the widget. If the value of this property is an invalid size, no size is recommended. The default implementation of sizeHint returns an invalid size if there is no layout for this widget, and returns the layout's preferred size otherwise. |
QFontDatabase.WritingSystem |
writingSystem()
Returns the writing system that serves as a filter for the combobox. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<QFont> currentFontChanged
This signal is emitted whenever the current font changes, with the new f.
Constructor Detail |
---|
public QFontComboBox()
Equivalent to QFontComboBox(0).
public QFontComboBox(QWidget parent)
Constructs a font combobox with the given parent.
Method Detail |
---|
public final QFont currentFont()
Returns the currently selected font.
public final QFontComboBox.FontFilters fontFilters()
Returns the filter for the combobox.
By default, all fonts are listed.
public final void setCurrentFont(QFont f)
Sets the currently selected font to f.
public final void setFontFilters(QFontComboBox.FontFilter... filters)
Sets the filter for the combobox to filters.
By default, all fonts are listed.
public final void setFontFilters(QFontComboBox.FontFilters filters)
Sets the filter for the combobox to filters.
By default, all fonts are listed.
public final void setWritingSystem(QFontDatabase.WritingSystem arg__1)
Sets the writing system that serves as a filter for the combobox to arg__1.
If script is QFontDatabase::Any (the default), all fonts are listed.
public final QFontDatabase.WritingSystem writingSystem()
Returns the writing system that serves as a filter for the combobox.
If script is QFontDatabase::Any (the default), all fonts are listed.
public boolean event(QEvent e)
This is the main event handler; it handles event arg__1. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.
Key press and release events are treated differently from other events. event checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event calls keyPressEvent.
Mouse and tablet event handling is also slightly special: only when the widget is enabled, event will call the specialized handlers such as mousePressEvent; otherwise it will discard the event.
This function returns true if the event was recognized, otherwise it returns false. If the recognized event was accepted (see QEvent::accepted), any further processing such as event propagation to the parent widget stops.
event
in class QComboBox
public QSize sizeHint()
Returns the recommended size for the widget.
If the value of this property is an invalid size, no size is recommended.
The default implementation of sizeHint returns an invalid size if there is no layout for this widget, and returns the layout's preferred size otherwise.
sizeHint
in class QComboBox
public static QFontComboBox fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |