2018-01-21 21:48:02 +08:00
|
|
|
|
#include "giftestdialog.h"
|
|
|
|
|
#include "ui_giftestdialog.h"
|
2018-01-23 17:41:11 +08:00
|
|
|
|
#include "qqtframe.h"
|
2018-01-22 20:00:51 +08:00
|
|
|
|
|
2018-01-21 21:48:02 +08:00
|
|
|
|
GifTestDialog::GifTestDialog ( QWidget* parent ) :
|
|
|
|
|
QDialog ( parent ),
|
|
|
|
|
ui ( new Ui::GifTestDialog )
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi ( this );
|
2018-01-22 20:00:51 +08:00
|
|
|
|
|
|
|
|
|
//使用res函数以前,代码量如此巨大。
|
|
|
|
|
#if defined (__ANDROID__) || defined (__ANDROIDX86__)
|
|
|
|
|
#if 0
|
|
|
|
|
//如果apk文件被删除了呢?
|
|
|
|
|
ui->labelGif->setGifFile ( "assets:/waiting.gif" );
|
|
|
|
|
ui->widgetGif->setGifFile ( "assets:/waiting.gif" );
|
|
|
|
|
ui->widgetQQt->setPixmap ( "assets:/yun.png" );
|
|
|
|
|
#else
|
|
|
|
|
ui->labelGif->setGifFile ( "://AppRoot/waiting.gif" );
|
|
|
|
|
ui->widgetGif->setGifFile ( "://AppRoot/waiting.gif" );
|
|
|
|
|
ui->widgetQQt->setPixmap ( "://AppRoot/yun.png" );
|
|
|
|
|
#endif
|
|
|
|
|
#else
|
|
|
|
|
//不兼容android....
|
2018-01-21 21:48:02 +08:00
|
|
|
|
ui->labelGif->setGifFile ( "./waiting.gif" );
|
2018-01-22 15:23:43 +08:00
|
|
|
|
ui->widgetGif->setGifFile ( "./waiting.gif" );
|
|
|
|
|
ui->widgetQQt->setPixmap ( "./yun.png" );
|
2018-01-22 20:00:51 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//使用了res函数以后 代码得到了极大简化
|
|
|
|
|
pline() << res ( "waiting.gif" );
|
|
|
|
|
ui->labelGif->setGifFile ( res ( "waiting.gif" ) );
|
|
|
|
|
ui->widgetGif->setGifFile ( res ( "waiting.gif" ) );
|
|
|
|
|
ui->widgetQQt->setPixmap ( res ( "yun.png" ) );
|
|
|
|
|
|
2018-01-21 21:48:02 +08:00
|
|
|
|
pline() << QMovie::supportedFormats();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GifTestDialog::~GifTestDialog()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|