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

Function convertPenToString

YUViewLib/src/statistics/StatisticsType.cpp:44–52  ·  view source on GitHub ↗

Get a string with all values of the QPen

Source from the content-addressed store, hash-verified

42
43// Get a string with all values of the QPen
44QString convertPenToString(const LineDrawStyle &style)
45{
46 auto colorHex = QString::fromStdString(style.color.toHex());
47 auto patternIt = std::find(AllPatterns.begin(), AllPatterns.end(), style.pattern);
48 if (patternIt == AllPatterns.end())
49 return {};
50 auto patternIdx = std::distance(AllPatterns.begin(), patternIt);
51 return QString("%1 %2 %3").arg(colorHex).arg(style.width).arg(patternIdx);
52}
53
54// The inverse functio to get a QPen from the string
55LineDrawStyle convertStringToPen(const QString &str)

Callers 1

savePlaylistMethod · 0.85

Calls 1

toHexMethod · 0.80

Tested by

no test coverage detected