PDA

View Full Version : QToolButton & setStyleSheet



kavinsiva
3rd June 2010, 12:54
HI,


In My Application i need A QToolButton basically the edges of the QToolButton is Sharp.but i need Rounded Edge.For that i used following code


class Dialog : public QDialog {
public:
QToolButton *tb;
Dialog() : QDialog(){
tb=new QToolButton(this);
tb->setGeometry(10,10,100,100);
tb->setStyleSheet("border: 2px solid #8f8f91; border-radius: 20px");
}
};
int main(int argc, char **argv){
QApplication app(argc, argv);
Dialog dlg;
return dlg.exec();
}


After this the edges of toolbutton gets changed to round edges but i can't able to click the toolbutton.The tool button looks like disabled state.But if i check like isEnabled() it returns true.Please Help me to achieve this one.

Regards

tbscope
3rd June 2010, 14:52
Set more styles, one for enabled, one for disabled, one for ...