SILICON
Loading...
Searching...
No Matches
siliconStyle.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <QProxyStyle>
20
21namespace SILICON::ui {
22
23class SiliconStyle : public QProxyStyle {
24 Q_OBJECT
25public:
26 explicit SiliconStyle(QObject* parent = nullptr);
27
28 void drawPrimitive(PrimitiveElement, const QStyleOption*, QPainter*,
29 const QWidget* = nullptr) const override;
30 void drawControl(ControlElement, const QStyleOption*, QPainter*,
31 const QWidget* = nullptr) const override;
32 void drawComplexControl(ComplexControl, const QStyleOptionComplex*, QPainter*,
33 const QWidget* = nullptr) const override;
34 QRect subElementRect(SubElement, const QStyleOption*,
35 const QWidget* = nullptr) const override;
36 QRect subControlRect(ComplexControl, const QStyleOptionComplex*, SubControl,
37 const QWidget* = nullptr) const override;
38 SubControl hitTestComplexControl(ComplexControl, const QStyleOptionComplex*,
39 const QPoint&,
40 const QWidget* = nullptr) const override;
41 QSize sizeFromContents(ContentsType, const QStyleOption*, const QSize&,
42 const QWidget* = nullptr) const override;
43 int pixelMetric(PixelMetric, const QStyleOption* = nullptr,
44 const QWidget* = nullptr) const override;
45 int styleHint(StyleHint, const QStyleOption* = nullptr, const QWidget* = nullptr,
46 QStyleHintReturn* = nullptr) const override;
47 QPalette standardPalette() const override;
48 QIcon standardIcon(StandardPixmap, const QStyleOption* = nullptr,
49 const QWidget* = nullptr) const override;
50 using QProxyStyle::polish;
51 using QProxyStyle::unpolish;
52 void polish(QWidget*) override;
53 void unpolish(QWidget*) override;
54};
55} // namespace SILICON::ui
void polish(QWidget *) override
void unpolish(QWidget *) override
QRect subElementRect(SubElement, const QStyleOption *, const QWidget *=nullptr) const override
void drawComplexControl(ComplexControl, const QStyleOptionComplex *, QPainter *, const QWidget *=nullptr) const override
QSize sizeFromContents(ContentsType, const QStyleOption *, const QSize &, const QWidget *=nullptr) const override
int styleHint(StyleHint, const QStyleOption *=nullptr, const QWidget *=nullptr, QStyleHintReturn *=nullptr) const override
int pixelMetric(PixelMetric, const QStyleOption *=nullptr, const QWidget *=nullptr) const override
QIcon standardIcon(StandardPixmap, const QStyleOption *=nullptr, const QWidget *=nullptr) const override
SiliconStyle(QObject *parent=nullptr)
SubControl hitTestComplexControl(ComplexControl, const QStyleOptionComplex *, const QPoint &, const QWidget *=nullptr) const override
QPalette standardPalette() const override
QRect subControlRect(ComplexControl, const QStyleOptionComplex *, SubControl, const QWidget *=nullptr) const override
void drawControl(ControlElement, const QStyleOption *, QPainter *, const QWidget *=nullptr) const override
void drawPrimitive(PrimitiveElement, const QStyleOption *, QPainter *, const QWidget *=nullptr) const override