Results 1 to 2 of 2

Thread: QPen has no effect

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    122
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    74

    Question QPen has no effect

    I'm drawing an image (see below) and it works in principle. However, for some reason two of the commands don't make any difference as if they weren't seen by the compiler. Does anyone have any ideas why?

    Qt Code:
    1. QPixmap map(100,100);
    2.  
    3. map.fill(Qt::white);
    4. QPainter p(&map);
    5. QPen pen;
    6. pen.setStyle(Qt::DashDotLine);//doesn't make a difference
    7. pen.setWidth(3); //doesn't make a difference
    8. p.setPen(QColor(0,0,0));
    9.  
    10. p.drawLine(50,50,100,100);
    11.  
    12. map.save("file.jpg", 0, 90);
    To copy to clipboard, switch view to plain text mode 
    Last edited by timmu; 3rd January 2013 at 11:37.

Similar Threads

  1. QgraphicsSimpleTextItem, QPen outline
    By user14921 in forum Qt Programming
    Replies: 1
    Last Post: 9th October 2011, 16:07
  2. Strange behaviour with QPen
    By franco.amato in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2010, 05:51
  3. Diff between QBrush and QPen
    By wagmare in forum Qt Programming
    Replies: 5
    Last Post: 16th February 2009, 14:47
  4. QPen color shift
    By Alberto in forum Qt Programming
    Replies: 0
    Last Post: 22nd October 2008, 11:35
  5. Problems with QPen
    By prosass in forum Newbie
    Replies: 3
    Last Post: 13th March 2007, 15:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.