Skip to content

PythonQt.QtGui.QFontDialog · declarations 001

Back to PythonQt.QtGui.QFontDialog

FontDialogOption instance-attribute

FontDialogOption: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

FontDialogOptions instance-attribute

FontDialogOptions: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

accepted

accepted(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.accepted; argument details are not documented.

changeEvent

changeEvent(event: Any) -> None

X.changeEvent(event)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QFontDialog::changeEvent(QEvent *e)

Reimplements: QWidget::changeEvent(QEvent *event).

Upstream PySide2 reference signatures (binding differences may apply):

changeEvent(self, event: PySide2.QtCore.QEvent) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#changeEvent

currentFont instance-attribute

currentFont: QFont

Qt 5 reference:

currentFont : QFont

This property holds the current font of the dialog.

This property was introduced in Qt 4.5.

Access functions:

QFont currentFont() const
void setCurrentFont(const QFont \&font)

Notifier signal:

void currentFontChanged(const QFont \&font)

QFont QFontDialog::currentFont() const

Returns the current font.

Note: Getter function for property currentFont.

This function was introduced in Qt 4.5.

See also setCurrentFont() and selectedFont().

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#currentFont

currentFontChanged

currentFontChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.currentFontChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QFontDialog::currentFontChanged(const QFont \&font)

This signal is emitted when the current font is changed. The new font is specified in font.

The signal is emitted while a user is selecting a font. Ultimately, the chosen font may differ from the font currently selected.

Note: Notifier signal for property currentFont.

This function was introduced in Qt 4.5.

See also currentFont, fontSelected(), and selectedFont().

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#currentFontChanged

customContextMenuRequested

customContextMenuRequested(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.customContextMenuRequested; argument details are not documented.

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.destroyed; argument details are not documented.

done

done(result: int) -> None

X.done(result)

Supplemental documentation: Qt 5 reference:

[override virtual protected] void QFontDialog::done(int result)

Reimplements: QDialog::done(int r).

Closes the dialog and sets its result code to result. If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return result.

See also QDialog::done().

Upstream PySide2 reference signatures (binding differences may apply):

done(self, result: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#done

eventFilter

eventFilter(object: Any, event: Any) -> bool

X.eventFilter(object, event) -> bool

Upstream PySide2 reference signatures (binding differences may apply):

eventFilter(self, object: PySide2.QtCore.QObject, event: PySide2.QtCore.QEvent) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#eventFilter

finished

finished(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.finished; argument details are not documented.

fontSelected

fontSelected(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.fontSelected; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QFontDialog::fontSelected(const QFont \&font)

This signal is emitted when a font has been selected. The selected font is specified in font.

The signal is only emitted when a user has chosen the final font to be used. It is not emitted while the user is changing the current font in the font dialog.

This function was introduced in Qt 4.5.

See also selectedFont(), currentFontChanged(), and currentFont.

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#fontSelected

getFont

getFont(ok: Any, initial: Any, parent: Any, title: Any, options: Any) -> Any

X.getFont(ok, initial, parent, title, options) -> PythonQt.QtGui.QFont

Supplemental documentation: Qt 5 reference:

[static] QFont QFontDialog::getFont(bool *ok, const QFont \&initial, QWidget *parent \= nullptr, const QString \&title \= QString(), QFontDialog::FontDialogOptions options \= FontDialogOptions())

Executes a modal font dialog and returns a font.

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 and the options specified in options. title is shown as the window title of the dialog and initial is the initially selected font. If the ok parameter is not-null, the value it refers to is set to true if the user clicks OK, and set to false if the user clicks Cancel.

Examples:

bool ok;
QFont font = QFontDialog::getFont(&ok, QFont("Times", 12), this);
if (ok) {
    // 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 Times, 12.
}

The dialog can also be used to set a widget's font directly:

myWidget.setFont(QFontDialog::getFont(0, myWidget.font()));

In this example, if the user clicks OK the font they chose will be used, and if they click Cancel the original font is used.

Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QFontDialog constructors.

[static] QFont QFontDialog::getFont(bool *ok, QWidget *parent \= nullptr)

This is an overloaded function.

Executes a modal font dialog and returns a font.

If the user clicks OK, the selected font is returned. If the user clicks Cancel, the Qt default font is returned.

The dialog is constructed with the given parent. If the ok parameter is not-null, the value it refers to is set to true if the user clicks OK, and false if the user clicks Cancel.

Example:

bool ok;
QFont font = QFontDialog::getFont(&ok, this);
if (ok) {
    // font is set to the font the user selected
} else {
    // the user canceled the dialog; font is set to the default
    // application font, QApplication::font()
}

Warning: Do not delete parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the QFontDialog constructors.

Upstream PySide2 reference signatures (binding differences may apply):

getFont(initial: PySide2.QtGui.QFont, parent: typing.Optional[PySide2.QtWidgets.QWidget]=..., title: str=..., options: PySide2.QtWidgets.QFontDialog.FontDialogOptions=...) -> typing.Tuple[PySide2.QtGui.QFont, bool]
getFont(parent: typing.Optional[PySide2.QtWidgets.QWidget]=...) -> typing.Tuple[PySide2.QtGui.QFont, bool]

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#getFont

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.objectNameChanged; argument details are not documented.

open

open() -> None

X.open()

Supplemental documentation: Qt 5 reference:

void QFontDialog::open(QObject *receiver, const char *member)

Opens the dialog and connects its fontSelected() signal to the slot specified by receiver and member.

The signal will be disconnected from the slot when the dialog is closed.

This function was introduced in Qt 4.5.

Upstream PySide2 reference signatures (binding differences may apply):

open(self) -> None
open(self, receiver: PySide2.QtCore.QObject, member: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#open

options instance-attribute

options: Any

Qt 5 reference:

options : FontDialogOptions

This property holds the various options that affect the look and feel of the dialog

By default, all options are disabled.

Options should be set before showing the dialog. Setting them while the dialog is visible is not guaranteed to have an immediate effect on the dialog (depending on the option and on the platform).

This property was introduced in Qt 4.5.

Access functions:

QFontDialog::FontDialogOptions options() const
void setOptions(QFontDialog::FontDialogOptions options)

See also setOption() and testOption().

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#options

rejected

rejected(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.rejected; argument details are not documented.

selectedFont

selectedFont() -> Any

X.selectedFont() -> PythonQt.QtGui.QFont

Supplemental documentation: Qt 5 reference:

QFont QFontDialog::selectedFont() const

Returns the font that the user selected by clicking the OK or equivalent button.

Note: This font is not always the same as the font held by the currentFont property since the user can choose different fonts before finally selecting the one to use.

Upstream PySide2 reference signatures (binding differences may apply):

selectedFont(self) -> PySide2.QtGui.QFont

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#selectedFont

setCurrentFont

setCurrentFont(font: Any) -> None

X.setCurrentFont(font)

Supplemental documentation: Qt 5 reference:

void QFontDialog::setCurrentFont(const QFont \&font)

Sets the font highlighted in the QFontDialog to the given font.

Note: Setter function for property currentFont.

This function was introduced in Qt 4.5.

See also currentFont() and selectedFont().

Upstream PySide2 reference signatures (binding differences may apply):

setCurrentFont(self, font: PySide2.QtGui.QFont) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#setCurrentFont

setOption

setOption(option: Any, on: bool) -> None

X.setOption(option, on)

Supplemental documentation: Qt 5 reference:

void QFontDialog::setOption(QFontDialog::FontDialogOption option, bool on \= true)

Sets the given option to be enabled if on is true; otherwise, clears the given option.

See also options and testOption().

Upstream PySide2 reference signatures (binding differences may apply):

setOption(self, option: PySide2.QtWidgets.QFontDialog.FontDialogOption, on: bool=...) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#setOption

setOptions

setOptions(options: Any) -> None

X.setOptions(options)

Upstream PySide2 reference signatures (binding differences may apply):

setOptions(self, options: PySide2.QtWidgets.QFontDialog.FontDialogOptions) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#setOptions

setVisible

setVisible(visible: bool) -> None

X.setVisible(visible)

Supplemental documentation: Qt 5 reference:

[override virtual] void QFontDialog::setVisible(bool visible)

Reimplements: QDialog::setVisible(bool visible).

Upstream PySide2 reference signatures (binding differences may apply):

setVisible(self, visible: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#setVisible

testOption

testOption(option: Any) -> bool

X.testOption(option) -> bool

Supplemental documentation: Qt 5 reference:

bool QFontDialog::testOption(QFontDialog::FontDialogOption option) const

Returns true if the given option is enabled; otherwise, returns false.

See also options and setOption().

Upstream PySide2 reference signatures (binding differences may apply):

testOption(self, option: PySide2.QtWidgets.QFontDialog.FontDialogOption) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qfontdialog.html#testOption

windowIconChanged

windowIconChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.windowIconChanged; argument details are not documented.

windowIconTextChanged

windowIconTextChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.windowIconTextChanged; argument details are not documented.

windowTitleChanged

windowTitleChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QFontDialog.windowTitleChanged; argument details are not documented.