QT 等待对话框/进度--
用QT的,加载的一张gif图片。记录下来以后免得忘记。
- #ifndef DIALOG_H
- #define DIALOG_H
- #include <QDialog>
- #include <QLabel>
- #include<QPainter>
- #include<QMovie>
- class Dialog : public QDialog
- {
- Q_OBJECT
- public:
- explicit Dialog(QWidget *parent = 0);
- ~Dialog();
- private:
- QMovie *movie;
- QLabel *label;
- };
- #endif // DIALOG_H
- #include"dialog.h"
- Dialog::Dialog(QWidget*parent):
- QDialog(parent)
- {
- label = new QLabel(this);
- this->setFixedSize(200,200);
- setWindowOpacity(0.5); //设置透明用;
- this->setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint);
- //取消对话框标题
- //this->setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint);
- //取消对话框标题和边框
- //this->setAutoFillBackground(true);
- this->setContentsMargins(0,0,0,0);
- label->setContentsMargins(0,0,0,0);
- /*QPalettepalette;palette.setBrush(QPalette::Background,QBrush(QPixmap("E:/qml/imgdialog/loading.gif")));
- this->setPalette(palette)*/;
- movie = new QMovie("loading.gif");
- label->setMovie(movie);
- movie->start();
- }
- Dialog::~Dialog()
- {
- delete label;
- delete movie;
- }
效果:
http://blog.csdn.net/wangwei890702/article/details/8590392
QT 等待对话框/进度--的更多相关文章
- 实用ExtJS教程100例-004:等待对话框Ext.MessageBox.wait
在前面两节中,我们分别演示了ExtJS三种常用的对话框和ExtJS带有进度条的对话框.在本节内容中,我们来看看ExtJS中的等待对话框. 首先来看一个简单的例子[查看在线示例]: 这种对话框会一直滚动 ...
- Qt之对话框QDialog
这一节主要讲述对话框类,先讲述两种不同类型的对话框,再介绍Qt提供的几个标准对话框.对应本节的内容,可以在帮助索引中查看 QDialog 和 Dialog Windows 关键字. 一.模态和非模态对 ...
- 12个QT基本对话框,以及淡入原理(用定时器把窗口逐渐变成透明)
一.基本对话框 1,核心库: 界面程序 QApplication 非程序界面QCoreAppliction 2,消息循环必须执行QApplication.exec(); 3,消息绑定机制: 信号-槽 ...
- 如何修改Qt标准对话框的文字(例如,英文改成中文)
此篇文章参考qtcn论坛整理而成,因为文字和图片是本人亲自组织,所以仍算原创. http://www.qtcn.org/bbs/read-htm-tid-30650.html http://blog. ...
- android等待对话框
等待对话框,这里有两种方式来实现: ProgressDialog方式 progressDialog初始化 private void initProgressDialog() { progressDia ...
- 【代码笔记】iOS-在导航栏中显示等待对话框
一,效果图. 二,代码. ViewController.m #import "ViewController.h" @interface ViewController () @end ...
- Qt flash_eraseall nandwrite 进度条显示擦除、烧录
/***************************************************************************** * Qt flash_eraseall n ...
- QT 选择对话框简单示例
QT 选择对话框简单示例 部分代码: pDialog->addSeparator(); QAction *pmb2 = pDialog->addAction(QString::fromLo ...
- QT模态对话框及非模态对话框
QT模态对话框及非模态对话框 模态对话框(Modal Dialog)与非模态对话框(Modeless Dialog)的概念不是Qt所独有的,在各种不同的平台下都存在.又有叫法是称为模式对话框,无模式对 ...
随机推荐
- C - The C Answer (2nd Edition) - Exercise 1-6
/* Verify that the expression getchar() != EOF is 0 or 1. */ #include <stdio.h> main() { int c ...
- [React Native] Animate Styles of a React Native View with Animated.timing
In this lesson we will use Animated.timing to animate the opacity and height of a View in our React ...
- 【u010】银河英雄传说
Time Limit: 1 second Memory Limit: 128 MB [问题描述] 公元五八○一年,地球居民迁移至金牛座α第二行星,在那里发表银河联邦创立宣言,同年改元为宇宙历元年,并开 ...
- [Django] Get started with Django -- Install python and virtualenv
Install python3 on MacOS: brew install python3 Come alone with python3, there are also some other to ...
- ppt转flash kindeditor上传视频全屏问题
最近要增加页面的ppt显示功能,于是考虑把ppt转成flash,在网上搜到了ispingfree,链接: https://pan.baidu.com/s/1QZzx6qmdsnwzWCuULXzUOw ...
- HDU 1244 Max Sum Plus Plus Plus - dp
传送门 题目大意: 给一个序列,要求将序列分成m段,从左至右每一段分别长l1,l2,...lm,求最大的和是多少. 题目分析: 和最大m段子段和相似,先枚举\(i \in [1,m]\),然后$j \ ...
- Web自动化测试(全网最给力自动化教程)
http://www.cnblogs.com/zidonghua/p/7430083.html python+selenium自动化软件测试(第2章):WebDriver API 欢迎您来阅读和练手! ...
- flex新的心得
主要是对于flex: 与width: 的心得,先看代码. <head> <meta charset="UTF-8"> <meta name=" ...
- Indexing Sensor Data
In particular embodiments, a method includes, from an indexer in a sensor network, accessing a set o ...
- Method and Apparatus for Providing Highly-Scalable Network Storage for Well-Gridded Objects
An apparatus comprising a plurality of storage nodes comprising a plurality of corresponding storage ...