From 03e50a75ccfbf11c17c5526344285914a3c9584c Mon Sep 17 00:00:00 2001 From: Colin Duquesnoy Date: Wed, 29 Jan 2014 17:52:23 +0100 Subject: [PATCH] Update README.md Improve c++ installation/usage procedure --- README.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7c2051776..00e1ea8a2 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,32 @@ pip install qdarkstyle C++ --------- -Download/clone the project and copy the following files to your application directory: +1) Download/clone the project and copy the following files to your application directory (keep the existing directory hierarchy): + + - **qdarkstyle/style.qss** + - **qdarkstyle/style.qrc** + - **qdarkstyle/rc/** (the whole directory) + +2) Add **qdarkstyle/style.qrc** to your **.pro file** + +3) Load the stylesheet: + +```cpp +QFile f("style.qss"); + +if ( !f.exists() ) +{ + printf("Unable to stylesheet\n"); +} +else +{ + f.open(QFile::ReadOnly | QFile::Text); + QTextStream ts(&f); + app.setStyleSheet(ts.readAll()); +} +``` + -- **qdarkstyle/style.qss** -- **qdarkstyle/style.qrc** -- **qdarkstyle/rc/** (the whole directory) Usage ============