PDA

View Full Version : Problem related to Out Side the Round Ring Button



Sambu
3rd November 2011, 06:46
Hi all,

i want to develope the round ring button.
i am able to create the round button with Push button and Style sheet.
Code as follows:
---------------
QPushButton *pushButton;
pushButton = new QPushButton(this);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(QRect(40, 170, 90, 90));
pushButton->setStyleSheet(QString::fromUtf8("border-radius: 45px ;\n"
"border:7px solid gray;\n"
"\n"""));

-------------
but, problem here, if i prees the out side of the ring shape button also ,it is takeing as button press.
how to make mask the out side the ring shape. even user click the out of the ring it show not take it as click/press event.

Can any one guide me on the same.

Regards,
sambu.

Niamita
3rd November 2011, 08:03
Try it

pushButton->setStyleSheet("QPushButton { border-radius: 45px ;\n"
"border:7px solid gray;} QPushButton:pressed { border-radius: 45px ;\n"
"border:7px solid gray;} ");
May it help

Sambu
3rd November 2011, 12:06
Hi Niamita ,

Thanks for replay.

Below code which you send also, same behavior as my code. even if i click the out site the ring still it is consider as click behavior.
It didn't work for me.

Regards,
sambu.