MCPcopy Create free account
hub / github.com/IENT/YUView / convertStringToPen

Function convertStringToPen

YUViewLib/src/statistics/StatisticsType.cpp:55–68  ·  view source on GitHub ↗

The inverse functio to get a QPen from the string

Source from the content-addressed store, hash-verified

53
54// The inverse functio to get a QPen from the string
55LineDrawStyle convertStringToPen(const QString &str)
56{
57 LineDrawStyle style;
58 QStringList split = str.split(" ");
59 if (split.length() == 3)
60 {
61 style.color = Color(split[0].toStdString());
62 style.width = split[1].toDouble();
63 auto patternIdx = split[2].toInt();
64 if (patternIdx >= 0 && unsigned(patternIdx) < AllPatterns.size())
65 style.pattern = AllPatterns[patternIdx];
66 }
67 return style;
68}
69
70std::vector<StatisticsType::ArrowHead> AllArrowHeads = {StatisticsType::ArrowHead::arrow,
71 StatisticsType::ArrowHead::circle,

Callers 1

loadPlaylistMethod · 0.85

Calls 2

ColorClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected