mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-10 17:59:04 -04:00
Add QDarkStyleSheet to Message Aggregator reference application
This commit is contained in:
@@ -63,14 +63,29 @@ int main (int argc, char * argv[])
|
||||
QObject::connect (&app, SIGNAL (lastWindowClosed ()), &app, SLOT (quit ()));
|
||||
|
||||
{
|
||||
QFile file {":/qss/default.qss"};
|
||||
if (!file.open (QFile::ReadOnly))
|
||||
QString ss;
|
||||
auto sf = qApp->styleSheet ();
|
||||
if (sf.size ())
|
||||
{
|
||||
throw std::runtime_error {
|
||||
QString {"failed to open \"" + file.fileName () + "\": " + file.errorString ()}
|
||||
.toLocal8Bit ().constData ()};
|
||||
sf.remove ("file:///");
|
||||
QFile file {sf};
|
||||
if (!file.open (QFile::ReadOnly))
|
||||
{
|
||||
throw std::runtime_error {
|
||||
QString {"failed to open \"" + file.fileName () + "\": " + file.errorString ()}.toStdString ()};
|
||||
}
|
||||
ss += file.readAll ();
|
||||
}
|
||||
app.setStyleSheet (file.readAll());
|
||||
{
|
||||
QFile file {":/qss/default.qss"};
|
||||
if (!file.open (QFile::ReadOnly))
|
||||
{
|
||||
throw std::runtime_error {
|
||||
QString {"failed to open \"" + file.fileName () + "\": " + file.errorString ()}.toStdString ()};
|
||||
}
|
||||
ss += file.readAll ();
|
||||
}
|
||||
app.setStyleSheet (ss);
|
||||
}
|
||||
|
||||
MessageAggregatorMainWindow window;
|
||||
|
||||
Reference in New Issue
Block a user