Jump to content
  • Advertisement
Sign in to follow this  
Silencecraft

how to display a dx widget in a Qt app?

This topic is 1986 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include "worldedit.h"
#include "CreateDevice.h"
 
 
 
WorldEdit::WorldEdit(QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags)
{
    ui.setupUi(this);
    ui.QD3DWidget->resize(QSize(400, 300));
    ui.QD3DWidget->setAttribute(Qt::WA_PaintOnScreen, true);
 
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(update()));
    timer->start(20);
}
 
WorldEdit::~WorldEdit()
{
 
 
}
 
void WorldEdit::initializeD3D()
{
    HWND hWnd = (HWND)ui.QD3DWidget->winId();
    InitD3D(hWnd);
    m_bInit = true;
}
 
 
void WorldEdit::paintD3D()
{
    Render();
}
 
void WorldEdit::paintEvent(QPaintEvent*)
{
    if(updatesEnabled())
    {
        updateD3D();
    }
}
void WorldEdit::d3dInit()
{
    initializeD3D();
 
}
void WorldEdit::d3dDraw()
{
    if(!initialized())
    {
        d3dInit();
    }
    paintD3D();
}
 
void WorldEdit::updateD3D()
{
    d3dDraw();
}
 
 
 
this is the code
but I see nothing in the window
could anybody tell me what the problem is ?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!