mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-15 08:31:57 -05:00
Update README.md
C++ install procedure: sugest to put style.qss in the application resources.
This commit is contained in:
parent
03e50a75cc
commit
f172378ab1
14
README.md
14
README.md
@ -44,21 +44,23 @@ C++
|
|||||||
|
|
||||||
2) Add **qdarkstyle/style.qrc** to your **.pro file**
|
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
|
```cpp
|
||||||
QFile f("style.qss");
|
QFile data(":path/to/style.qss"); // TODO: set your own resource path
|
||||||
|
|
||||||
if (!f.exists())
|
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);
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
QTextStream ts(&f);
|
QTextStream ts(&data);
|
||||||
app.setStyleSheet(ts.readAll());
|
QApplication::instance()->setStyleSheet(ts.readAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user