CLEye with QT - seperate classes to use within qt
Posted: 27 August 2013 04:36 AM   [ Ignore ]
New Member
Rank
Total Posts:  6
Joined  2013-08-02

Hi,

I’m new to C++ and QT and struggeling to seperate the multicam example to work as a class of its own.

Maybe some of you can be of help, as a really need to get this to work.

Here is the Stackoverflow link, hope this is appropriate.

http://stackoverflow.com/questions/18461687/instantiate-a-class-within-another-class

Thanks so much.

Profile
 
 
Posted: 27 August 2013 07:08 AM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  6
Joined  2013-08-02

Ok, so i catched the error when tryin to acces the class by my main program class.

Now i have the problem if I close the Camera with my QT Stopbutton Connection the mainwindow in QT freezes.

I don’t know why the Mainwindow freezes when closing the Camerawindow with

cam[0]->stopCapture(); 

void qtDEVC::stopCam()
{
    qDebug
()<<("stopCam()");
    
cam[0]->StopCapture();
    
delete cam[0];
    
ui.lineEditID->setDisabled(false);
    
ui.pushButton_startCam->setDisabled(false);

The camera window closes properly just the mainwindow freezes.

Profile
 
 
Posted: 29 August 2013 03:53 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

What is the code inside your CLEyeCameraCapture::StopCapture() method?
How to you stop the capture thread?

Profile
 
 
Posted: 30 August 2013 07:47 AM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  6
Joined  2013-08-02

thanks for your reply!

//stop Capturing with Camera and close window
    
void CLEyeCameraCapture::StopCapture()
    
{
        
if(!_running)    return;
        
_running false;
        
WaitForSingleObject(_hThread1000);
        
cvDestroyWindow(_windowName);
    

this is the same as the original.

unfortunately the multicam example is not playing very well together with my idea to make a QT Application with a control window and a cameraviewer out of it. I now managed to seperate the class and integrate it, but i guess there is no way around to translating:

 

_hThread CreateThread(NULL0, &CLEyeCameraCapture;::CaptureThreadthis00); 

to a QThread.

But I guess this will be more of a QT Question.

Profile
 
 
 
 


RSS 2.0     Atom Feed