首页 >> 知识 >> OpenCV: Qt New Functions

OpenCV: Qt New Functions

#include

Attaches a button to the control panel.

The function createButton attaches a button to the control panel. Each button is added to a buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the control panel before, or if the last element attached to the control panel was a trackbar or if the QT_NEW_BUTTONBAR flag is added to the type.

See below various examples of the cv::createButton function call: :

createButton("",callbackButton);//create a push button "button 0", that will call callbackButton.createButton("button2",callbackButton,NULL,QT_CHECKBOX,0);createButton("button3",callbackButton,&value);createButton("button5",callbackButton1,NULL,QT_RADIOBOX);createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1);createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON|QT_NEW_BUTTONBAR);// create a push button in a new rowcv::QT_PUSH_BUTTON@ QT_PUSH_BUTTONPush button.Definition highgui.hpp:214cv::QT_NEW_BUTTONBAR@ QT_NEW_BUTTONBARButton should create a new buttonbar.Definition highgui.hpp:217Parameters bar_nameName of the button. on_changePointer to the function to be called every time the button changes its state. This function should be prototyped as void Foo(int state,*void); . state is the current state of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button. userdataPointer passed to the callback function. typeOptional type of the button. Available types are: (cv::QtButtonTypes) initial_button_stateDefault state of the button. Use for checkbox and radiobox. Its value could be 0 or 1. (Optional)
网站地图