[][src]Struct qt_widgets::QProgressDialog

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

The QProgressDialog class provides feedback on the progress of a slow operation.

C++ class: QProgressDialog.

C++ documentation:

The QProgressDialog class provides feedback on the progress of a slow operation.

A progress dialog is used to give the user an indication of how long an operation is going to take, and to demonstrate that the application has not frozen. It can also give the user an opportunity to abort the operation.

A common problem with progress dialogs is that it is difficult to know when to use them; operations take different amounts of time on different hardware. QProgressDialog offers a solution to this problem: it estimates the time the operation will take (based on time for steps), and only shows itself if that estimate is beyond minimumDuration() (4 seconds by default).

Use setMinimum() and setMaximum() or the constructor to set the number of "steps" in the operation and call setValue() as the operation progresses. The number of steps can be chosen arbitrarily. It can be the number of files copied, the number of bytes received, the number of iterations through the main loop of your algorithm, or some other suitable unit. Progress starts at the value set by setMinimum(), and the progress dialog shows that the operation has finished when you call setValue() with the value set by setMaximum() as its argument.

The dialog automatically resets and hides itself at the end of the operation. Use setAutoReset() and setAutoClose() to change this behavior. Note that if you set a new maximum (using setMaximum() or setRange()) that equals your current value(), the dialog will not close regardless.

There are two ways of using QProgressDialog: modal and modeless.

Compared to a modeless QProgressDialog, a modal QProgressDialog is simpler to use for the programmer. Do the operation in a loop, call setValue() at intervals, and check for cancellation with wasCanceled(). For example:

QProgressDialog progress("Copying files...", "Abort Copy", 0, numFiles, this); progress.setWindowModality(Qt::WindowModal);

for (int i = 0; i < numFiles; i++) { progress.setValue(i);

if (progress.wasCanceled()) break; //... copy one file } progress.setValue(numFiles);

A modeless progress dialog is suitable for operations that take place in the background, where the user is able to interact with the application. Such operations are typically based on QTimer (or QObject::timerEvent()), QSocketNotifier, or QUrlOperator; or performed in a separate thread. A QProgressBar in the status bar of your main window is often an alternative to a modeless progress dialog.

You need to have an event loop to be running, connect the canceled() signal to a slot that stops the operation, and call setValue() at intervals. For example:

// Operation constructor Operation::Operation(QObject *parent) : QObject(parent), steps(0) { pd = new QProgressDialog("Operation in progress.", "Cancel", 0, 100); connect(pd, SIGNAL(canceled()), this, SLOT(cancel())); t = new QTimer(this); connect(t, SIGNAL(timeout()), this, SLOT(perform())); t->start(0); }

void Operation::perform() { pd->setValue(steps); //... perform one percent of the operation steps++; if (steps > pd->maximum()) t->stop(); }

void Operation::cancel() { t->stop(); //... cleanup }

In both modes the progress dialog may be customized by replacing the child widgets with custom widgets by using setLabel(), setBar(), and setCancelButton(). The functions setLabelText() and setCancelButtonText() set the texts shown.

A progress dialog shown in the Fusion widget style.

Methods

impl QProgressDialog[src]

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

Resets the progress dialog. wasCanceled() becomes true until the progress dialog is reset. The progress dialog becomes hidden.

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

C++ documentation:

Resets the progress dialog. wasCanceled() becomes true until the progress dialog is reset. The progress dialog becomes hidden.

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

Resets the progress dialog. The progress dialog becomes hidden if autoClose() is true.

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

C++ documentation:

Resets the progress dialog. The progress dialog becomes hidden if autoClose() is true.

See also setAutoClose() and setAutoReset().

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

This property holds the highest value represented by the progress bar

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

C++ documentation:

This property holds the highest value represented by the progress bar

The default is 100.

Access functions:

int maximum() const
void setMaximum(int maximum)

See also minimum and setRange().

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

This property holds the lowest value represented by the progress bar

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

C++ documentation:

This property holds the lowest value represented by the progress bar

The default is 0.

Access functions:

int minimum() const
void setMinimum(int minimum)

See also maximum and setRange().

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

Sets the progress dialog's minimum and maximum values to minimum and maximum, respectively.

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

C++ documentation:

Sets the progress dialog's minimum and maximum values to minimum and maximum, respectively.

If maximum is smaller than minimum, minimum becomes the only legal value.

If the current value falls outside the new range, the progress dialog is reset with reset().

See also minimum and maximum.

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

This property holds the current amount of progress made.

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

C++ documentation:

This property holds the current amount of progress made.

For the progress dialog to work as expected, you should initially set this property to QProgressDialog::minimum() and finally set it to QProgressDialog::maximum(); you can call setValue() any number of times in-between.

Warning: If the progress dialog is modal (see QProgressDialog::QProgressDialog()), setValue() calls QApplication::processEvents(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a QProgressDialog inside a paintEvent()!

Access functions:

int value() const
void setValue(int progress)

See also minimum and maximum.

pub fn slot_set_label_text(&self) -> Receiver<(*const QString,)>[src]

This property holds the label's text

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

C++ documentation:

This property holds the label's text

The default text is an empty string.

Access functions:

QString labelText() const
void setLabelText(const QString &text)

pub fn slot_set_cancel_button_text(&self) -> Receiver<(*const QString,)>[src]

Sets the cancel button's text to cancelButtonText. If the text is set to QString() then it will cause the cancel button to be hidden and deleted.

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

C++ documentation:

Sets the cancel button's text to cancelButtonText. If the text is set to QString() then it will cause the cancel button to be hidden and deleted.

See also setCancelButton().

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

This property holds the time that must pass before the dialog appears

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

C++ documentation:

This property holds the time that must pass before the dialog appears

If the expected duration of the task is less than the minimumDuration, the dialog will not appear at all. This prevents the dialog popping up for tasks that are quickly over. For tasks that are expected to exceed the minimumDuration, the dialog will pop up after the minimumDuration time or as soon as any progress is set.

If set to 0, the dialog is always shown as soon as any progress is set. The default is 4000 milliseconds.

Access functions:

int minimumDuration() const
void setMinimumDuration(int ms)

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

This signal is emitted when the cancel button is clicked. It is connected to the cancel() slot by default.

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

C++ documentation:

This signal is emitted when the cancel button is clicked. It is connected to the cancel() slot by default.

See also wasCanceled().

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

Shows the dialog if it is still hidden after the algorithm has been started and minimumDuration milliseconds have passed.

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

C++ documentation:

Shows the dialog if it is still hidden after the algorithm has been started and minimumDuration milliseconds have passed.

See also setMinimumDuration().

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

This property holds whether the dialog gets hidden by reset()

Calls C++ function: bool QProgressDialog::autoClose() const.

C++ documentation:

This property holds whether the dialog gets hidden by reset()

The default is true.

Access functions:

bool autoClose() const
void setAutoClose(bool close)

See also setAutoReset().

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

This property holds whether the progress dialog calls reset() as soon as value() equals maximum()

Calls C++ function: bool QProgressDialog::autoReset() const.

C++ documentation:

This property holds whether the progress dialog calls reset() as soon as value() equals maximum()

The default is true.

Access functions:

bool autoReset() const
void setAutoReset(bool reset)

See also setAutoClose().

pub unsafe fn cancel(&mut self)[src]

Resets the progress dialog. wasCanceled() becomes true until the progress dialog is reset. The progress dialog becomes hidden.

Calls C++ function: [slot] void QProgressDialog::cancel().

C++ documentation:

Resets the progress dialog. wasCanceled() becomes true until the progress dialog is reset. The progress dialog becomes hidden.

pub unsafe fn label_text(&self) -> CppBox<QString>[src]

This property holds the label's text

Calls C++ function: QString QProgressDialog::labelText() const.

C++ documentation:

This property holds the label's text

The default text is an empty string.

Access functions:

QString labelText() const
void setLabelText(const QString &text)

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

This property holds the highest value represented by the progress bar

Calls C++ function: int QProgressDialog::maximum() const.

C++ documentation:

This property holds the highest value represented by the progress bar

The default is 100.

Access functions:

int maximum() const
void setMaximum(int maximum)

See also minimum and setRange().

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

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

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

This property holds the lowest value represented by the progress bar

Calls C++ function: int QProgressDialog::minimum() const.

C++ documentation:

This property holds the lowest value represented by the progress bar

The default is 0.

Access functions:

int minimum() const
void setMinimum(int minimum)

See also maximum and setRange().

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

This property holds the time that must pass before the dialog appears

Calls C++ function: int QProgressDialog::minimumDuration() const.

C++ documentation:

This property holds the time that must pass before the dialog appears

If the expected duration of the task is less than the minimumDuration, the dialog will not appear at all. This prevents the dialog popping up for tasks that are quickly over. For tasks that are expected to exceed the minimumDuration, the dialog will pop up after the minimumDuration time or as soon as any progress is set.

If set to 0, the dialog is always shown as soon as any progress is set. The default is 4000 milliseconds.

Access functions:

int minimumDuration() const
void setMinimumDuration(int ms)

pub unsafe fn new_2a(
    parent: impl CastInto<MutPtr<QWidget>>,
    flags: QFlags<WindowType>
) -> CppBox<QProgressDialog>
[src]

Constructs a progress dialog.

Calls C++ function: [constructor] void QProgressDialog::QProgressDialog(QWidget* parent = …, QFlags<Qt::WindowType> flags = …).

C++ documentation:

Constructs a progress dialog.

Default settings:

  • The label text is empty.
  • The cancel button text is (translated) "Cancel".
  • minimum is 0;
  • maximum is 100

The parent argument is dialog's parent widget. The widget flags, f, are passed to the QDialog::QDialog() constructor.

See also setLabelText(), setCancelButtonText(), setCancelButton(), setMinimum(), and setMaximum().

pub unsafe fn new_6a(
    label_text: impl CastInto<Ref<QString>>,
    cancel_button_text: impl CastInto<Ref<QString>>,
    minimum: c_int,
    maximum: c_int,
    parent: impl CastInto<MutPtr<QWidget>>,
    flags: QFlags<WindowType>
) -> CppBox<QProgressDialog>
[src]

Constructs a progress dialog.

Calls C++ function: [constructor] void QProgressDialog::QProgressDialog(const QString& labelText, const QString& cancelButtonText, int minimum, int maximum, QWidget* parent = …, QFlags<Qt::WindowType> flags = …).

C++ documentation:

Constructs a progress dialog.

The labelText is the text used to remind the user what is progressing.

The cancelButtonText is the text to display on the cancel button. If QString() is passed then no cancel button is shown.

The minimum and maximum is the number of steps in the operation for which this progress dialog shows progress. For example, if the operation is to examine 50 files, this value minimum value would be 0, and the maximum would be 50. Before examining the first file, call setValue(0). As each file is processed call setValue(1), setValue(2), etc., finally calling setValue(50) after examining the last file.

The parent argument is the dialog's parent widget. The parent, parent, and widget flags, f, are passed to the QDialog::QDialog() constructor.

See also setLabelText(), setLabel(), setCancelButtonText(), setCancelButton(), setMinimum(), and setMaximum().

pub unsafe fn new_0a() -> CppBox<QProgressDialog>[src]

The QProgressDialog class provides feedback on the progress of a slow operation.

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

C++ documentation:

The QProgressDialog class provides feedback on the progress of a slow operation.

A progress dialog is used to give the user an indication of how long an operation is going to take, and to demonstrate that the application has not frozen. It can also give the user an opportunity to abort the operation.

A common problem with progress dialogs is that it is difficult to know when to use them; operations take different amounts of time on different hardware. QProgressDialog offers a solution to this problem: it estimates the time the operation will take (based on time for steps), and only shows itself if that estimate is beyond minimumDuration() (4 seconds by default).

Use setMinimum() and setMaximum() or the constructor to set the number of "steps" in the operation and call setValue() as the operation progresses. The number of steps can be chosen arbitrarily. It can be the number of files copied, the number of bytes received, the number of iterations through the main loop of your algorithm, or some other suitable unit. Progress starts at the value set by setMinimum(), and the progress dialog shows that the operation has finished when you call setValue() with the value set by setMaximum() as its argument.

The dialog automatically resets and hides itself at the end of the operation. Use setAutoReset() and setAutoClose() to change this behavior. Note that if you set a new maximum (using setMaximum() or setRange()) that equals your current value(), the dialog will not close regardless.

There are two ways of using QProgressDialog: modal and modeless.

Compared to a modeless QProgressDialog, a modal QProgressDialog is simpler to use for the programmer. Do the operation in a loop, call setValue() at intervals, and check for cancellation with wasCanceled(). For example:

QProgressDialog progress("Copying files...", "Abort Copy", 0, numFiles, this); progress.setWindowModality(Qt::WindowModal);

for (int i = 0; i < numFiles; i++) { progress.setValue(i);

if (progress.wasCanceled()) break; //... copy one file } progress.setValue(numFiles);

A modeless progress dialog is suitable for operations that take place in the background, where the user is able to interact with the application. Such operations are typically based on QTimer (or QObject::timerEvent()), QSocketNotifier, or QUrlOperator; or performed in a separate thread. A QProgressBar in the status bar of your main window is often an alternative to a modeless progress dialog.

You need to have an event loop to be running, connect the canceled() signal to a slot that stops the operation, and call setValue() at intervals. For example:

// Operation constructor Operation::Operation(QObject *parent) : QObject(parent), steps(0) { pd = new QProgressDialog("Operation in progress.", "Cancel", 0, 100); connect(pd, SIGNAL(canceled()), this, SLOT(cancel())); t = new QTimer(this); connect(t, SIGNAL(timeout()), this, SLOT(perform())); t->start(0); }

void Operation::perform() { pd->setValue(steps); //... perform one percent of the operation steps++; if (steps > pd->maximum()) t->stop(); }

void Operation::cancel() { t->stop(); //... cleanup }

In both modes the progress dialog may be customized by replacing the child widgets with custom widgets by using setLabel(), setBar(), and setCancelButton(). The functions setLabelText() and setCancelButtonText() set the texts shown.

A progress dialog shown in the Fusion widget style.

pub unsafe fn new_1a(
    parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QProgressDialog>
[src]

Constructs a progress dialog.

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

C++ documentation:

Constructs a progress dialog.

Default settings:

  • The label text is empty.
  • The cancel button text is (translated) "Cancel".
  • minimum is 0;
  • maximum is 100

The parent argument is dialog's parent widget. The widget flags, f, are passed to the QDialog::QDialog() constructor.

See also setLabelText(), setCancelButtonText(), setCancelButton(), setMinimum(), and setMaximum().

pub unsafe fn new_5a(
    label_text: impl CastInto<Ref<QString>>,
    cancel_button_text: impl CastInto<Ref<QString>>,
    minimum: c_int,
    maximum: c_int,
    parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QProgressDialog>
[src]

Constructs a progress dialog.

Calls C++ function: [constructor] void QProgressDialog::QProgressDialog(const QString& labelText, const QString& cancelButtonText, int minimum, int maximum, QWidget* parent = …).

C++ documentation:

Constructs a progress dialog.

The labelText is the text used to remind the user what is progressing.

The cancelButtonText is the text to display on the cancel button. If QString() is passed then no cancel button is shown.

The minimum and maximum is the number of steps in the operation for which this progress dialog shows progress. For example, if the operation is to examine 50 files, this value minimum value would be 0, and the maximum would be 50. Before examining the first file, call setValue(0). As each file is processed call setValue(1), setValue(2), etc., finally calling setValue(50) after examining the last file.

The parent argument is the dialog's parent widget. The parent, parent, and widget flags, f, are passed to the QDialog::QDialog() constructor.

See also setLabelText(), setLabel(), setCancelButtonText(), setCancelButton(), setMinimum(), and setMaximum().

pub unsafe fn new_4a(
    label_text: impl CastInto<Ref<QString>>,
    cancel_button_text: impl CastInto<Ref<QString>>,
    minimum: c_int,
    maximum: c_int
) -> CppBox<QProgressDialog>
[src]

Constructs a progress dialog.

Calls C++ function: [constructor] void QProgressDialog::QProgressDialog(const QString& labelText, const QString& cancelButtonText, int minimum, int maximum).

C++ documentation:

Constructs a progress dialog.

The labelText is the text used to remind the user what is progressing.

The cancelButtonText is the text to display on the cancel button. If QString() is passed then no cancel button is shown.

The minimum and maximum is the number of steps in the operation for which this progress dialog shows progress. For example, if the operation is to examine 50 files, this value minimum value would be 0, and the maximum would be 50. Before examining the first file, call setValue(0). As each file is processed call setValue(1), setValue(2), etc., finally calling setValue(50) after examining the last file.

The parent argument is the dialog's parent widget. The parent, parent, and widget flags, f, are passed to the QDialog::QDialog() constructor.

See also setLabelText(), setLabel(), setCancelButtonText(), setCancelButton(), setMinimum(), and setMaximum().

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

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

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

C++ documentation:

Opens the dialog and connects its canceled() 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 qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

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

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

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

pub unsafe fn reset(&mut self)[src]

Resets the progress dialog. The progress dialog becomes hidden if autoClose() is true.

Calls C++ function: [slot] void QProgressDialog::reset().

C++ documentation:

Resets the progress dialog. The progress dialog becomes hidden if autoClose() is true.

See also setAutoClose() and setAutoReset().

pub unsafe fn set_auto_close(&mut self, close: bool)[src]

This property holds whether the dialog gets hidden by reset()

Calls C++ function: void QProgressDialog::setAutoClose(bool close).

C++ documentation:

This property holds whether the dialog gets hidden by reset()

The default is true.

Access functions:

bool autoClose() const
void setAutoClose(bool close)

See also setAutoReset().

pub unsafe fn set_auto_reset(&mut self, reset: bool)[src]

This property holds whether the progress dialog calls reset() as soon as value() equals maximum()

Calls C++ function: void QProgressDialog::setAutoReset(bool reset).

C++ documentation:

This property holds whether the progress dialog calls reset() as soon as value() equals maximum()

The default is true.

Access functions:

bool autoReset() const
void setAutoReset(bool reset)

See also setAutoClose().

pub unsafe fn set_bar(&mut self, bar: impl CastInto<MutPtr<QProgressBar>>)[src]

Sets the progress bar widget to bar. The progress dialog resizes to fit. The progress dialog takes ownership of the progress bar which will be deleted when necessary, so do not use a progress bar allocated on the stack.

Calls C++ function: void QProgressDialog::setBar(QProgressBar* bar).

C++ documentation:

Sets the progress bar widget to bar. The progress dialog resizes to fit. The progress dialog takes ownership of the progress bar which will be deleted when necessary, so do not use a progress bar allocated on the stack.

pub unsafe fn set_cancel_button(
    &mut self,
    button: impl CastInto<MutPtr<QPushButton>>
)
[src]

Sets the cancel button to the push button, cancelButton. The progress dialog takes ownership of this button which will be deleted when necessary, so do not pass the address of an object that is on the stack, i.e. use new() to create the button. If 0 is passed then no cancel button will be shown.

Calls C++ function: void QProgressDialog::setCancelButton(QPushButton* button).

C++ documentation:

Sets the cancel button to the push button, cancelButton. The progress dialog takes ownership of this button which will be deleted when necessary, so do not pass the address of an object that is on the stack, i.e. use new() to create the button. If 0 is passed then no cancel button will be shown.

See also setCancelButtonText().

pub unsafe fn set_cancel_button_text(
    &mut self,
    text: impl CastInto<Ref<QString>>
)
[src]

Sets the cancel button's text to cancelButtonText. If the text is set to QString() then it will cause the cancel button to be hidden and deleted.

Calls C++ function: [slot] void QProgressDialog::setCancelButtonText(const QString& text).

C++ documentation:

Sets the cancel button's text to cancelButtonText. If the text is set to QString() then it will cause the cancel button to be hidden and deleted.

See also setCancelButton().

pub unsafe fn set_label(&mut self, label: impl CastInto<MutPtr<QLabel>>)[src]

Sets the label to label. The progress dialog resizes to fit. The label becomes owned by the progress dialog and will be deleted when necessary, so do not pass the address of an object on the stack.

Calls C++ function: void QProgressDialog::setLabel(QLabel* label).

C++ documentation:

Sets the label to label. The progress dialog resizes to fit. The label becomes owned by the progress dialog and will be deleted when necessary, so do not pass the address of an object on the stack.

See also setLabelText().

pub unsafe fn set_label_text(&mut self, text: impl CastInto<Ref<QString>>)[src]

This property holds the label's text

Calls C++ function: [slot] void QProgressDialog::setLabelText(const QString& text).

C++ documentation:

This property holds the label's text

The default text is an empty string.

Access functions:

QString labelText() const
void setLabelText(const QString &text)

pub unsafe fn set_maximum(&mut self, maximum: c_int)[src]

This property holds the highest value represented by the progress bar

Calls C++ function: [slot] void QProgressDialog::setMaximum(int maximum).

C++ documentation:

This property holds the highest value represented by the progress bar

The default is 100.

Access functions:

int maximum() const
void setMaximum(int maximum)

See also minimum and setRange().

pub unsafe fn set_minimum(&mut self, minimum: c_int)[src]

This property holds the lowest value represented by the progress bar

Calls C++ function: [slot] void QProgressDialog::setMinimum(int minimum).

C++ documentation:

This property holds the lowest value represented by the progress bar

The default is 0.

Access functions:

int minimum() const
void setMinimum(int minimum)

See also maximum and setRange().

pub unsafe fn set_minimum_duration(&mut self, ms: c_int)[src]

This property holds the time that must pass before the dialog appears

Calls C++ function: [slot] void QProgressDialog::setMinimumDuration(int ms).

C++ documentation:

This property holds the time that must pass before the dialog appears

If the expected duration of the task is less than the minimumDuration, the dialog will not appear at all. This prevents the dialog popping up for tasks that are quickly over. For tasks that are expected to exceed the minimumDuration, the dialog will pop up after the minimumDuration time or as soon as any progress is set.

If set to 0, the dialog is always shown as soon as any progress is set. The default is 4000 milliseconds.

Access functions:

int minimumDuration() const
void setMinimumDuration(int ms)

pub unsafe fn set_range(&mut self, minimum: c_int, maximum: c_int)[src]

Sets the progress dialog's minimum and maximum values to minimum and maximum, respectively.

Calls C++ function: [slot] void QProgressDialog::setRange(int minimum, int maximum).

C++ documentation:

Sets the progress dialog's minimum and maximum values to minimum and maximum, respectively.

If maximum is smaller than minimum, minimum becomes the only legal value.

If the current value falls outside the new range, the progress dialog is reset with reset().

See also minimum and maximum.

pub unsafe fn set_value(&mut self, progress: c_int)[src]

This property holds the current amount of progress made.

Calls C++ function: [slot] void QProgressDialog::setValue(int progress).

C++ documentation:

This property holds the current amount of progress made.

For the progress dialog to work as expected, you should initially set this property to QProgressDialog::minimum() and finally set it to QProgressDialog::maximum(); you can call setValue() any number of times in-between.

Warning: If the progress dialog is modal (see QProgressDialog::QProgressDialog()), setValue() calls QApplication::processEvents(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a QProgressDialog inside a paintEvent()!

Access functions:

int value() const
void setValue(int progress)

See also minimum and maximum.

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

Reimplemented from QWidget::sizeHint().

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

C++ documentation:

Reimplemented from QWidget::sizeHint().

Returns a size that fits the contents of the progress dialog. The progress dialog resizes itself as required, so you should not need to call this yourself.

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

Returns a reference to the staticMetaObject field.

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

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

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

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

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

This property holds the current amount of progress made.

Calls C++ function: int QProgressDialog::value() const.

C++ documentation:

This property holds the current amount of progress made.

For the progress dialog to work as expected, you should initially set this property to QProgressDialog::minimum() and finally set it to QProgressDialog::maximum(); you can call setValue() any number of times in-between.

Warning: If the progress dialog is modal (see QProgressDialog::QProgressDialog()), setValue() calls QApplication::processEvents(), so take care that this does not cause undesirable re-entrancy in your code. For example, don't use a QProgressDialog inside a paintEvent()!

Access functions:

int value() const
void setValue(int progress)

See also minimum and maximum.

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

This property holds whether the dialog was canceled

Calls C++ function: bool QProgressDialog::wasCanceled() const.

C++ documentation:

This property holds whether the dialog was canceled

Access functions:

bool wasCanceled() const

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(&mut 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(&mut 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(&mut 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) -> MutPtr<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(&mut 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(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*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(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

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

pub unsafe fn reject(&mut 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(
    &mut self,
    extension: impl CastInto<MutPtr<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(&mut 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(&mut 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(&mut 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(&mut 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(&mut 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(&mut 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 QProgressDialog[src]

unsafe fn delete(&mut self)[src]

Destroys the progress dialog.

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

C++ documentation:

Destroys the progress dialog.

impl Deref for QProgressDialog[src]

type Target = QDialog

The resulting type after dereferencing.

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

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

impl DerefMut for QProgressDialog[src]

fn deref_mut(&mut self) -> &mut QDialog[src]

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

impl DynamicCast<QProgressDialog> for QDialog[src]

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

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

unsafe fn dynamic_cast_mut(ptr: MutPtr<QDialog>) -> MutPtr<QProgressDialog>[src]

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

impl DynamicCast<QProgressDialog> for QWidget[src]

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

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

unsafe fn dynamic_cast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QProgressDialog>[src]

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

impl DynamicCast<QProgressDialog> for QObject[src]

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

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

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QProgressDialog>[src]

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

impl DynamicCast<QProgressDialog> for QPaintDevice[src]

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

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

unsafe fn dynamic_cast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QProgressDialog>[src]

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

impl StaticDowncast<QProgressDialog> for QDialog[src]

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

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

unsafe fn static_downcast_mut(ptr: MutPtr<QDialog>) -> MutPtr<QProgressDialog>[src]

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

impl StaticDowncast<QProgressDialog> for QWidget[src]

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

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

unsafe fn static_downcast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QProgressDialog>[src]

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

impl StaticDowncast<QProgressDialog> for QObject[src]

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

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

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QProgressDialog>[src]

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

impl StaticDowncast<QProgressDialog> for QPaintDevice[src]

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

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QPaintDevice>
) -> MutPtr<QProgressDialog>
[src]

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

impl StaticUpcast<QDialog> for QProgressDialog[src]

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

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

unsafe fn static_upcast_mut(ptr: MutPtr<QProgressDialog>) -> MutPtr<QDialog>[src]

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

impl StaticUpcast<QObject> for QProgressDialog[src]

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

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

unsafe fn static_upcast_mut(ptr: MutPtr<QProgressDialog>) -> MutPtr<QObject>[src]

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

impl StaticUpcast<QPaintDevice> for QProgressDialog[src]

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

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QProgressDialog>
) -> MutPtr<QPaintDevice>
[src]

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

impl StaticUpcast<QWidget> for QProgressDialog[src]

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

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

unsafe fn static_upcast_mut(ptr: MutPtr<QProgressDialog>) -> MutPtr<QWidget>[src]

Calls C++ function: QWidget* static_cast<QWidget*>(QProgressDialog* 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.