mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
this can be used in qss selectors
This commit is contained in:
committed by
Mathew Sutcliffe
parent
197560c3c3
commit
7907dff967
@@ -411,6 +411,26 @@ namespace BlackGui
|
||||
return s1;
|
||||
}
|
||||
|
||||
void CStyleSheetUtility::setQSysInfoProperties(QWidget *widget, bool withChildWidgets)
|
||||
{
|
||||
Q_ASSERT_X(widget, Q_FUNC_INFO, "Missing widget");
|
||||
if (!widget->property("qsysKernelType").isValid())
|
||||
{
|
||||
widget->setProperty("qsysKernelType", QSysInfo::kernelType());
|
||||
widget->setProperty("qsysCurrentCpuArchitecture", QSysInfo::currentCpuArchitecture());
|
||||
widget->setProperty("qsysBuildCpuArchitecture", QSysInfo::buildCpuArchitecture());
|
||||
widget->setProperty("qsysProductType", QSysInfo::productType());
|
||||
}
|
||||
|
||||
if (withChildWidgets)
|
||||
{
|
||||
for (QWidget *w : widget->findChildren<QWidget *>(QString(), Qt::FindDirectChildrenOnly))
|
||||
{
|
||||
CStyleSheetUtility::setQSysInfoProperties(w, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CStyleSheetUtility::ps_qssDirectoryChanged(const QString &file)
|
||||
{
|
||||
Q_UNUSED(file);
|
||||
|
||||
Reference in New Issue
Block a user