Page 1 of 1
Widget for embedding into Qt
Posted: Thu Sep 24, 2009 8:51 am
by egrath
Hello,
for a project of mine i needed a fully fledged widget to integrate Irrlicht into a Qt Application. Currently the Widget features the following
- Compiles out of the Box with Qt 4.6 TP1 and Irrlicht SVN
- Emits signals for: Mouse Press/Release, Mouse move, Keyboard Press/Release (On Linux, disables the nasty X11 Autorepeat which generates Key press/release events on it's own)
- Supports all Irrlicht supported rendering Subsystems
- Resizes correctly
- Fully documented
Download here:
http://uploaded.to/file/di5cq8 (or from my blog)
Egon
Posted: Tue Sep 29, 2009 3:43 pm
by CuteAlien
Hm, I need to find some small tool where I can use QT to test this some day :-) I want to try out Qt for so long already and never find time...
Under which license can it be used?
interactive camera integration
Posted: Wed Oct 28, 2009 1:12 pm
by Nelson
Hi, I looking for a way to use the Maya (or FPS) camera from your Qt integration. What is missing?
Posted: Fri Oct 30, 2009 8:37 am
by Nelson
Ok, I found something. Implementing this event handler I can move my Maya camera.
However, the movements seem a bit buggy, it's just as if Irricht kept memorized the previews mouse position between two actions.
Code: Select all
void QIrrlichtWidget::mouseMoveEvent( QMouseEvent* event )
{
irr::SEvent irrEvent;
irrEvent.EventType = irr::EET_MOUSE_INPUT_EVENT;
if ( device != 0 )
{
irrEvent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
irrEvent.MouseInput.X = event->x();
irrEvent.MouseInput.Y = event->y();
irrEvent.MouseInput.Wheel = 0.0f; // Zero is better than undefined
if(device->postEventFromUser( irrEvent ))
event->accept();
}
}
Posted: Thu Nov 05, 2009 3:58 pm
by Nelson
I'm going into lot of trouble with qt and IrrLicht integration.
Since Irrlicht renders in an external window, Irrlicht disables resizing calls to CIrrDeviceWin32. But when using a mouse camera like Maya, it gets the mouse position from the CIrrDeviceWin32 CursorControl. When I resize the window, the mouse position is not updated correctly.
Is that a correct behaviour? is there a way to handle a Maya cam from an external window manager?
Posted: Thu Nov 05, 2009 5:03 pm
by hybrid
That's a bug that was recently fixed. Should be in 1.6.1 once it's out, but you can also use SVN versions to get the fix.
Posted: Fri Nov 06, 2009 2:27 pm
by Nelson
Ok thanx for the info. Ive made my own qt camera controller for my current project, will test the fix in the future version
Posted: Fri Nov 27, 2009 2:04 am
by jcfalcone
i'm having some problems to add the widget in some ui.
I always get this error
QIrrlichtWidget::ctor()
The program has unexpectedly finished.
/home/jcfalcone/workspace/Projetos/Jogos/3d_Engine/3d_Engine exited with code 0
And this is my code
Code: Select all
QIrrlichtWidget *irrWidget = new QIrrlichtWidget(this);
ui->gridLayout->addWidget(irrWidget, 0, 0, 1, 1);
Any Idea?[/code]
Posted: Wed Dec 30, 2009 4:42 pm
by Virion
did you put irrlicht dll file to your directory?
Posted: Thu May 20, 2010 11:45 am
by fabietto
I'm still stuck at the first step... downloading the software!

Your blog seems having some troubles and I can't download from the other link as well...
Posted: Wed Jun 23, 2010 12:23 am
by gingerheadman
Edit: Even though the link on the first post was broken I was able to find a copy here:
http://egonrath.eg.funpic.de/wordpress/ ... 17.tar.bz2
Posted: Sat Jun 26, 2010 5:07 pm
by Pazystamo
HI,
I am using unubtu and trying to compile this example with irrliht 1.7.1 , but i get errors: QIrrlichtWidget.cpp|188|error: cast from ‘void*’ to ‘irr::u32’ loses precision| line is :
Code: Select all
qDebug() << " native window ID = " << ( irr::u32 ) createParams.WindowId;
if i remove ( irr::u32 ) then in Application.cpp shows error on "Application::Application()"|42|undefined reference to `vtable for Application'|
Posted: Mon Jun 28, 2010 11:18 am
by gingerheadman
Pazystamo wrote:HI,
I am using unubtu and trying to compile this example with irrliht 1.7.1 , but i get errors: QIrrlichtWidget.cpp|188|error: cast from ‘void*’ to ‘irr::u32’ loses precision| line is :
Code: Select all
qDebug() << " native window ID = " << ( irr::u32 ) createParams.WindowId;
if i remove ( irr::u32 ) then in Application.cpp shows error on "Application::Application()"|42|undefined reference to `vtable for Application'|
I had the same error (also using Ubuntu btw). I just commented out the (irr::u32) and it compiles properly. I know just removing bits of code that generate errors generally isn't a good idea but it seemed to work for me
Code: Select all
qDebug() << " native window ID = " << /*( irr::u32 )*/ createParams.WindowId;
Posted: Mon Jun 28, 2010 11:23 am
by hybrid
The WindowID has changed to a platform dependant struct, which you have to cast to specifically. The value would be completely useless otherwise.