FlightGear
next
QmlColoredImageProvider.hxx
Go to the documentation of this file.
1
// Copyright (C) 2021 James Turner <james@flightgear.org>
2
//
3
// This program is free software; you can redistribute it and/or
4
// modify it under the terms of the GNU General Public License as
5
// published by the Free Software Foundation; either version 2 of the
6
// License, or (at your option) any later version.
7
//
8
// This program is distributed in the hope that it will be useful, but
9
// WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
// General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
17
#pragma once
18
19
#include <QColor>
20
#include <QQuickImageProvider>
21
22
class
QQmlEngine;
23
29
class
QmlColoredImageProvider
:
public
QQuickImageProvider
30
{
31
public
:
32
QmlColoredImageProvider
();
33
34
QImage
requestImage
(
const
QString&
id
, QSize* size,
const
QSize& requestedSize)
override
;
35
36
QPixmap
requestPixmap
(
const
QString&
id
, QSize* size,
const
QSize& requestedSize)
override
;
37
38
void
loadStyleColors
(QQmlEngine* engine,
int
styleTypeId);
39
40
static
QmlColoredImageProvider
*
instance
();
41
42
private
:
43
QColor _themeColor, _textColor, _themeContrastColor, _activeColor;
44
QColor _destructiveColor;
45
};
QmlColoredImageProvider::loadStyleColors
void loadStyleColors(QQmlEngine *engine, int styleTypeId)
Definition
QmlColoredImageProvider.cxx:30
QmlColoredImageProvider::requestImage
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override
Definition
QmlColoredImageProvider.cxx:74
QmlColoredImageProvider::instance
static QmlColoredImageProvider * instance()
Definition
QmlColoredImageProvider.cxx:137
QmlColoredImageProvider::QmlColoredImageProvider
QmlColoredImageProvider()
Definition
QmlColoredImageProvider.cxx:25
QmlColoredImageProvider::requestPixmap
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
Definition
QmlColoredImageProvider.cxx:131
src
GUI
QmlColoredImageProvider.hxx
Generated on Tue Jun 3 2025 12:58:39 for FlightGear by
1.13.2