KDEUI
Go to the documentation of this file.
24 #include <QProgressBar>
35 cancelButtonShown(true),
46 void slotAutoActions(
int percentage);
49 bool cancelButtonShown : 1;
53 bool mAllowCancel : 1;
57 QProgressBar* mProgressBar;
63 const QString& text, Qt::WindowFlags flags)
65 d(new KProgressDialogPrivate(this))
70 d->mShowTimer =
new QTimer(
this);
75 QVBoxLayout* layout =
new QVBoxLayout(mainWidget);
76 layout->setMargin(10);
78 d->mLabel =
new QLabel(text, mainWidget);
79 layout->addWidget(d->mLabel);
81 d->mProgressBar =
new QProgressBar(mainWidget);
82 layout->addWidget(d->mProgressBar);
86 connect(d->mProgressBar, SIGNAL(valueChanged(
int)),
87 this, SLOT(slotAutoActions(
int)));
88 connect(d->mShowTimer, SIGNAL(
timeout()),
this, SLOT(slotAutoShow()));
89 d->mShowTimer->setSingleShot(
true);
90 d->mShowTimer->start(d->mMinDuration);
98 void KProgressDialog::KProgressDialogPrivate::slotAutoShow()
100 if (mShown || mCancelled)
111 KDialog::showEvent(event);
116 d->mCancelled =
true;
126 return d->mCancelled;
131 d->mCancelled =
false;
136 d->mMinDuration = ms;
139 d->mShowTimer->stop();
140 d->mShowTimer->setSingleShot(
true);
141 d->mShowTimer->start(d->mMinDuration);
147 return d->mMinDuration;
158 return d->mAllowCancel;
163 return d->mProgressBar;
168 return d->mProgressBar;
173 d->mLabel->setText(text);
178 return d->mLabel->text();
188 return d->mAutoClose;
198 return d->mAutoReset;
208 d->mCancelText = text;
214 return d->mCancelText;
217 void KProgressDialog::KProgressDialogPrivate::slotAutoActions(
int percentage)
219 if (percentage < mProgressBar->maximum() ||
220 (mProgressBar->minimum() == mProgressBar->maximum()))
222 if (!cancelButtonShown)
225 cancelButtonShown =
true;
234 mProgressBar->setValue(0);
238 q->setAllowCancel(
true);
240 cancelButtonShown =
false;
256 #include "kprogressdialog.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 21:58:38 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.