Results 1 to 2 of 2

Thread: Qt colors strangeness

  1. #1
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt colors strangeness

    When trying do draw lines, all I get is black and white picture.


    int i;
    QPainter painter(this);
    QColor backC(255,255,255,0);
    QColor greenC(Qt::darkGreen);
    QBrush back(backC);
    QBrush green(greenC);
    painter.fillRect(0,0,300,300,back);
    painter.setBrush(green);
    for (i=0;i<300;i++)
    painter.drawLine(rand()%300, rand()%300, 300,300);

    what's wrong with the colors?

  2. #2
    Join Date
    Feb 2006
    Posts
    209
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt colors strangeness [Solved]

    dang. I should use the pen to draw lines. Sorry to bother you

Similar Threads

  1. QGroupBox appearing in random colors (Qt 3.3)
    By jgver in forum Qt Programming
    Replies: 0
    Last Post: 11th February 2009, 21:16
  2. QTreeView -- Alternating Row Colors Oddity
    By chuckshaw in forum Qt Programming
    Replies: 2
    Last Post: 4th October 2007, 19:41
  3. row colors
    By nategoofs in forum Qt Programming
    Replies: 3
    Last Post: 17th August 2007, 19:16
  4. Fonts, Colors, and QStyle
    By Jimmy2775 in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2006, 07:26
  5. Qt Designer 4.0.1 Preview Colors
    By jtyler in forum Qt Tools
    Replies: 2
    Last Post: 14th February 2006, 15:47

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.