QPen output description?
Unsolved
General and Desktop
-
Hi, I construct a
QPen
asQPen myPen{QBrush{QColor{100, 0, 0}}, 1.5, Qt::SolidLine}
when I try to get the output of this usingqDebug() << myPen
this is what I get:QPen(2,QBrush(QColor(ARGB 1, 0.392157, 0, 0),SolidPattern),SolidLine,16,64,QVector(),0,2)
I think I understand the part
QPen(2,QBrush(QColor(ARGB 1, 0.392157, 0, 0),SolidPattern),SolidLine, ...
:2
is thewidth()
(but why is it2
i.e. an interger and not1.5
as I put it in the constructor? it should give me thewidthF()
otherwise the representation of theQPen
in the output is wrong)QBrush(QColor(ARGB 1, 0.392157, 0, 0),SolidPattern)
theQBrush
in ARGB patternSolidLine
is because I usedQt::SolidLine
in the constructor
But what is the
...16,64,QVector(),0,2)
part? In theQPen
class description the most complete way to construct a pen isQPen(const QBrush &brush, qreal width, Qt::PenStyle style = Qt::SolidLine, Qt::PenCapStyle cap = Qt::SquareCap, Qt::PenJoinStyle join = Qt::BevelJoin)
So, what does the values
...16,64,QVector(),0,2)
correspond to and why my pen width is not represented correctly in output? -
Simply look at the source which parameters are used for the debug output: https://code.woboq.org/qt5/qtbase/src/gui/painting/qpen.cpp.html#_ZlsR11QDataStreamRK4QPen
-
@Christian-Ehrlicher Thanks :)