Simplify code for setting widgets style
This commit is contained in:
parent
b7b4467326
commit
4ed713e6a0
|
@ -99,9 +99,8 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
|
||||||
if (m_lngArg.isPresent()) {
|
if (m_lngArg.isPresent()) {
|
||||||
QLocale::setDefault(QLocale(QString::fromLocal8Bit(m_lngArg.values().front())));
|
QLocale::setDefault(QLocale(QString::fromLocal8Bit(m_lngArg.values().front())));
|
||||||
}
|
}
|
||||||
if (m_styleArg.isPresent()) {
|
|
||||||
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
#ifdef QT_UTILITIES_GUI_QTWIDGETS
|
||||||
if (m_qtWidgetsGuiArg.isPresent()) {
|
if (m_qtWidgetsGuiArg.isPresent() && m_styleArg.isPresent()) {
|
||||||
if (QStyle *const style = QStyleFactory::create(QString::fromLocal8Bit(m_styleArg.values().front()))) {
|
if (QStyle *const style = QStyleFactory::create(QString::fromLocal8Bit(m_styleArg.values().front()))) {
|
||||||
QApplication::setStyle(style);
|
QApplication::setStyle(style);
|
||||||
} else {
|
} else {
|
||||||
|
@ -109,7 +108,6 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
if (m_iconThemeArg.isPresent()) {
|
if (m_iconThemeArg.isPresent()) {
|
||||||
auto i = m_iconThemeArg.values().cbegin(), end = m_iconThemeArg.values().end();
|
auto i = m_iconThemeArg.values().cbegin(), end = m_iconThemeArg.values().end();
|
||||||
if (i != end) {
|
if (i != end) {
|
||||||
|
|
Loading…
Reference in New Issue