PDA

View Full Version : QColorDialog



angarali06
16th April 2011, 17:40
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..

bmesing
17th April 2011, 19:02
something like this?

colorButton->setPalette(QColor(Qt::green))