4#include <Kanoop/kanoopcommon.h>
5#include <Kanoop/gui/utility/stylesheettypes.h>
6#include <Kanoop/gui/libkanoopgui.h>
28 static_assert(std::is_base_of<QWidget, T>::value,
"Templatized class type must be subclass of QWidget");
34 _typeName = t->metaObject()->className();
43 void setProperty(StyleSheetProperty property,
const QString& value);
50 void setProperty(StyleSheetProperty property,
const QColor& value);
63 void setGradient(
const QString& gradient) { setProperty(SP_Background, gradient); }
79 const QGradientStops& stops);
91 void setBorder(
const QString& topLeft,
const QString& bottomRight);
103 void setBorder(
int widthPx,
const QColor& topLeft,
const QColor& bottomRight);
130 StyleSheetPseudoState _pseudoState = PS_Invalid;
Template helper for building typed Qt stylesheet strings.
StyleSheet()
Construct and capture the widget class name as the CSS selector.
QString toString() const
Render all accumulated properties into a complete stylesheet rule.
QString _subControl
Sub-control selector string (empty = none).
QMap< StyleSheetProperty, QString > _properties
Accumulated property/value pairs for the stylesheet rule.
void setBorder(int widthPx, const QColor &topLeft, const QColor &bottomRight)
Set all four border properties using a pixel width and two colors.
void setSubControl(const QString &value)
Set the sub-control selector string (e.g., "::handle").
QString _typeName
CSS selector class name (set from T::metaObject()->className()).
void setRadialGradient(double cx, double cy, double radius, double fx, double fy, const QGradientStops &stops)
Set the background to a radial gradient specified by its geometric parameters.
void setProperty(StyleSheetProperty property, const QString &value)
Set a stylesheet property to a string value.
void setBorder(const QString &topLeft, const QString &bottomRight)
Set all four border properties at once using the dome highlight/shadow convention.
void setGradient(const QString &gradient)
Set the background to a gradient string (qradialgradient / qlineargradient).
void setPropertyPixels(StyleSheetProperty property, int value)
Set a stylesheet property to a pixel integer value.
void setPseudoState(StyleSheetPseudoState value)
Set the pseudo-state selector (e.g., PS_Hover, PS_Checked).
void setProperty(StyleSheetProperty property, const QColor &value)
Set a stylesheet property to a color value.