KTextAddons

runninganimatedimage.cpp
1/*
2 SPDX-FileCopyrightText: 2020 David Faure <faure@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "runninganimatedimage.h"
8
9#include <QMovie>
10using namespace TextEmoticonsCore;
11RunningAnimatedImage::RunningAnimatedImage(const QModelIndex &idx)
12 : index(idx)
13 , movie(new QMovie)
14{
15}
16
17RunningAnimatedImage::~RunningAnimatedImage()
18{
19 // Note that this happens (with a nullptr movie) when the vector is re-allocated
20 delete movie;
21}
22
23RunningAnimatedImage::RunningAnimatedImage(RunningAnimatedImage &&other) noexcept
24 : index(other.index)
25 , movie(other.movie)
26{
27 other.movie = nullptr;
28}
29
30RunningAnimatedImage &RunningAnimatedImage::operator=(RunningAnimatedImage &&other)
31{
32 index = other.index;
33 movie = other.movie;
34 other.movie = nullptr;
35 return *this;
36}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.