|
|||||||||
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.QDialog
com.trolltech.qt.gui.QFontDialog
public final class QFontDialog
The QFontDialog class provides a dialog widget for selecting a font.
The usual way to use this class is to call one of the static convenience functions, e.g. getFont().
Examples:
bool ok; QFont font = QFontDialog::getFont( &ok, QFont("Helvetica [Cronyx]", 10), this); if (ok) { // the user clicked OK and font is set to the font the user selected } else { // the user canceled the dialog; font is set to the initial // value, in this case Helvetica [Cronyx], 10 }
The dialog can also be used to set a widget's font directly:
myWidget.setFont(QFontDialog::getFont(0, myWidget.font()));
If the user clicks OK the font they chose will be used for myWidget, and if they click Cancel the original font is used.
Dialogs Example
Nested Class Summary | |
---|---|
static class |
QFontDialog.Result
|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QDialog |
---|
QDialog.DialogCode |
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 |
---|
Fields inherited from class com.trolltech.qt.gui.QDialog |
---|
accepted, finished, rejected |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Method Summary | |
---|---|
static QFontDialog |
fromNativePointer(QNativePointer nativePointer)
This function returns the QFontDialog instance pointed to by nativePointer |
static QFontDialog.Result |
getFont()
This is an overloaded method provided for convenience. |
static QFontDialog.Result |
getFont(QFont initial)
This is an overloaded method provided for convenience. |
static QFontDialog.Result |
getFont(QFont initial,
QWidget parent)
This is an overloaded method provided for convenience. |
static QFontDialog.Result |
getFont(QFont initial,
QWidget parent,
java.lang.String caption)
Executes a modal font dialog and returns a font. |
static QFontDialog.Result |
getFont(QWidget parent)
This is an overloaded method provided for convenience. |
Methods inherited from class com.trolltech.qt.gui.QDialog |
---|
accept, adjustPosition, closeEvent, contextMenuEvent, done, eventFilter, exec, isSizeGripEnabled, keyPressEvent, minimumSizeHint, reject, resizeEvent, result, setModal, setResult, setSizeGripEnabled, setVisible, showEvent, sizeHint |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, 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 |
Method Detail |
---|
public static QFontDialog fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QFontDialog.Result getFont(QFont initial, QWidget parent, java.lang.String caption)
If the user clicks OK, the selected font is returned. If the user clicks Cancel, the initial font is returned.
The dialog is constructed with the given parent. caption is shown as the window title of the dialog and initial is the initially selected font.
This static function is less flexible than the full QFontDialog object, but is convenient and easy to use.
public static QFontDialog.Result getFont(QWidget parent)
public static QFontDialog.Result getFont()
public static QFontDialog.Result getFont(QFont initial, QWidget parent)
public static QFontDialog.Result getFont(QFont initial)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |