From f172378ab1660db8b7da3aa565d6c5bda11d5374 Mon Sep 17 00:00:00 2001 From: Colin Duquesnoy Date: Wed, 29 Jan 2014 18:07:30 +0100 Subject: [PATCH] Update README.md C++ install procedure: sugest to put style.qss in the application resources. --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 00e1ea8a2..086405c5b 100644 --- a/README.md +++ b/README.md @@ -44,21 +44,23 @@ C++ 2) Add **qdarkstyle/style.qrc** to your **.pro file** -3) Load the stylesheet: +3) Add **qdarkstyle/style.qss** to your resources. + +4) Load the stylesheet: ```cpp -QFile f("style.qss"); - -if ( !f.exists() ) +QFile data(":path/to/style.qss"); // TODO: set your own resource path +if (!f.exists()) { - printf("Unable to stylesheet\n"); + printf("Unable to set stylesheet, file not found\n"); } -else +else { f.open(QFile::ReadOnly | QFile::Text); - QTextStream ts(&f); - app.setStyleSheet(ts.readAll()); + QTextStream ts(&data); + QApplication::instance()->setStyleSheet(ts.readAll()); } + ```