点击按钮横向缓缓展开控件
效果图![在这里插入图片描述](https://img-blog.csdnimg.cn/20200513161931769.gif)
关键代码
form.cpp
#include "form.h"
#include "ui_form.h"
const int Scaling_factor = 5;
Form::Form(QWidget *parent) :
QWidget(parent),
ui(new Ui::Form)
{
ui->setupUi(this);
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
timer = new QTimer;
connect(timer, SIGNAL(timeout()), this, SLOT(onTimeout()));
mLength = width();
minimumLength = 0;
maximumLength = mLength;
mIsBtn = false;
}
Form::~Form()
{
delete ui;
}
void Form::show