Results 1 to 2 of 2

Thread: QColorDialog

  1. #1
    Join Date
    Apr 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QColorDialog

    Hi everybody!

    I have a colorButton (QToolButton) that opens a color dialog box (QColorDialog) when user clicked on it.. I want that colorButton has the color "green" picked by default (without opening a dialog box) as if QColorDialog has been shown to to the user and the user picked that green color..

    My piece if code is :

    colorButton->setPalette(QColorDialog::getColor(Qt::green));

    It opens the color dialog box (QColorDialog) and has the color green selected.. But I don't want to show the dialog box to the user..

    Please help

    Thanks..

  2. #2
    Join Date
    Feb 2006
    Posts
    32
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QColorDialog

    something like this?
    Qt Code:
    1. colorButton->setPalette(QColor(Qt::green))
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QColorDialog
    By BrainFreeze in forum Qt Programming
    Replies: 3
    Last Post: 6th March 2011, 04:45
  2. QColorDialog always return 0 as a result
    By NoRulez in forum Qt Programming
    Replies: 8
    Last Post: 17th October 2009, 12:06
  3. Using <QColorDialog>
    By Gily in forum Newbie
    Replies: 5
    Last Post: 26th December 2007, 20:26
  4. Please help ASAP::QColorDialog
    By LiCodeX in forum Newbie
    Replies: 2
    Last Post: 2nd October 2007, 12:16
  5. QColorDialog Apperance?
    By antonio.r.tome in forum Qt Programming
    Replies: 9
    Last Post: 16th April 2006, 07:43

Tags for this Thread

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.