Fix a bug that impede to set the trackbar pos using the Qt control panel

This commit is contained in:
Luis Díaz Más 2015-03-19 21:25:10 +01:00
parent 69344f175b
commit 7711cd284b

View File

@ -406,13 +406,14 @@ static CvBar* icvFindBarByName(QBoxLayout* layout, QString name_bar, typeBar typ
static CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char* name_window, QBoxLayout* layout = NULL) static CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char* name_window, QBoxLayout* layout = NULL)
{ {
QString nameQt(name_trackbar); QString nameQt(name_trackbar);
QString nameWinQt(name_window);
if (!name_window && global_control_panel) //window name is null and we have a control panel if (nameWinQt.isEmpty() && global_control_panel) //window name is null and we have a control panel
layout = global_control_panel->myLayout; layout = global_control_panel->myLayout;
if (!layout) if (!layout)
{ {
QPointer<CvWindow> w = icvFindWindowByName(QLatin1String(name_window)); QPointer<CvWindow> w = icvFindWindowByName(nameWinQt);
if (!w) if (!w)
CV_Error(CV_StsNullPtr, "NULL window handler"); CV_Error(CV_StsNullPtr, "NULL window handler");