summaryrefslogtreecommitdiff
path: root/UDPExamples/MessageAggregator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'UDPExamples/MessageAggregator.cpp')
-rw-r--r--UDPExamples/MessageAggregator.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/UDPExamples/MessageAggregator.cpp b/UDPExamples/MessageAggregator.cpp
index 81515ac0..52124045 100644
--- a/UDPExamples/MessageAggregator.cpp
+++ b/UDPExamples/MessageAggregator.cpp
@@ -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;