[Gui] Handle unset style preferences in clipboard about info

FIxes #16391
This commit is contained in:
Benjamin Bræstrup Sayoc
2024-09-12 23:42:36 +02:00
committed by Chris Hennes
parent 49ed687afc
commit 5bd595c0d3

View File

@@ -881,9 +881,25 @@ void AboutDialog::copyToClipboard()
}
str << "\n";
// Add Stylesheet/Theme/Qtstyle information
std::string styleSheet = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("StyleSheet");
std::string theme = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("Theme");
std::string style = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("QtStyle");
#if QT_VERSION >= QT_VERSION_CHECK(6, 1, 0)
std::string style = qApp->style()->name().toStdString();
#else
std::string style = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow")->GetASCII("QtStyle");
if(style.empty()) {
style = "Qt default";
}
#endif
if(styleSheet.empty()) {
styleSheet = "unset";
}
if(theme.empty()) {
theme = "unset";
}
str << "Stylesheet/Theme/QtStyle: "
<< QString::fromStdString(styleSheet) << "/"