/* attempt to deal with prototype, bootstrap, jquery conflicts */ /* for dropdown menus */

Jump to content

Image of the Day

Today's #ScreenshotSaturday features Face Your Fears from Turtle Roc ... #virtualrealityshop #mobilevr #vrshop https://t.co/3qhSNAVNOZ
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now

how to display a dx widget in a Qt app?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Silencecraft   Members   

139
Like
0Likes
Like

Posted 05 February 2013 - 11:25 PM

#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 ?


#2 ~Helgon   Members   

361
Like
0Likes
Like

Posted 06 February 2013 - 09:11 AM

I recently had the same problem.

 

This sample helped me perfect

http://jholewinski.org/blog/direct3d-11-with-qt-4/

 

Few days ago I've tried it with Qt5. Some method names and return types changed but beside of this it also should work with Qt5.


Edited by ~Helgon, 06 February 2013 - 09:11 AM.

from time to time i find time





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.