?
#include "widget.h"
#include "ui_widget.h"
#include<QPainter>
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
this->setFixedSize(611,570);
ui->slider->setMaximum(410);
ui->slider->setMinimum(135);
connect(ui->slider,SIGNAL(valueChanged(int)),this,SLOT(sliderValueChangedSlotFun(int)));
}
Widget::~Widget()
{
delete ui;
}
void Widget::paintEvent(QPaintEvent *event)
{
QPainter p (this)
int R = this->width()/2;
int r = this->width()/4;
p.translate( this->width()/2,this->height()/2);
p.drawPixmap(-R,-R+30,this->width(),this->height(),QPixmap(":/rs/Pan.png"));
p.rotate( ui->slider->value());
p.drawPixmap(-23,-25,r*1.5,r/3.5,QPixmap(":/rs/Point.png"));
}
void Widget::sliderValueChangedSlotFun(int)
{
this->update();
}