10#include <config-libkleo.h>
12#include "progressbar.h"
14#include <kleo_ui_debug.h>
18static const int busyTimerTickInterval = 100;
19static const int busyTimerTickIncrement = 5;
21Kleo::ProgressBar::ProgressBar(
QWidget *parent)
25 mBusyTimer =
new QTimer(
this);
30void Kleo::ProgressBar::slotProgress(
const QString &,
int cur,
int tot)
35void Kleo::ProgressBar::slotProgress(
const QString &,
int,
int cur,
int tot)
42 qCDebug(KLEO_UI_LOG) <<
"Kleo::ProgressBar::setMaximum(" << total <<
" )";
43 if (total == maximum()) {
52 qCDebug(KLEO_UI_LOG) <<
"Kleo::ProgressBar::setValue(" << p <<
" )";
63void Kleo::ProgressBar::slotBusyTimerTick()
66 if (mBusyTimer->isActive()) {
71void Kleo::ProgressBar::fixup(
bool newValue)
76 qCDebug(KLEO_UI_LOG) <<
"Kleo::ProgressBar::startStopBusyTimer() cur =" << cur <<
"; tot =" << tot <<
"; real =" << mRealProgress;
78 if ((newValue && mRealProgress < 0) || (!newValue && cur < 0)) {
79 qCDebug(KLEO_UI_LOG) <<
"(new value) switch to reset";
85 }
else if (tot == 0) {
86 qCDebug(KLEO_UI_LOG) <<
"(new value) switch or stay in busy";
87 if (!mBusyTimer->isActive()) {
88 mBusyTimer->start(busyTimerTickInterval);
94 qCDebug(KLEO_UI_LOG) <<
"(new value) normal progress";
102#include "moc_progressbar.cpp"
void setValue(int progress)
void setMaximum(int total)
void setRange(int cur, int tot)
void setMaximum(int maximum)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:01 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.