SILICON
Loading...
Searching...
No Matches
themedSvgItem.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#pragma once
10
11#include <QGraphicsSvgItem>
12
13#include <ui/lifetime.hpp>
14
15namespace SILICON::ui {
16
18class ThemedSvgItem : public QGraphicsSvgItem {
19public:
20 explicit ThemedSvgItem(QString path, QGraphicsItem* parent = nullptr);
21 ~ThemedSvgItem() override;
22
23private:
24 void refreshTheme();
25
26 QString path;
27 class RendererLease;
28 // QObject child teardown follows QGraphicsSvgItem teardown, preserving the lease
29 // throughout the base item's lifetime as required by setSharedRenderer().
32};
33
34} // namespace SILICON::ui
ThemedSvgItem(QString path, QGraphicsItem *parent=nullptr)
Definition icons.cpp:305