MCPcopy Create free account
hub / github.com/MITK/MITK / ParseColor

Function ParseColor

Modules/QtWidgets/src/QmitkStyleManager.cpp:25–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace
24{
25 QString ParseColor(const QString &subject, const QString &colorName, const QString &fallback)
26 {
27 const QString pattern = QString("%1\\s*[=:]\\s*(#[0-9a-f]{6})").arg(colorName);
28
29 QRegularExpression re(pattern, QRegularExpression::CaseInsensitiveOption);
30 auto match = re.match(subject);
31
32 return match.hasMatch()
33 ? match.captured(1)
34 : fallback;
35 }
36}
37
38QIcon QmitkStyleManager::ThemeIcon(const QByteArray &originalSVG)

Callers 2

GetIconColorMethod · 0.70
GetIconAccentColorMethod · 0.70

Calls 2

matchMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected