Skip to content
Snippets Groups Projects
Commit 091e0cf9 authored by konstantin.kukharenko's avatar konstantin.kukharenko Committed by dmitriy.gerasimov
Browse files

Features 3051

parent 3890f182
No related branches found
No related tags found
2 merge requests!17Develop old,!11Feature 3131
......@@ -24,4 +24,11 @@ namespace Utils
}
return (result.size() == 4) ? QColor(result.at(0), result.at(1), result.at(2), result.at(3)) : QColor();
}
int toIntValue(const QString &a_text)
{
QRegExp regString("(\\d+)");
regString.indexIn(a_text);
return regString.cap(0).toInt();
}
}
......@@ -6,6 +6,9 @@
namespace Utils
{
QColor toColor(const QString &strRGBA);
///The function returns the first integer in the string.
/// 100%=>100 100px=>100 100**=>100 100=>100
int toIntValue(const QString &a_text);
};
#endif // UTILS_H
......@@ -28,11 +28,11 @@ void StyledDropShadowEffect::updateStyle()
else
this->setColor(Utils::toColor(colorStr));
int blur = AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "blur").toInt();
int blur = Utils::toIntValue(AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "blur"));
this->setBlurRadius(blur);
//Offset:
int x = AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "x").toInt();
int y = AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "y").toInt();
int x = Utils::toIntValue(AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "x"));
int y = Utils::toIntValue(AppStyleSheetHandler::getValueFromStylesheet(stylesheet, "y"));
this->setOffset(x, y);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment