#include "mainwidget.h"
#include <QApplication>
#include <QSharedMemory>
#include <QSplashScreen>
#include <QDateTime>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSharedMemory shared_memory;
shared_memory.setKey(QString("MainInterface"));
if (shared_memory.attach())
{
return 0;
}
if (shared_memory.create(1)) //任何时候只启动一个相同的程序
{
MainWidget w;
//程序启动logo
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap(":/ad/loading"));
//splash->setWindowOpacity(0.9);
splash->show();
QDateTime n2=QDateTime::currentDateTime();
QDateTime now;
Qt::Alignment topRight = Qt::AlignHCenter | Qt::AlignBottom;
splash->showMessage(QObject::tr("Starting the main interface..."),topRight, Qt::black);
do{
now=QDateTime::currentDateTime();
}while (n2.secsTo(now)<=2);//2为需要延时的秒数
splash->showMessage(QObject::tr("Loading database module..."),topRight, Qt::black);
do{
now=QDateTime::currentDateTime();
}while (n2.secsTo(now)<=3);//3为需要延时的秒数
splash->showMessage(QObject::tr("loading..."),topRight, Qt::black);
do{
now=QDateTime::currentDateTime();
}while (n2.secsTo(now)<=4);//4为需要延时的秒数
splash->finish(&w);
w.show();
return a.exec();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
QT5 Widget无边框标题栏和自定义程序启动画面
共14个文件
png:7个
cpp:3个
h:2个
4星 · 超过85%的资源 需积分: 50 89 下载量 36 浏览量
2017-04-19
15:50:10
上传
评论 4
收藏 168KB ZIP 举报
温馨提示
QT5 Widget 无边框标题栏和自定义程序启动画面的小例子,可以直接拿来用
资源推荐
资源详情
资源评论
收起资源包目录
MainInterface.zip (14个子文件)
mainwidget.cpp 1KB
mainwidget.h 446B
resources
titleButtons
close_pressed.png 1KB
min_pressed.png 980B
close.png 1KB
close_hover.png 1KB
min.png 970B
min_hover.png 971B
ad
loading.png 159KB
MainInerface.pro 1KB
TPPPushButton.h 708B
maininterface.qrc 608B
main.cpp 1KB
TPPPushButton.cpp 1KB
共 14 条
- 1
资源评论
- nefetaria2017-10-28是用C++写得,可以运行,一开始以为是QML的,不过还是谢谢啦
- 苏塔亚库2018-05-08半成品,没拖动功能,还是有参考价值的
飛越無限
- 粉丝: 242
- 资源: 35
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功