void CircleTimer::paint(QPainter *painter){ //Рисуем обьект таймер QBrush brush(backgroundColor_); QBrush brushActive(borderActiveColor_); QBrush brushNonActive(borderNonActiveColor_); QBrush brushHours(borderHoursColor_); QBrush brushMinutes(borderMinutesColor_); QBrush brushSpacer(spacerCircleColor_); painter->setPen(Qt::NoPen); painter->setRenderHints(QPainter::Antialiasing, true); painter->setBrush(brushNonActive); painter->drawEllipse(boundingRect().adjusted(1,1,-1,-1)); painter->setBrush(brushHours); //Рисуем круг для отображения часов painter->drawPie(boundingRect().adjusted(1, 1, -1, -1), 90 * 16, angleOfRotationFull_ * 16); painter->setBrush(brushNonActive); painter->drawEllipse(boundingRect().adjusted(10,10,-10,-10)); painter->setBrush(brushSpacer); //Рисуем круг для отображения промежутка между активными облостями painter->drawPie(boundingRect().adjusted(10, 10, -10, -10), 90 * 16, angleOfRotation_ * 16); painter->setBrush(brushNonActive); painter->drawEllipse(boundingRect().adjusted(14,14,-14,-14)); painter->setBrush(brushMinutes); //Рисуем круг для отображения минут painter->drawPie(boundingRect().adjusted(14, 14, -14, -14), 90 * 16, angleOfRotation_ * 16); painter->setBrush(brush); //Основной круг, он рисуется поверх остальных painter->drawEllipse(boundingRect().adjusted(18, 18, -18, -18));}
painter->setBrush(Qt::NoBrush);painter->drawPie(boundingRect().adjusted(14, 14, -14, -14), 90 * 16, angleOfRotation_ * 16);painter->setBrush(Qt::NoBrush);painter->setPen(backgroundColor_);painter->setRenderHints(QPainter::Antialiasing, true);painter->drawEllipse(boundingRect().adjusted(18, 18, -18, -18));