summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/code/src_gui_image_qmovie.cpp
blob: 390f69a70300e4b7ce36c7739bb01f19724ae540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QLabel>
#include <QMovie>

namespace src_gui_image_qmovie {

void wrapper0() {


//! [0]
QLabel label;
QMovie *movie = new QMovie("animations/fire.gif");

label.setMovie(movie);
movie->start();
//! [0]

} // wrapper0


void wrapper1() {

//! [1]
QMovie movie("racecar.gif");
movie.setSpeed(200); // 2x speed
//! [1]

} // wrapper1
} // src_gui_image_qmovie