Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
Resource.h
Go to the documentation of this file.
1#pragma once
2#include <QFile>
3#include <QIcon>
4#include <QPalette>
5#include <misc/global.h>
6
7namespace sf
8{
13{
14 public:
66
72 static QString getSvgIconResource(Icon icon);
73
79 static QByteArray getByteArray(const QString& resource);
80
88 static QByteArray getSvg(QFile& file, const QColor& color = QColor(), const QSize& size = QSize());
89
100 static QImage getSvgImage(const QString& resource, const QColor& color = QColor(), const QSize& size = QSize());
101
110 static QIcon getSvgIcon(const QString& resource, const QColor& color = QColor(), QSize size = QSize());
111
121 static QIcon getSvgIcon(const QString& resource, const QPalette& palette, QPalette::ColorRole role, QSize size = QSize());
122
131 static QIcon getSvgIcon(const QString& resource, QPalette::ColorRole role, QSize size = QSize());
132
133 private:
140 static QColor getColor(const QColor& color, float brightness = 1.0);
141
148 static float getColorLuminance(const QColor& color);
149
150 /*
151 * @brief Holds all the icon names in the res file.
152 */
153 static const char* _iconResources[];
154
158 static const char* _warningLocation;
162 static int _defaultIconSize;
163};
164
165}// namespace sf
Class for accessing resources like SVG images as a QIcon.
Definition Resource.h:13
Icon
List of available icons which is easy wen using auto complete.
Definition Resource.h:19
@ Remove
Definition Resource.h:50
@ Hand
Definition Resource.h:55
@ Graph
Definition Resource.h:64
@ Exit
Definition Resource.h:35
@ Compile
Definition Resource.h:42
@ CloseWindows
Definition Resource.h:37
@ Add
Definition Resource.h:49
@ Run
Definition Resource.h:45
@ Application
Definition Resource.h:40
@ Redo
Definition Resource.h:29
@ Reload
Definition Resource.h:21
@ Settings
Definition Resource.h:39
@ Edit
Definition Resource.h:48
@ Save
Definition Resource.h:30
@ Undo
Definition Resource.h:28
@ Open
Definition Resource.h:24
@ Close
Definition Resource.h:32
@ Submit
Definition Resource.h:22
@ Initialize
Definition Resource.h:43
@ Form
Definition Resource.h:57
@ Configuration
Definition Resource.h:38
@ OpenFolder
Definition Resource.h:54
@ Cut
Definition Resource.h:25
@ Start
Definition Resource.h:46
@ Search
Definition Resource.h:56
@ Development
Definition Resource.h:41
@ Copy
Definition Resource.h:26
@ Location
Definition Resource.h:62
@ Step
Definition Resource.h:44
@ Cancel
Definition Resource.h:31
@ Clear
Definition Resource.h:20
@ Container
Definition Resource.h:58
@ Position
Definition Resource.h:61
@ Expand
Definition Resource.h:53
@ New
Definition Resource.h:23
@ Widget
Definition Resource.h:59
@ Folder
Definition Resource.h:51
@ Palette
Definition Resource.h:60
@ Collapse
Definition Resource.h:52
@ Paste
Definition Resource.h:27
@ Okay
Definition Resource.h:34
@ Stop
Definition Resource.h:47
@ Tools
Definition Resource.h:63
@ CloseWindow
Definition Resource.h:36
@ Check
Definition Resource.h:33
static QByteArray getByteArray(const QString &resource)
Retrieves resource in a byte array.
static QIcon getSvgIcon(const QString &resource, const QPalette &palette, QPalette::ColorRole role, QSize size=QSize())
Gets an SVG QIcon type from a resource location using the palette and role for color.
static QIcon getSvgIcon(const QString &resource, QPalette::ColorRole role, QSize size=QSize())
Gets an SVG QIcon type from a resource location using the application palette and the passed role for...
static QString getSvgIconResource(Icon icon)
Gets an SVG-type icon resource location from the pass enumerate value.
static QByteArray getSvg(QFile &file, const QColor &color=QColor(), const QSize &size=QSize())
Gets an SVG using the passed color as the main color set in the 'svg' tags attribute.
static QIcon getSvgIcon(const QString &resource, const QColor &color=QColor(), QSize size=QSize())
Gets an SVG QIcon type from a resource location using the passed color and optional size.
static QImage getSvgImage(const QString &resource, const QColor &color=QColor(), const QSize &size=QSize())
Gets an SVG using the passed color as the main color set in the 'svg' tags attribute....
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10