MCPcopy Create free account
hub / github.com/KDAB/GammaRay / penToString

Function penToString

plugins/guisupport/guisupport.cpp:917–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

915}
916
917static QString penToString(const QPen &p)
918{
919 QStringList l;
920 l.reserve(8);
921 l.push_back(GuiSupport::tr("width: %1").arg(p.width()));
922 l.push_back(GuiSupport::tr("brush: %1").arg(brushToString(p.brush())));
923 l.push_back(EnumUtil::enumToString(QVariant::fromValue(p.style())));
924 l.push_back(EnumUtil::enumToString(QVariant::fromValue(p.capStyle())));
925 l.push_back(EnumUtil::enumToString(QVariant::fromValue(p.joinStyle())));
926 if (p.joinStyle() == Qt::MiterJoin)
927 l.push_back(GuiSupport::tr("miter limit: %1").arg(p.miterLimit()));
928 if (!p.dashPattern().isEmpty()) {
929 QStringList dashes;
930 dashes.reserve(p.dashPattern().size());
931 foreach (auto v, p.dashPattern())
932 dashes.push_back(QString::number(v));
933 l.push_back(GuiSupport::tr("dash pattern: (%1)").arg(dashes.join(QLatin1String(", "))));
934 }
935 if (p.dashOffset() != 0.0)
936 l.push_back(GuiSupport::tr("dash offset: %1").arg(p.dashOffset()));
937 return l.join(QLatin1String(", "));
938}
939
940static QString regionToString(const QRegion &region)
941{

Callers

nothing calls this directly

Calls 6

brushToStringFunction · 0.85
enumToStringFunction · 0.85
reserveMethod · 0.80
styleMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected