PeriDyno 1.0.0
Loading...
Searching...
No Matches
StyleTools.h
Go to the documentation of this file.
1/*
2 TabToolbar - a small utility library for Qt, providing tabbed toolbars
3 Copyright (C) 2018 Oleksii Sierov
4
5 TabToolbar is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 TabToolbar is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TabToolbar. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef TT_STYLE_TOOLS_H
19#define TT_STYLE_TOOLS_H
20#include <QStringList>
21#include <QStyle>
22#include <functional>
23#include <memory>
24
25#include "API.h"
26#include "Styles.h"
27
28namespace tt
29{
30
31using TStyleCreator = std::function<StyleParams*()>;
32
33TT_API void RegisterStyle(const QString& styleName, const TStyleCreator& creator);
34TT_API void UnregisterStyle(const QString& styleName);
35TT_API bool IsStyleRegistered(const QString& styleName);
36TT_API QString GetSheetForStyle(const StyleParams& style);
37TT_API QStringList GetRegisteredStyles();
38TT_API std::unique_ptr<StyleParams> CreateStyle(const QString& styleName);
39TT_API QString GetDefaultStyle();
40
41float GetScaleFactor(const QWidget& widget);
42int GetPixelMetric(QStyle::PixelMetric metric);
43
44}
45#endif
Definition Builder.h:33
void RegisterStyle(const QString &styleName, const TStyleCreator &creator)
bool IsStyleRegistered(const QString &styleName)
QString GetDefaultStyle()
int GetPixelMetric(QStyle::PixelMetric metric)
float GetScaleFactor(const QWidget &widget)
QStringList GetRegisteredStyles()
QString GetSheetForStyle(const StyleParams &style)
std::unique_ptr< StyleParams > CreateStyle(const QString &styleName)
void UnregisterStyle(const QString &styleName)
std::function< StyleParams *()> TStyleCreator
Definition StyleTools.h:31