summaryrefslogtreecommitdiff
path: root/UDPExamples/MessageAggregator.cpp
diff options
context:
space:
mode:
authorChristoph Berg <christoph.berg@credativ.de>2019-03-11 14:19:23 +0100
committerChristoph Berg <christoph.berg@credativ.de>2019-03-11 14:19:23 +0100
commit200de07a95209a55d6019ba87f0abc78d302bf4c (patch)
tree3b2922eb5d89b01ad214cae492e871c3bfb5df18 /UDPExamples/MessageAggregator.cpp
parente0737c56c1e384e05064a0c6e1ac46979371041b (diff)
New upstream version 2.0.1+repackupstream/2.0.1+repack
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;