Nepomuk-Core
Go to the documentation of this file.
23 #include <QPaintEvent>
29 class CircularCountdown::Private
46 setAutoFillBackground(
false);
48 d->timeLine =
new QTimeLine(msec,
this);
50 d->timeLine->setFrameRange(0, 720);
52 d->timeLine->setDirection(QTimeLine::Backward);
55 connect(d->timeLine, SIGNAL(frameChanged(
int)),
this, SLOT(repaint()));
58 connect(d->timeLine, SIGNAL(finished()),
this, SLOT(repaint()));
61 connect(d->timeLine, SIGNAL(finished()),
this, SIGNAL(
timeout()));
71 if (d->timeLine->state() == QTimeLine::Running || d->timeLine->state() == QTimeLine::Paused) {
72 QPainter painter(
this);
74 painter.setBrush(QBrush(parentWidget()->palette().color(QPalette::Base), Qt::SolidPattern));
75 painter.setRenderHint(QPainter::Antialiasing);
84 painter.drawPie(this->rect().adjusted(2, 2, -2, -2), 90*16, -d->timeLine->currentFrame()*8);
94 d->timeLine->setDuration(msec);
99 return d->timeLine->duration();
103 d->timeLine->start();
112 d->timeLine->setPaused(
true);
116 d->timeLine->resume();
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Mar 22 2013 10:58:52 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.