mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-09-28 16:16:48 -04:00
Update readme
Now that style.qss has been added to the qrc file, users do not need to add it themselves.
This commit is contained in:
parent
322a55c536
commit
bba2d80b98
@ -44,12 +44,10 @@ C++
|
|||||||
|
|
||||||
2) Add **qdarkstyle/style.qrc** to your **.pro file**
|
2) Add **qdarkstyle/style.qrc** to your **.pro file**
|
||||||
|
|
||||||
3) Add **qdarkstyle/style.qss** to your resources.
|
3) Load the stylesheet:
|
||||||
|
|
||||||
4) Load the stylesheet:
|
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
QFile data(":path/to/style.qss"); // TODO: set your own resource path
|
QFile f(":qdarkstyle/style.qss");
|
||||||
if (!f.exists())
|
if (!f.exists())
|
||||||
{
|
{
|
||||||
printf("Unable to set stylesheet, file not found\n");
|
printf("Unable to set stylesheet, file not found\n");
|
||||||
@ -57,7 +55,7 @@ if (!f.exists())
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
f.open(QFile::ReadOnly | QFile::Text);
|
f.open(QFile::ReadOnly | QFile::Text);
|
||||||
QTextStream ts(&data);
|
QTextStream ts(&f);
|
||||||
QApplication::instance()->setStyleSheet(ts.readAll());
|
QApplication::instance()->setStyleSheet(ts.readAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user