PDA

View Full Version : qpushbutton slot not fired for mouse click event



dpn
22nd September 2013, 13:55
Hi All,

I have created frame-less dialog box. On dialog, I am able to create QVBoxLayout and added qpushbotton to layout.

----------------------------------------------------------------------------------------------------------
code snippet:(dialog box constructor)
-------------------
QVBoxLayout * layout = new QVBoxLayout(this);
QLabel * info = new QLabel("test label");
layout->addWidget(info, 0, 0);
QPushButton *btn = new QPushButton("test", this);
connect(btn, SIGNAL(clicked()), this, SLOT(btn_clicked()));
layout->addWidget(btn, 1, 0);

connect(btn, SIGNAL(clicked()), this, SLOT(btn_clicked()));

----------------------------------------------------------------------------------------------------------

Here, btn_clicked() fires for enterkey from keyboard but not for mouse click event. Any suggestions?

Thanks in advance.