cvCreateButton does not connect clicked signal to callback function (Feature #786)
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
Qt: fixed signal of a clicked push button (patch #786)
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