PDA

View Full Version : Design Qpushbutton



mattigot
29th August 2012, 12:11
hey,

how do i design the default button?


QPushButton* pb = new QPushButton(statusBar());

QPixmap pixmap(icon);//the file name of the icon
QIcon ButtonIcon(pixmap);
pb->setIcon(ButtonIcon);
QSize s(16,16);
pb->setIconSize(s);
QString tip(btnName);
pb->setToolTip(tip);
connect(pb, SIGNAL(clicked()), this, SLOT(statusBtnClicked()));

the button has an image in it (as meant to be)

but it has some kind for frame (border) with padding that wraps the button.

i want to remove that

how do i do that?

thank you

sonulohani
29th August 2012, 12:35
pb->setStyleSheet("QPushButton {background : transparent;}");

mattigot
29th August 2012, 13:17
found the answer thanx to sonulohani
pb->setStyleSheet("QPushButton {border-style: none;}");