Ref T225, utility function to force stylesheet update

* Needed when setting UI element to readonly, and stylesheet is different for readonly
* see https://stackoverflow.com/q/48141205/356726
This commit is contained in:
Klaus Basan
2018-01-18 14:39:34 +01:00
parent 1948d067e4
commit 8e2a1b1b6f
2 changed files with 9 additions and 0 deletions

View File

@@ -504,4 +504,10 @@ namespace BlackGui
const bool highDpi = stringToBool(vs);
return highDpi;
}
void CGuiUtility::forceStyleSheetUpdate(QWidget *widget)
{
if (!widget) { return; }
widget->setStyleSheet(widget->styleSheet());
}
} // ns

View File

@@ -167,6 +167,9 @@ namespace BlackGui
//! Using high DPI screen support
static bool isUsingHighDpiScreenSupport();
//! Forces a stylesheet update
static void forceStyleSheetUpdate(QWidget *widget);
private:
//! Constructor, use static methods only
CGuiUtility() {}