Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- QFile File("://stylesheet.qss");
- File.open(QFile::ReadOnly);
- QString StyleSheet = QLatin1String(File.readAll());
- qApp->setStyleSheet(StyleSheet);
- Theme * themeInstance;
- QApplication::setStyle(QStyleFactory::create("Fusion"));
- QPalette p;
- p.setColor(QPalette::Window, themeInstance->getCustomColor());
- qApp->setPalette(dp);
- return a.exec();
- }
- class Theme : public QWidget
- {
- Q_OBJECT
- Q_PROPERTY(QColor customColor READ custombgColor WRITE setCustomColor DESIGNABLE true)
- public:
- Theme(QWidget *parent = nullptr);
- QColor customColor() const { return m_customColor; };
- void setCustomColor(const QColor &c) { m_customColor = c; };
- private:
- QColor m_customColor;
- protected:
- };
Add Comment
Please, Sign In to add comment