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 :
Qt Code:
  1. ui->setupUi(this);
  2. ui->btn_curveColor->setFlat(true);
  3. ui->btn_curveColor->setAutoFillBackground(true);
  4. curveColor=ui->btn_curveColor->palette().color(QPalette::Button);
  5.  
  6. int r=curveColor.red();
  7. int g=curveColor.green();
  8. int b=curveColor.blue();
  9. int a=curveColor.alpha();
  10.  
  11. cout<<"r="<<r<<"\tg="<<g<<"\tb="<<b<<"\ta="<<a<<endl;
To copy to clipboard, switch view to plain text mode 

best wishes.

Micky Jhon



Quote Originally Posted by anda_skoa View Post
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,
_