资源简介
最近做的一个项目涉及,返回桌面,软件在桌面悬浮一个按钮,当点击这个按钮之后在按钮后面展开一排其他功能按钮的入口,再次点击之后,展开的按钮回收缩回。按钮的展开缩回有动画效果

代码片段和文件信息
#include “fatherform.h“
#include “ui_fatherform.h“
#include “form.h“
#include
FatherForm::FatherForm(QWidget *parent) :
QWidget(parent)
ui(new Ui::FatherForm)
{
ui->setupUi(this);
form = new Form;
form->setParent(this);
form->setGeometry(this->pos().x()+this->width() this->pos().y() form->width() form->height());
form->show();
animationIn = new QPropertyAnimation(form “pos“);
animationOut = new QPropertyAnimation(form “pos“);
connect(animationOut SIGNAL(finished()) form SLOT(close()));
mIsForm = false;
}
FatherForm::~FatherForm()
{
delete ui;
}
void FatherForm::showForm()
{
qDebug() << “@@@@@@@@@@@@@@@@@showForm“;
form->raise();
form->show();
animationIn->setDuration(1000);
animationIn->setStartValue(form->pos());
animationIn->setEndValue(form->pos() - QPoint(form->width() 0));
animationIn->start();
}
void FatherForm::closeForm()
{
qDebug() << “#################closeForm“;
animationOut->setDuration(1000);
animationOut->setStartValue(form->pos());
animationOut->setEndValue(form->pos() + QPoint(form->width() 0));
animationOut->start();
}
void FatherForm::on_pushButton_clicked()
{
if (mIsForm == false)
{
mIsForm = true;
showForm();
update();
}
else if (mIsForm == true)
{
mIsForm = false;
closeForm();
update();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-16 14:29 testBtnShrinkage\
文件 1490 2019-05-15 17:03 testBtnShrinkage\fatherform.cpp
文件 578 2019-05-15 16:46 testBtnShrinkage\fatherform.h
文件 698 2019-05-15 17:26 testBtnShrinkage\fatherform.ui
文件 287 2019-05-15 16:54 testBtnShrinkage\form.cpp
文件 257 2019-05-15 16:11 testBtnShrinkage\form.h
文件 1570 2019-05-15 16:57 testBtnShrinkage\form.ui
文件 246 2019-05-15 17:34 testBtnShrinkage\main.cpp
文件 694 2019-05-16 12:04 testBtnShrinkage\mainwindow.cpp
文件 486 2019-05-16 12:05 testBtnShrinkage\mainwindow.h
文件 822 2019-05-16 11:36 testBtnShrinkage\mainwindow.ui
文件 540 2019-05-16 10:05 testBtnShrinkage\unti
文件 23579 2019-05-16 14:29 testBtnShrinkage\unti
文件 1643 2019-05-16 12:08 testBtnShrinkage\widget.cpp
文件 592 2019-05-16 12:08 testBtnShrinkage\widget.h
文件 2008 2019-05-16 10:54 testBtnShrinkage\widget.ui
相关资源
- 酒店管理系统基于Qt Creator5)
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- C 餐厅叫号系统(QT平)
- QT 实现文件下载
- qt图像处理
- QT,JPEG解码源代码(已完成)
- Qt 播放音频文件
- Qt 读取16进制的data文件
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- MQTT推送Demo
- 基于Linux、QT的视频监控系统的设计与
- Qt 百度地图 定位
- QT酷炫界面开发指南《QmlBook》
- Ubuntu下操作Excel,qt代码
- Qt图片浏览器 --基于Qt的Graphics View f
- qtnribbon2破解
- Qt软件开发 完整项目代码
- MQTT_3.1protocol_Specific中文版
- 在QT中使用RTP进行视频的采集和传输
- Mini6410 Qt4和Qtopia编程开发指南
- Qt实现Code39条形码
- qt_ffmpeg_mp4_export_and_import.zip
- QT5.5入门与项目实战
- Huffman Compress 霍夫曼编码 压缩 解压缩
评论
共有 条评论