Gui: Add QtStyle user parameter
This allows theme developers to set proper Qt style.
This commit is contained in:
committed by
Chris Hennes
parent
433dcec0be
commit
62463fa0bd
@@ -251,6 +251,9 @@ void DlgSettingsGeneral::saveSettings()
|
||||
int blinkTime{hGrp->GetBool("EnableCursorBlinking", true) ? -1 : 0};
|
||||
qApp->setCursorFlashTime(blinkTime);
|
||||
|
||||
std::string qtStyle = hGrp->GetASCII("QtStyle");
|
||||
qApp->setStyle(QString::fromStdString(qtStyle));
|
||||
|
||||
saveDockWindowVisibility();
|
||||
|
||||
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/MainWindow");
|
||||
|
||||
@@ -229,6 +229,7 @@ void StartupPostProcess::execute()
|
||||
setWheelEventFilter();
|
||||
setLocale();
|
||||
setCursorFlashing();
|
||||
setQtStyle();
|
||||
checkOpenGL();
|
||||
loadOpenInventor();
|
||||
setBranding();
|
||||
@@ -296,7 +297,6 @@ void StartupPostProcess::setLocale()
|
||||
else if (localeFormat == 2) {
|
||||
Translator::instance()->setLocale("C");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void StartupPostProcess::setCursorFlashing()
|
||||
@@ -307,6 +307,13 @@ void StartupPostProcess::setCursorFlashing()
|
||||
QApplication::setCursorFlashTime(blinkTime);
|
||||
}
|
||||
|
||||
void StartupPostProcess::setQtStyle()
|
||||
{
|
||||
ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("General");
|
||||
auto qtStyle = hGrp->GetASCII("QtStyle");
|
||||
QApplication::setStyle(QString::fromStdString(qtStyle));
|
||||
}
|
||||
|
||||
void StartupPostProcess::checkOpenGL()
|
||||
{
|
||||
QWindow window;
|
||||
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
void setWheelEventFilter();
|
||||
void setLocale();
|
||||
void setCursorFlashing();
|
||||
void setQtStyle();
|
||||
void checkOpenGL();
|
||||
void loadOpenInventor();
|
||||
void setBranding();
|
||||
|
||||
Reference in New Issue
Block a user