1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

highgui: allow specifying that a button should create a new buttonbar

This commit is contained in:
Pavel Rojtberg
2016-08-17 14:29:28 +02:00
parent 89833fa073
commit e4cf3297c7
2 changed files with 13 additions and 5 deletions
+6 -1
View File
@@ -1139,13 +1139,18 @@ void GuiReceiver::addButton(QString button_name, int button_type, int initial_bu
{
CvBar* lastbar = (CvBar*) global_control_panel->myLayout->itemAt(global_control_panel->myLayout->count() - 1);
if (lastbar->type == type_CvTrackbar) //if last bar is a trackbar, create a new buttonbar, else, attach to the current bar
// if last bar is a trackbar or the user requests a new buttonbar, create a new buttonbar
// else, attach to the current bar
if (lastbar->type == type_CvTrackbar || cv::QT_NEW_BUTTONBAR & button_type)
b = CvWindow::createButtonBar(button_name); //the bar has the name of the first button attached to it
else
b = (CvButtonbar*) lastbar;
}
// unset buttonbar flag
button_type = button_type & ~cv::QT_NEW_BUTTONBAR;
b->addButton(button_name, (CvButtonCallback) on_change, userdata, button_type, initial_button_state);
}