yes,wthread is a workthread,vpwin is a member of it!
#ifndef QWORKTHREAD_H
#define QWORKTHREAD_H
#include <QThread>
#include <vpWindow.h>
class QWorkThread : public QThread
{
Q_OBJECT
public:
QWorkThread(QObject *parent);
~QWorkThread();
private:
void run();
public:
vpWindow *vpwin;
};
#endif // QWORKTHREAD_H
#include "qworkthread.h"
#include <vp.h>
#include <vpApp.h>
#include <vpKernel.h>
#include <vuAllocTracer.h>
#include <Qt/qwidget.h>
vuAllocTracer m_allocTracer;
QWorkThread::QWorkThread(QObject *parent)
: QThread(parent)
{
}
QWorkThread::~QWorkThread()
{
}
void QWorkThread::run()
{
//initial
vp::initialize(__argc, __argv);
//load acf
vpKernel::instance()->define("simple.acf");
//configure VP
vpKernel::instance()->configure();
//for begin
// vpwin=*vpWindow::begin();
// vpwin->setBorderEnable(false);
//vpwin->setFullScreenEnable(true);
// vpwin->setParent(wid);
while(vpKernel::instance()->beginFrame()!=0)
{
vpKernel::instance()->endFrame();
}
//exit
vpKernel::instance()->unconfigure();
vp::shutdown();
}
Added after 5 minutes:
In fact,I don't know how to combin QT and VP progaram.
I think when I get the WId of anyone widget,then set vp window as its parent is ok!
but as you know.......hehe!
say something to the problem,please. A simple example is looked forward.
Bookmarks