KanoopGuiQt 1.3.0
Qt GUI utility library
Loading...
Searching...
No Matches
stylesheets.h
1/******************************************************************************************
2**
3** stylesheets.h
4**
5** Moved from my Tesseract Engineering repo to open-source
6**
7** Author: Stephen Punak
8** Created: Mon Oct 16 12:07:32 2023
9**
10******************************************************************************************/
11#ifndef STYLESHEETS_H
12#define STYLESHEETS_H
13
14#include <QColor>
15#include <QString>
16#include <Kanoop/gui/libkanoopgui.h>
17
18/**
19 * @brief Static helpers for generating common Qt stylesheet fragments.
20 *
21 * Each method returns a stylesheet snippet string that can be concatenated
22 * or passed directly to QWidget::setStyleSheet().
23 */
24class LIBKANOOPGUI_EXPORT StyleSheets
25{
26public:
27 /**
28 * @brief Build a background-color stylesheet fragment.
29 * @param color Background colour
30 * @return Stylesheet string, e.g. "background-color: #rrggbb;"
31 */
32 static QString backgroundColor(const QColor& color);
33
34 /**
35 * @brief Build a color (foreground) stylesheet fragment.
36 * @param color Foreground colour
37 * @return Stylesheet string, e.g. "color: #rrggbb;"
38 */
39 static QString foregroundColor(const QColor& color);
40
41 /**
42 * @brief Build a border-radius stylesheet fragment.
43 * @param radius Border radius in pixels
44 * @return Stylesheet string, e.g. "border-radius: 4px;"
45 */
46 static QString borderRadius(int radius);
47};
48
49#endif // STYLESHEETS_H
Static helpers for generating common Qt stylesheet fragments.
Definition stylesheets.h:25
static QString borderRadius(int radius)
Build a border-radius stylesheet fragment.
static QString foregroundColor(const QColor &color)
Build a color (foreground) stylesheet fragment.
static QString backgroundColor(const QColor &color)
Build a background-color stylesheet fragment.