Kstars

imageprovider.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 #include "imageprovider.h"
6 
7 ImageProvider::ImageProvider() : QQuickImageProvider(QQmlImageProviderBase::Image)
8 {
9 }
10 
11 QImage ImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
12 {
13  Q_UNUSED(size)
14  Q_UNUSED(requestedSize)
15  return images.value(id);
16 }
17 
18 void ImageProvider::addImage(const QString &id, QImage image)
19 {
20  images.insert(id, image);
21 }
const T value(const Key &key) const const
QHash::iterator insert(const Key &key, const T &value)
void addImage(const QString &id, QImage image)
Add image to the list of images with the given id.
virtual QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override
Get image by id.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 04:06:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.