Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPen output description?
Forum Updated to NodeBB v4.3 + New Features

QPen output description?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 241 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CJhaC Offline
    CJhaC Offline
    CJha
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      CJhaC 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        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

        CJhaC Offline
        CJhaC Offline
        CJha
        wrote on last edited by
        #3

        @Christian-Ehrlicher Thanks :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved