1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/test/giftest/giftestdialog.cpp
tianduanrui 6cac2878e0 update
2018-02-13 21:04:13 +08:00

46 lines
1.4 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "giftestdialog.h"
#include "ui_giftestdialog.h"
#include "qqtframe.h"
GifTestDialog::GifTestDialog ( QWidget* parent ) :
QDialog ( parent ),
ui ( new Ui::GifTestDialog )
{
ui->setupUi ( this );
//使用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" );
#endif
//使用了res函数以后 代码得到了极大简化
pline() << res ( "waiting.gif" );
pline() << res ( "../waiting.gif" );
pline() << QDir ( "." ).relativeFilePath ( "skin/yun.png" );
pline() << QDir ( res ( "../waiting.gif" ) ).absolutePath();
ui->labelGif->setGifFile ( skin ( "waiting.gif" ) );
ui->widgetGif->setGifFile ( skin ( "waiting.gif" ) );
ui->widgetQQt->setPixmap ( skin ( "yun.png" ) );
pline() << QMovie::supportedFormats();
}
GifTestDialog::~GifTestDialog()
{
delete ui;
}