hi, anda_skoa.thank you all the same. i have to set the flat and AutoFillBackground attributes to true .so i get the result as i except.
code is :
ui->setupUi(this);
ui->btn_curveColor->setFlat(true);
ui->btn_curveColor->setAutoFillBackground(true);
curveColor
=ui
->btn_curveColor
->palette
().
color(QPalette::Button);
int r=curveColor.red();
int g=curveColor.green();
int b=curveColor.blue();
int a=curveColor.alpha();
cout<<"r="<<r<<"\tg="<<g<<"\tb="<<b<<"\ta="<<a<<endl;
ui->setupUi(this);
ui->btn_curveColor->setFlat(true);
ui->btn_curveColor->setAutoFillBackground(true);
curveColor=ui->btn_curveColor->palette().color(QPalette::Button);
int r=curveColor.red();
int g=curveColor.green();
int b=curveColor.blue();
int a=curveColor.alpha();
cout<<"r="<<r<<"\tg="<<g<<"\tb="<<b<<"\ta="<<a<<endl;
To copy to clipboard, switch view to plain text mode
best wishes.
Micky Jhon
Originally Posted by
anda_skoa
Seems the style sheet does not change the palette but somehow overrides it.
Too bad, seems you have to parse the stylesheet string yourself.
Cheers,
_
Bookmarks