Ask Your Question
0

How to use createButton ?

asked 2012-08-01 09:03:09 -0500

George Profenza gravatar image

I'm currently going through the samples and looking at how to add GUI elements. Starting from connectedcomponents.cpp I've managed to get understand how a trackbar works. Now I'm trying to add a button. Here's a basic snippet:

void on_button(int, void*){
    cout << "click" << endl;
}
//in main
createButton("test",on_button);

Before I got some link issues related to QtCore/QtGui. I've updated the OpenCV port to 2.4.2 with qt4 and the link error is gone and I can see some nice Gui elements in the namedWindow, but I can't see the button I created. Any hints/tips on what I'm doing wrong ?

Thanks!

edit retag flag offensive close merge delete

Comments

Hmm, just noticed the Button shows up in the Display Properties Window. Any way to get the button to display in the same 'vbox'/container with the trackbars ?

George Profenza gravatar imageGeorge Profenza ( 2012-08-01 09:14:49 -0500 )edit

My bad, clear case of RTFM on my side. Found this page explaining how createButton works. As far as I understand a button will always end up in the control panel, correct ?

George Profenza gravatar imageGeorge Profenza ( 2012-08-01 14:40:09 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2012-08-14 05:28:33 -0500

George Profenza gravatar image

As far as I understand from the docs the buttons will always be in the control panel.

OpenCV Qt support

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-08-01 09:03:09 -0500

Seen: 6,603 times

Last updated: Aug 14 '12