From 200de07a95209a55d6019ba87f0abc78d302bf4c Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 11 Mar 2019 14:19:23 +0100 Subject: New upstream version 2.0.1+repack --- UDPExamples/MessageAggregator.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'UDPExamples/MessageAggregator.cpp') 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; -- cgit v1.2.3