Guest User

Untitled

a guest
Apr 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. QFile File("://stylesheet.qss");
  5. File.open(QFile::ReadOnly);
  6. QString StyleSheet = QLatin1String(File.readAll());
  7. qApp->setStyleSheet(StyleSheet);
  8.  
  9. Theme * themeInstance;
  10.  
  11. QApplication::setStyle(QStyleFactory::create("Fusion"));
  12.  
  13. QPalette p;
  14. p.setColor(QPalette::Window, themeInstance->getCustomColor());
  15. qApp->setPalette(dp);
  16.  
  17. return a.exec();
  18. }
  19.  
  20. class Theme : public QWidget
  21. {
  22. Q_OBJECT
  23. Q_PROPERTY(QColor customColor READ custombgColor WRITE setCustomColor DESIGNABLE true)
  24. public:
  25. Theme(QWidget *parent = nullptr);
  26.  
  27. QColor customColor() const { return m_customColor; };
  28. void setCustomColor(const QColor &c) { m_customColor = c; };
  29. private:
  30. QColor m_customColor;
  31. protected:
  32. };
Add Comment
Please, Sign In to add comment