Exemplo n.º 1
0
MyLogo::MyLogo(QWidget *parent)
:QLabel(parent)
{
    QLabel *label_logo = new QLabel(parent);
    filename = QString::fromUtf8("./system_picture/logo.gif");
    QMovie *mygif = new QMovie(filename);
    label_logo->setGeometry(660, 30, 60, 50);
    mygif->setScaledSize(QSize(60, 50));
    label_logo->setMovie(mygif);
    mygif->setSpeed(50);
    mygif->start();
}
Exemplo n.º 2
0
BusyDialog::BusyDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::BusyDialog)
{
    ui->setupUi(this);
    setWindowFlags(Qt::Popup);

    QMovie *movie = new QMovie(":/loading.gif");
    movie->setParent(this);
    movie->setSpeed(50);// 50%
    movie->setScaledSize(QSize(64, 64));
    ui->labelGif->setMovie(movie);
}
Exemplo n.º 3
0
QLabel* TabbedWebView::animationLoading(int index, bool addMovie)
{
    if (index == -1) {
        return 0;
    }

    QLabel* loadingAnimation = qobject_cast<QLabel*>(m_tabWidget->getTabBar()->tabButton(index, QTabBar::LeftSide));
    if (!loadingAnimation) {
        loadingAnimation = new QLabel();
    }
    if (addMovie && !loadingAnimation->movie()) {
        QMovie* movie = new QMovie(":icons/other/progress.gif", QByteArray(), loadingAnimation);
        movie->setSpeed(70);
        loadingAnimation->setMovie(movie);
        movie->start();
    }
    else if (loadingAnimation->movie()) {
        loadingAnimation->movie()->stop();
    }

    m_tabWidget->getTabBar()->setTabButton(index, QTabBar::LeftSide, 0);
    m_tabWidget->getTabBar()->setTabButton(index, QTabBar::LeftSide, loadingAnimation);
    return loadingAnimation;
}