From b8cb24499fc3716d19636d3e2bda89dc9e18716f Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sun, 18 Apr 2021 19:18:05 -0400 Subject: [PATCH] Added logic to make force the default Qt style to be a known good value. This is windows style for windows platform and fusion style for linux and mac osx. Depending on which Qt style plugins are installed on the OS, certain ones are known to be unstable (such as gtk2 style). --- src/drivers/Qt/GuiConf.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/drivers/Qt/GuiConf.cpp b/src/drivers/Qt/GuiConf.cpp index 9660e1d5..06837cc8 100644 --- a/src/drivers/Qt/GuiConf.cpp +++ b/src/drivers/Qt/GuiConf.cpp @@ -591,11 +591,36 @@ QStyle *fceuStyle::styleBase(QStyle *style) const if ( s.size() == 0 ) { + int i, idx = -1; +#ifdef WIN32 + QString defaultStyle("windows"); +#elif __APPLE__ + QString defaultStyle("fusion"); +#else + QString defaultStyle("fusion"); +#endif + QStringList styleKeys = QStyleFactory::keys(); - if ( styleKeys.size() > 0 ) + for (i=0; i= 0) && (idx < styleKeys.size()) ) + { + s = styleKeys[idx].toStdString(); + } + else + { + s.assign("fusion"); } }