1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/giftest/giftestdialog.cpp

43 lines
1.2 KiB
C++
Raw Normal View History

#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
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....
ui->labelGif->setGifFile ( "./waiting.gif" );
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" ) );
pline() << QMovie::supportedFormats();
}
GifTestDialog::~GifTestDialog()
{
delete ui;
}