[][src]Struct qt_widgets::QColorDialog

#[repr(C)]pub struct QColorDialog { /* fields omitted */ }

The QColorDialog class provides a dialog widget for specifying colors.

C++ class: QColorDialog.

C++ documentation:

The QColorDialog class provides a dialog widget for specifying colors.

The color dialog's function is to allow users to choose colors. For example, you might use this in a drawing program to allow the user to set the brush color.

The static functions provide modal color dialogs.

The static getColor() function shows the dialog, and allows the user to specify a color. This function can also be used to let users choose a color with a level of transparency: pass the ShowAlphaChannel option as an additional argument.

The user can store customCount() different custom colors. The custom colors are shared by all color dialogs, and remembered during the execution of the program. Use setCustomColor() to set the custom colors, and use customColor() to get them.

When pressing the "Pick Screen Color" button, the cursor changes to a haircross and the colors on the screen are scanned. The user can pick up one by clicking the mouse or the Enter button. Pressing Escape restores the last color selected before entering this mode.

The Standard Dialogs example shows how to use QColorDialog as well as other built-in Qt dialogs.

A color dialog in the Fusion widget style.

Methods

impl QColorDialog[src]

pub fn current_color_changed(&self) -> Signal<(*const QColor,)>[src]

This signal is emitted whenever the current color changes in the dialog. The current color is specified by color.

Returns a built-in Qt signal QColorDialog::currentColorChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the current color changes in the dialog. The current color is specified by color.

Note: Notifier signal for property currentColor.

See also color and colorSelected().

pub fn color_selected(&self) -> Signal<(*const QColor,)>[src]

This signal is emitted just after the user has clicked OK to select a color to use. The chosen color is specified by color.

Returns a built-in Qt signal QColorDialog::colorSelected that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted just after the user has clicked OK to select a color to use. The chosen color is specified by color.

See also color and currentColorChanged().

pub unsafe fn current_color(&self) -> CppBox<QColor>[src]

This property holds the currently selected color in the dialog

Calls C++ function: QColor QColorDialog::currentColor() const.

C++ documentation:

This property holds the currently selected color in the dialog

Access functions:

QColor currentColor() const
void setCurrentColor(const QColor &color)

Notifier signal:

void currentColorChanged(const QColor &color)

pub unsafe fn custom_color(index: c_int) -> CppBox<QColor>[src]

Returns the custom color at the given index as a QColor value.

Calls C++ function: static QColor QColorDialog::customColor(int index).

C++ documentation:

Returns the custom color at the given index as a QColor value.

This function was introduced in Qt 4.5.

See also setCustomColor().

pub unsafe fn custom_count() -> c_int[src]

Returns the number of custom colors supported by QColorDialog. All color dialogs share the same custom colors.

Calls C++ function: static int QColorDialog::customCount().

C++ documentation:

Returns the number of custom colors supported by QColorDialog. All color dialogs share the same custom colors.

pub unsafe fn get_color_4a(
    initial: impl CastInto<Ref<QColor>>,
    parent: impl CastInto<Ptr<QWidget>>,
    title: impl CastInto<Ref<QString>>,
    options: QFlags<ColorDialogOption>
) -> CppBox<QColor>
[src]

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

Calls C++ function: static QColor QColorDialog::getColor(const QColor& initial = …, QWidget* parent = …, const QString& title = …, QFlags<QColorDialog::ColorDialogOption> options = …).

C++ documentation:

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

The options argument allows you to customize the dialog.

This function was introduced in Qt 4.5.

pub unsafe fn get_color_3a(
    initial: impl CastInto<Ref<QColor>>,
    parent: impl CastInto<Ptr<QWidget>>,
    title: impl CastInto<Ref<QString>>
) -> CppBox<QColor>
[src]

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

Calls C++ function: static QColor QColorDialog::getColor(const QColor& initial = …, QWidget* parent = …, const QString& title = …).

C++ documentation:

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

The options argument allows you to customize the dialog.

This function was introduced in Qt 4.5.

pub unsafe fn get_color_2a(
    initial: impl CastInto<Ref<QColor>>,
    parent: impl CastInto<Ptr<QWidget>>
) -> CppBox<QColor>
[src]

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

Calls C++ function: static QColor QColorDialog::getColor(const QColor& initial = …, QWidget* parent = …).

C++ documentation:

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

The options argument allows you to customize the dialog.

This function was introduced in Qt 4.5.

pub unsafe fn get_color_1a(
    initial: impl CastInto<Ref<QColor>>
) -> CppBox<QColor>
[src]

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

Calls C++ function: static QColor QColorDialog::getColor(const QColor& initial = …).

C++ documentation:

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

The options argument allows you to customize the dialog.

This function was introduced in Qt 4.5.

pub unsafe fn get_color_0a() -> CppBox<QColor>[src]

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

Calls C++ function: static QColor QColorDialog::getColor().

C++ documentation:

Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog.

The options argument allows you to customize the dialog.

This function was introduced in Qt 4.5.

pub unsafe fn get_rgba_3a(
    rgba: c_uint,
    ok: *mut bool,
    parent: impl CastInto<Ptr<QWidget>>
) -> c_uint
[src]

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

Calls C++ function: static unsigned int QColorDialog::getRgba(unsigned int rgba = …, bool* ok = …, QWidget* parent = …).

C++ documentation:

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

If ok is non-null, *a ok is set to true if the user clicked OK, and to false if the user clicked Cancel.

If the user clicks Cancel, the initial value is returned.

Use QColorDialog::getColor() instead, passing the QColorDialog::ShowAlphaChannel option.

pub unsafe fn get_rgba_2a(rgba: c_uint, ok: *mut bool) -> c_uint[src]

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

Calls C++ function: static unsigned int QColorDialog::getRgba(unsigned int rgba = …, bool* ok = …).

C++ documentation:

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

If ok is non-null, *a ok is set to true if the user clicked OK, and to false if the user clicked Cancel.

If the user clicks Cancel, the initial value is returned.

Use QColorDialog::getColor() instead, passing the QColorDialog::ShowAlphaChannel option.

pub unsafe fn get_rgba_1a(rgba: c_uint) -> c_uint[src]

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

Calls C++ function: static unsigned int QColorDialog::getRgba(unsigned int rgba = …).

C++ documentation:

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

If ok is non-null, *a ok is set to true if the user clicked OK, and to false if the user clicked Cancel.

If the user clicks Cancel, the initial value is returned.

Use QColorDialog::getColor() instead, passing the QColorDialog::ShowAlphaChannel option.

pub unsafe fn get_rgba_0a() -> c_uint[src]

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

Calls C++ function: static unsigned int QColorDialog::getRgba().

C++ documentation:

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent.

If ok is non-null, *a ok is set to true if the user clicked OK, and to false if the user clicked Cancel.

If the user clicks Cancel, the initial value is returned.

Use QColorDialog::getColor() instead, passing the QColorDialog::ShowAlphaChannel option.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QColorDialog::metaObject() const.

pub unsafe fn from_q_widget(
    parent: impl CastInto<Ptr<QWidget>>
) -> QBox<QColorDialog>
[src]

Constructs a color dialog with the given parent.

Calls C++ function: [constructor] void QColorDialog::QColorDialog(QWidget* parent = …).

C++ documentation:

Constructs a color dialog with the given parent.

This function was introduced in Qt 4.5.

pub unsafe fn from_q_color_q_widget(
    initial: impl CastInto<Ref<QColor>>,
    parent: impl CastInto<Ptr<QWidget>>
) -> QBox<QColorDialog>
[src]

Constructs a color dialog with the given parent and specified initial color.

Calls C++ function: [constructor] void QColorDialog::QColorDialog(const QColor& initial, QWidget* parent = …).

C++ documentation:

Constructs a color dialog with the given parent and specified initial color.

This function was introduced in Qt 4.5.

pub unsafe fn new() -> QBox<QColorDialog>[src]

The QColorDialog class provides a dialog widget for specifying colors.

Calls C++ function: [constructor] void QColorDialog::QColorDialog().

C++ documentation:

The QColorDialog class provides a dialog widget for specifying colors.

The color dialog's function is to allow users to choose colors. For example, you might use this in a drawing program to allow the user to set the brush color.

The static functions provide modal color dialogs.

The static getColor() function shows the dialog, and allows the user to specify a color. This function can also be used to let users choose a color with a level of transparency: pass the ShowAlphaChannel option as an additional argument.

The user can store customCount() different custom colors. The custom colors are shared by all color dialogs, and remembered during the execution of the program. Use setCustomColor() to set the custom colors, and use customColor() to get them.

When pressing the "Pick Screen Color" button, the cursor changes to a haircross and the colors on the screen are scanned. The user can pick up one by clicking the mouse or the Enter button. Pressing Escape restores the last color selected before entering this mode.

The Standard Dialogs example shows how to use QColorDialog as well as other built-in Qt dialogs.

A color dialog in the Fusion widget style.

pub unsafe fn from_q_color(
    initial: impl CastInto<Ref<QColor>>
) -> QBox<QColorDialog>
[src]

Constructs a color dialog with the given parent and specified initial color.

Calls C++ function: [constructor] void QColorDialog::QColorDialog(const QColor& initial).

C++ documentation:

Constructs a color dialog with the given parent and specified initial color.

This function was introduced in Qt 4.5.

pub unsafe fn open(
    &self,
    receiver: impl CastInto<Ptr<QObject>>,
    member: *const c_char
)
[src]

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

Calls C++ function: void QColorDialog::open(QObject* receiver, const char* member).

C++ documentation:

Opens the dialog and connects its colorSelected() 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.

pub unsafe fn options(&self) -> QFlags<ColorDialogOption>[src]

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

Calls C++ function: QFlags<QColorDialog::ColorDialogOption> QColorDialog::options() const.

C++ documentation:

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).

Access functions:

ColorDialogOptions options() const
void setOptions(ColorDialogOptions options)

See also setOption() and testOption().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QColorDialog::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QColorDialog::qt_metacast(const char* arg1).

pub unsafe fn selected_color(&self) -> CppBox<QColor>[src]

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

Calls C++ function: QColor QColorDialog::selectedColor() const.

C++ documentation:

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

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

pub unsafe fn set_current_color(&self, color: impl CastInto<Ref<QColor>>)[src]

This property holds the currently selected color in the dialog

Calls C++ function: void QColorDialog::setCurrentColor(const QColor& color).

C++ documentation:

This property holds the currently selected color in the dialog

Access functions:

QColor currentColor() const
void setCurrentColor(const QColor &color)

Notifier signal:

void currentColorChanged(const QColor &color)

pub unsafe fn set_custom_color(index: c_int, color: impl CastInto<Ref<QColor>>)[src]

Sets the custom color at index to the QColor color value.

Calls C++ function: static void QColorDialog::setCustomColor(int index, QColor color).

C++ documentation:

Sets the custom color at index to the QColor color value.

Note: This function does not apply to the Native Color Dialog on the macOS platform. If you still require this function, use the QColorDialog::DontUseNativeDialog option.

See also customColor().

pub unsafe fn set_option_2a(&self, option: ColorDialogOption, on: bool)[src]

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

Calls C++ function: void QColorDialog::setOption(QColorDialog::ColorDialogOption option, bool on = …).

C++ documentation:

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

See also options and testOption().

pub unsafe fn set_option_1a(&self, option: ColorDialogOption)[src]

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

Calls C++ function: void QColorDialog::setOption(QColorDialog::ColorDialogOption option).

C++ documentation:

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

See also options and testOption().

pub unsafe fn set_options(&self, options: QFlags<ColorDialogOption>)[src]

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

Calls C++ function: void QColorDialog::setOptions(QFlags<QColorDialog::ColorDialogOption> options).

C++ documentation:

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).

Access functions:

ColorDialogOptions options() const
void setOptions(ColorDialogOptions options)

See also setOption() and testOption().

pub unsafe fn set_standard_color(
    index: c_int,
    color: impl CastInto<Ref<QColor>>
)
[src]

Sets the standard color at index to the QColor color value.

Calls C++ function: static void QColorDialog::setStandardColor(int index, QColor color).

C++ documentation:

Sets the standard color at index to the QColor color value.

Note: This function does not apply to the Native Color Dialog on the macOS platform. If you still require this function, use the QColorDialog::DontUseNativeDialog option.

See also standardColor().

pub unsafe fn set_visible(&self, visible: bool)[src]

Reimplemented from QWidget::setVisible().

Calls C++ function: virtual void QColorDialog::setVisible(bool visible).

C++ documentation:

Reimplemented from QWidget::setVisible().

Changes the visibility of the dialog. If visible is true, the dialog is shown; otherwise, it is hidden.

pub unsafe fn standard_color(index: c_int) -> CppBox<QColor>[src]

Returns the standard color at the given index as a QColor value.

Calls C++ function: static QColor QColorDialog::standardColor(int index).

C++ documentation:

Returns the standard color at the given index as a QColor value.

This function was introduced in Qt 5.0.

See also setStandardColor().

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn test_option(&self, option: ColorDialogOption) -> bool[src]

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

Calls C++ function: bool QColorDialog::testOption(QColorDialog::ColorDialogOption option) const.

C++ documentation:

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

This function was introduced in Qt 4.5.

See also options and setOption().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QColorDialog::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QColorDialog::trUtf8(const char* s, const char* c, int n).

Methods from Deref<Target = QDialog>

pub fn finished(&self) -> Signal<(c_int,)>[src]

This signal is emitted when the dialog's result code has been set, either by the user or by calling done(), accept(), or reject().

Returns a built-in Qt signal QDialog::finished that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the dialog's result code has been set, either by the user or by calling done(), accept(), or reject().

Note that this signal is not emitted when hiding the dialog with hide() or setVisible(false). This includes deleting the dialog while it is visible.

This function was introduced in Qt 4.1.

See also accepted() and rejected().

pub fn accepted(&self) -> Signal<()>[src]

This signal is emitted when the dialog has been accepted either by the user or by calling accept() or done() with the QDialog::Accepted argument.

Returns a built-in Qt signal QDialog::accepted that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the dialog has been accepted either by the user or by calling accept() or done() with the QDialog::Accepted argument.

Note that this signal is not emitted when hiding the dialog with hide() or setVisible(false). This includes deleting the dialog while it is visible.

This function was introduced in Qt 4.1.

See also finished() and rejected().

pub fn rejected(&self) -> Signal<()>[src]

This signal is emitted when the dialog has been rejected either by the user or by calling reject() or done() with the QDialog::Rejected argument.

Returns a built-in Qt signal QDialog::rejected that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the dialog has been rejected either by the user or by calling reject() or done() with the QDialog::Rejected argument.

Note that this signal is not emitted when hiding the dialog with hide() or setVisible(false). This includes deleting the dialog while it is visible.

This function was introduced in Qt 4.1.

See also finished() and accepted().

pub fn slot_open(&self) -> Receiver<()>[src]

Shows the dialog as a window modal dialog, returning immediately.

Returns a built-in Qt slot QDialog::open that can be passed to qt_core::Signal::connect.

C++ documentation:

Shows the dialog as a window modal dialog, returning immediately.

This function was introduced in Qt 4.5.

See also exec(), show(), result(), and setWindowModality().

pub fn slot_exec(&self) -> Receiver<()>[src]

Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result.

Returns a built-in Qt slot QDialog::exec that can be passed to qt_core::Signal::connect.

C++ documentation:

Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result.

If the dialog is application modal, users cannot interact with any other window in the same application until they close the dialog. If the dialog is window modal, only interaction with the parent window is blocked while the dialog is open. By default, the dialog is application modal.

See also open(), show(), result(), and setWindowModality().

pub fn slot_done(&self) -> Receiver<(c_int,)>[src]

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

Returns a built-in Qt slot QDialog::done that can be passed to qt_core::Signal::connect.

C++ documentation:

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

As with QWidget::close(), done() deletes the dialog if the Qt::WA_DeleteOnClose flag is set. If the dialog is the application's main widget, the application terminates. If the dialog is the last window closed, the QApplication::lastWindowClosed() signal is emitted.

See also accept(), reject(), QApplication::activeWindow(), and QCoreApplication::quit().

pub fn slot_accept(&self) -> Receiver<()>[src]

Hides the modal dialog and sets the result code to Accepted.

Returns a built-in Qt slot QDialog::accept that can be passed to qt_core::Signal::connect.

C++ documentation:

Hides the modal dialog and sets the result code to Accepted.

See also reject() and done().

pub fn slot_reject(&self) -> Receiver<()>[src]

Hides the modal dialog and sets the result code to Rejected.

Returns a built-in Qt slot QDialog::reject that can be passed to qt_core::Signal::connect.

C++ documentation:

Hides the modal dialog and sets the result code to Rejected.

See also accept() and done().

pub fn slot_show_extension(&self) -> Receiver<(bool,)>[src]

If showIt is true, the dialog's extension is shown; otherwise the extension is hidden.

Returns a built-in Qt slot QDialog::showExtension that can be passed to qt_core::Signal::connect.

C++ documentation:

If showIt is true, the dialog's extension is shown; otherwise the extension is hidden.

Instead of using this functionality, we recommend that you simply call show() or hide() on the part of the dialog that you want to use as an extension. See the Extension Example for details.

See also show(), setExtension(), and setOrientation().

pub unsafe fn accept(&self)[src]

Hides the modal dialog and sets the result code to Accepted.

Calls C++ function: virtual [slot] void QDialog::accept().

C++ documentation:

Hides the modal dialog and sets the result code to Accepted.

See also reject() and done().

pub unsafe fn done(&self, arg1: c_int)[src]

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

Calls C++ function: virtual [slot] void QDialog::done(int arg1).

C++ documentation:

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

As with QWidget::close(), done() deletes the dialog if the Qt::WA_DeleteOnClose flag is set. If the dialog is the application's main widget, the application terminates. If the dialog is the last window closed, the QApplication::lastWindowClosed() signal is emitted.

See also accept(), reject(), QApplication::activeWindow(), and QCoreApplication::quit().

pub unsafe fn exec(&self) -> c_int[src]

Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result.

Calls C++ function: virtual [slot] int QDialog::exec().

C++ documentation:

Shows the dialog as a modal dialog, blocking until the user closes it. The function returns a DialogCode result.

If the dialog is application modal, users cannot interact with any other window in the same application until they close the dialog. If the dialog is window modal, only interaction with the parent window is blocked while the dialog is open. By default, the dialog is application modal.

See also open(), show(), result(), and setWindowModality().

pub unsafe fn extension(&self) -> QPtr<QWidget>[src]

Returns the dialog's extension or 0 if no extension has been defined.

Calls C++ function: QWidget* QDialog::extension() const.

C++ documentation:

Returns the dialog's extension or 0 if no extension has been defined.

Instead of using this functionality, we recommend that you simply call show() or hide() on the part of the dialog that you want to use as an extension. See the Extension Example for details.

See also setExtension(), showExtension(), and setOrientation().

pub unsafe fn is_size_grip_enabled(&self) -> bool[src]

This property holds whether the size grip is enabled

Calls C++ function: bool QDialog::isSizeGripEnabled() const.

C++ documentation:

This property holds whether the size grip is enabled

A QSizeGrip is placed in the bottom-right corner of the dialog when this property is enabled. By default, the size grip is disabled.

Access functions:

bool isSizeGripEnabled() const
void setSizeGripEnabled(bool)

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QDialog::metaObject() const.

pub unsafe fn minimum_size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QWidget::minimumSizeHint().

Calls C++ function: virtual QSize QDialog::minimumSizeHint() const.

C++ documentation:

Reimplemented from QWidget::minimumSizeHint().

pub unsafe fn open(&self)[src]

Shows the dialog as a window modal dialog, returning immediately.

Calls C++ function: virtual [slot] void QDialog::open().

C++ documentation:

Shows the dialog as a window modal dialog, returning immediately.

This function was introduced in Qt 4.5.

See also exec(), show(), result(), and setWindowModality().

pub unsafe fn orientation(&self) -> Orientation[src]

Returns the dialog's extension orientation.

Calls C++ function: Qt::Orientation QDialog::orientation() const.

C++ documentation:

Returns the dialog's extension orientation.

Instead of using this functionality, we recommend that you simply call show() or hide() on the part of the dialog that you want to use as an extension. See the Extension Example for details.

See also setOrientation() and extension().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QDialog::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QDialog::qt_metacast(const char* arg1).

pub unsafe fn reject(&self)[src]

Hides the modal dialog and sets the result code to Rejected.

Calls C++ function: virtual [slot] void QDialog::reject().

C++ documentation:

Hides the modal dialog and sets the result code to Rejected.

See also accept() and done().

pub unsafe fn result(&self) -> c_int[src]

In general returns the modal dialog's result code, Accepted or Rejected.

Calls C++ function: int QDialog::result() const.

C++ documentation:

In general returns the modal dialog's result code, Accepted or Rejected.

Note: When called on a QMessageBox instance, the returned value is a value of the QMessageBox::StandardButton enum.

Do not call this function if the dialog was constructed with the Qt::WA_DeleteOnClose attribute.

See also setResult().

pub unsafe fn set_extension(&self, extension: impl CastInto<Ptr<QWidget>>)[src]

Sets the widget, extension, to be the dialog's extension, deleting any previous extension. The dialog takes ownership of the extension. Note that if 0 is passed any existing extension will be deleted. This function must only be called while the dialog is hidden.

Calls C++ function: void QDialog::setExtension(QWidget* extension).

C++ documentation:

Sets the widget, extension, to be the dialog's extension, deleting any previous extension. The dialog takes ownership of the extension. Note that if 0 is passed any existing extension will be deleted. This function must only be called while the dialog is hidden.

Instead of using this functionality, we recommend that you simply call show() or hide() on the part of the dialog that you want to use as an extension. See the Extension Example for details.

See also extension(), showExtension(), and setOrientation().

pub unsafe fn set_modal(&self, modal: bool)[src]

This property holds whether show() should pop up the dialog as modal or modeless

Calls C++ function: void QDialog::setModal(bool modal).

C++ documentation:

This property holds whether show() should pop up the dialog as modal or modeless

By default, this property is false and show() pops up the dialog as modeless. Setting this property to true is equivalent to setting QWidget::windowModality to Qt::ApplicationModal.

exec() ignores the value of this property and always pops up the dialog as modal.

Access functions:

bool isModal() const
void setModal(bool modal)

See also QWidget::windowModality, show(), and exec().

pub unsafe fn set_orientation(&self, orientation: Orientation)[src]

If orientation is Qt::Horizontal, the extension will be displayed to the right of the dialog's main area. If orientation is Qt::Vertical, the extension will be displayed below the dialog's main area.

Calls C++ function: void QDialog::setOrientation(Qt::Orientation orientation).

C++ documentation:

If orientation is Qt::Horizontal, the extension will be displayed to the right of the dialog's main area. If orientation is Qt::Vertical, the extension will be displayed below the dialog's main area.

Instead of using this functionality, we recommend that you simply call show() or hide() on the part of the dialog that you want to use as an extension. See the Extension Example for details.

See also orientation() and setExtension().

pub unsafe fn set_result(&self, r: c_int)[src]

Sets the modal dialog's result code to i.

Calls C++ function: void QDialog::setResult(int r).

C++ documentation:

Sets the modal dialog's result code to i.

Note: We recommend that you use one of the values defined by QDialog::DialogCode.

See also result().

pub unsafe fn set_size_grip_enabled(&self, arg1: bool)[src]

This property holds whether the size grip is enabled

Calls C++ function: void QDialog::setSizeGripEnabled(bool arg1).

C++ documentation:

This property holds whether the size grip is enabled

A QSizeGrip is placed in the bottom-right corner of the dialog when this property is enabled. By default, the size grip is disabled.

Access functions:

bool isSizeGripEnabled() const
void setSizeGripEnabled(bool)

pub unsafe fn set_visible(&self, visible: bool)[src]

Reimplemented from QWidget::setVisible().

Calls C++ function: virtual void QDialog::setVisible(bool visible).

C++ documentation:

Reimplemented from QWidget::setVisible().

pub unsafe fn show_extension(&self, arg1: bool)[src]

If showIt is true, the dialog's extension is shown; otherwise the extension is hidden.

Calls C++ function: [slot] void QDialog::showExtension(bool arg1).

C++ documentation:

If showIt is true, the dialog's extension is shown; otherwise the extension is hidden.

Instead of using this functionality, we recommend that you simply call show() or hide() on the part of the dialog that you want to use as an extension. See the Extension Example for details.

See also show(), setExtension(), and setOrientation().

pub unsafe fn size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QWidget::sizeHint().

Calls C++ function: virtual QSize QDialog::sizeHint() const.

C++ documentation:

Reimplemented from QWidget::sizeHint().

Trait Implementations

impl CppDeletable for QColorDialog[src]

unsafe fn delete(&self)[src]

Destroys the color dialog.

Calls C++ function: virtual [destructor] void QColorDialog::~QColorDialog().

C++ documentation:

Destroys the color dialog.

impl Deref for QColorDialog[src]

type Target = QDialog

The resulting type after dereferencing.

fn deref(&self) -> &QDialog[src]

Calls C++ function: QDialog* static_cast<QDialog*>(QColorDialog* ptr).

impl DynamicCast<QColorDialog> for QDialog[src]

unsafe fn dynamic_cast(ptr: Ptr<QDialog>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* dynamic_cast<QColorDialog*>(QDialog* ptr).

impl DynamicCast<QColorDialog> for QWidget[src]

unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* dynamic_cast<QColorDialog*>(QWidget* ptr).

impl DynamicCast<QColorDialog> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* dynamic_cast<QColorDialog*>(QObject* ptr).

impl DynamicCast<QColorDialog> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* dynamic_cast<QColorDialog*>(QPaintDevice* ptr).

impl StaticDowncast<QColorDialog> for QDialog[src]

unsafe fn static_downcast(ptr: Ptr<QDialog>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* static_cast<QColorDialog*>(QDialog* ptr).

impl StaticDowncast<QColorDialog> for QWidget[src]

unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* static_cast<QColorDialog*>(QWidget* ptr).

impl StaticDowncast<QColorDialog> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* static_cast<QColorDialog*>(QObject* ptr).

impl StaticDowncast<QColorDialog> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QColorDialog>[src]

Calls C++ function: QColorDialog* static_cast<QColorDialog*>(QPaintDevice* ptr).

impl StaticUpcast<QDialog> for QColorDialog[src]

unsafe fn static_upcast(ptr: Ptr<QColorDialog>) -> Ptr<QDialog>[src]

Calls C++ function: QDialog* static_cast<QDialog*>(QColorDialog* ptr).

impl StaticUpcast<QObject> for QColorDialog[src]

unsafe fn static_upcast(ptr: Ptr<QColorDialog>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QColorDialog* ptr).

impl StaticUpcast<QPaintDevice> for QColorDialog[src]

unsafe fn static_upcast(ptr: Ptr<QColorDialog>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QColorDialog* ptr).

impl StaticUpcast<QWidget> for QColorDialog[src]

unsafe fn static_upcast(ptr: Ptr<QColorDialog>) -> Ptr<QWidget>[src]

Calls C++ function: QWidget* static_cast<QWidget*>(QColorDialog* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.