Russian Qt Forum

Qt => Пользовательский интерфейс (GUI) => Тема начата: qtnoob1k от Августа 24, 2011, 13:22



Название: QProgressDialog::setValue(100)
Отправлено: qtnoob1k от Августа 24, 2011, 13:22
Всем привет!

Вот код:
Код:
QProgressDialog progress("Copying files...", "Abort Copy", 0, 100, 0);
progress.setWindowModality(Qt::WindowModal);

progress.setAutoReset(false);

progress.setValue(99);
progress.setValue(100);
progress.exec();

Если в этом коде убрать строчку progress.setValue(99); то отображается 0% вместо 100%. Это баг Qt или я что-то не так делаю?


Название: Re: QProgressDialog::setValue(100)
Отправлено: Kunashir от Августа 25, 2011, 11:50
Попробуй сперва вызвать

Код:
setValue (0)
.

Если я правильно понял это:

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.