#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QTimer>
#include<QPainter>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
m_IconSize(30)
{
ui->setupUi(this);
m_timer.setInterval(1000/60);
connect(&m_timer , SIGNAL(timeout()) , this, SLOT(udpateSlot()));
m_timer.start();
connect(ui->AddBtn , SIGNAL(clicked()),this , SLOT(addSlot()));
connect(ui->SubBtn , SIGNAL(clicked()), this , SLOT(subSlot()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::udpateSlot(){
update();
}
void MainWindow::addSlot(){
m_IconSize += 1;
if(m_IconSize >= 100){
m_IconSize = 100;
}
update();
}
void MainWindow::subSlot(){
m_IconSize -=1;
if(m_IconSize <=0){
m_IconSize = 1;
}
update();
}
void MainWindow::paintEvent(QPaintEvent* event){
QPainter p
qt中svg格式图片的旋转
最新推荐文章于 2025-05-21 11:50:41 发布