QPen output description?

  • Hi, I construct a QPen as QPen myPen{QBrush{QColor{100, 0, 0}}, 1.5, Qt::SolidLine} when I try to get the output of this using qDebug() << 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 the width() (but why is it 2 i.e. an interger and not 1.5 as I put it in the constructor? it should give me the widthF() otherwise the representation of the QPen in the output is wrong)
    • QBrush(QColor(ARGB 1, 0.392157, 0, 0),SolidPattern) the QBrush in ARGB pattern
    • SolidLine is because I used Qt::SolidLine in the constructor

    But what is the ...16,64,QVector(),0,2) part? In the QPen class description the most complete way to construct a pen is

    QPen(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?

  • Lifetime Qt Champion

    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

Log in to reply