Results 1 to 4 of 4

Thread: C++/Qt Developer, Multithreading, IPC and Vega Prime developer

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Sao Paulo / Brazil
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: C++/Qt Developer, Multithreading, IPC and Vega Prime developer

    Updating the resume: hernan_martinez_enus.doc

  2. #2
    Join Date
    Jun 2012
    Posts
    0
    Platforms
    Windows

    Default Re: C++/Qt Developer, Multithreading, IPC and Vega Prime developer

    My friend,Can you help me about Vega prime in QT?
    when I new a widget and get the WId,it's run ok;
    but when I use vpwin->setparent(wid),it's wrong in something.
    why and how can I do?
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QWorkThread wthread(NULL);
    QWidget *qwt=new QWidget;

    QSize vs = qwt->size();
    qwt->show();
    wthread.start();
    WId wid=qwt->winId();
    wthread.vpwin->setParent((HWND)wid);
    return a.exec();
    }

    thanks very much!

  3. #3
    Join Date
    Jun 2012
    Posts
    0
    Platforms
    Windows

    Default Re: C++/Qt Developer, Multithreading, IPC and Vega Prime developer

    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.
    Last edited by simeitech; 27th June 2012 at 06:35.

Similar Threads

  1. Good Developer vs Bad Developer
    By wysota in forum General Discussion
    Replies: 30
    Last Post: 13th December 2010, 16:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.