cvCreateButton does not connect clicked signal to callback function (Feature #786)


Added by Prakash Manandhar about 14 years ago. Updated over 12 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:Ilya Lysenkov % Done:

0%

Category:highgui-gui
Target version:-
Difficulty: Pull request:

Description

In file: window_QT.cpp
CvButtonbar::addButton

Current code:
if (button) {
QObject::connect( button, SIGNAL ),button, SLOT ));
addWidget(button,Qt::AlignCenter);
}

code should be:
if (button) {
if (button_type == CV_PUSH_BUTTON)
QObject::connect( button, CLICKED ),button, SLOT ));

QObject::connect( button, SIGNAL( toggled(bool) ),button, SLOT( callCallBack(bool) ));
addWidget(button,Qt::AlignCenter);
}

Associated revisions

Revision 233dfd25
Added by Ilya Lysenkov over 13 years ago

Qt: fixed signal of a clicked push button (patch #786)

Revision 7ac0d869
Added by Andrey Kamaev almost 12 years ago

Merge pull request #786 from cuda-geek:fix-build-gpu-off-cuda-on

History

Updated by Prakash Manandhar about 14 years ago

This means that a normal button click is ignored, while the checkbox and radiobutton work well.

Updated by Hae Yong Kim about 14 years ago

The code above did not work. The code that works is:

if (button)
{
if (button_type == CV_PUSH_BUTTON)
QObject::connect( button, SIGNAL( clicked(bool) ),button, SLOT( callCallBack(bool) ));
else
QObject::connect( button, SIGNAL( toggled(bool) ),button, SLOT( callCallBack(bool) ));
addWidget(button,Qt::AlignCenter);
}

Updated by Ilya Lysenkov over 13 years ago

  • Status deleted (Open)

Updated by Ilya Lysenkov over 13 years ago

Thank you all for this ticket and your patches! I've applied the patch by hae in -r5581 (trunk) and it works fine.

  • Status set to Done
  • (deleted custom field) set to fixed

Updated by Andrey Kamaev over 12 years ago

  • Category changed from highgui-images to highgui-gui

Also available in: Atom PDF