35 #define HIGH_CONTRAST_STYLE_SHEET "highcontrast.qss" 36 #define DEFAULT_STYLE_SHEET "style.qss" 49 const QString & defaultStyleSheet =
"",
50 const QString & alternateStyleSheet =
"" );
127 QString textStyle()
const {
return _textStyle; }
157 bool updateRendering( QWidget *wid );
160 void renderParent( QWidget *wid );
161 QImage getScaled(
const QString name,
const QSize & size );
180 const QString
buildStyleSheet(QString content, QStringList & alreadyImportedFilenames);
192 bool eventFilter( QObject * obj, QEvent * ev );
194 QString _currentStyleSheet;
195 QString _defaultStyleSheet = DEFAULT_STYLE_SHEET;
196 QString _alternateStyleSheet = HIGH_CONTRAST_STYLE_SHEET;
197 bool _usingAlternateStyleSheet =
false;
210 QHash<QString,BackgrInfo> _backgrounds;
211 QMap<QWidget*, QList< QWidget* > > _children;
214 QList< QWidget* > _registered_widgets;
220 #endif // QY2Styler_h bool styleSheetExists(const QString &file)
Determines if an style sheet exists.
QY2Styler(QObject *parent, const QString &defaultStyleSheet="", const QString &alternateStyleSheet="")
Constructor.
const QString buildStyleSheet(QString content)
Build a stylesheet from a string.
void toggleAlternateStyleSheet()
Toggle between default/alternate style sheets.
const QString buildStyleSheetFromFile(const QString &filename, QStringList &alreadyImportedFilenames)
Build a stylesheet from a file.
void setStyleSheet(const QString &text)
Applies a style sheet from a string.
void registerWidget(QWidget *widget)
Registers a widget and applies the style sheet.
bool loadStyleSheet(const QString &file)
Loads and apply a style sheet from a file.
bool usingAlternateStyleSheet()
Determines if the alternate style is being used.
void processUrls(QString &text)
Search and replace some self-defined macros in the style sheet.
bool loadDefaultStyleSheet()
Loads the default stylesheet.
void setDefaultStyleSheet(const QString &styleSheet)
Set style sheet for the default theme.
void setAlternateStyleSheet(const QString &styleSheet)
Set style sheet for the alternate theme.
bool loadAlternateStyleSheet()
Loads the alternate stylesheet.
QString themeDir() const
Returns the path to the style sheets directory.
void registerChildWidget(QWidget *parent, QWidget *widget)
Registers a child widget.
void unregisterWidget(QWidget *widget)
Unregisters a widget.