views:

89

answers:

3

I have problem with displaying Cam on QTLabel using openCV, Every thing is working fine . except one . I have to call function from open === cvNamedWindow() == in order for program to work properly . its displaying the webcam on the QLabel no problem but if i don't call the cvNamedWindow function then the program is just hanging its just keep displaying the camera which are working on the screen but i can't click on any thing else its getting freeze. doest any one has any idea why its happening and what i am doing wrong ?

A: 

Did you start the Qt event loop by calling

app.exec();

? Otherwise the Qt events such as mouse clicks will never be handled.

If you have your code in a loop requesting the camera images frame by frame, you can also call

qApp->processEvents();

. Maybe you can post the relevant code snippet, otherwise it's hard to say what's going wrong.

Martin
A: 

Thanks for the reply.. That how my application is kicking off.. This is main method

TryQt is my Application with GUI....

QApplication a(argc, argv); QString path = qApp->applicationDirPath(); a.addLibraryPath(path+"/plugins"); TryQt w; w.show(); return w.exec();

Shahzaib
it should be a.exec()
Martin
A: 

I have the same problem as you, but the way you solved it's not working.

Could you tell me please in what order are you getting the image from the avi and executing opencv/qt code? i mean, what did you do instead of cvNamedWindow to get the program to work properly?

thanks! :)

JackGrim