QtOgre Application Framework - Now using Qt 4.5

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

JonnyJP wrote:Right, I've stripped out all the stuff I don't need and now have an OgreWidget as the central widget on a form with a dockable widget. The mouse and keyboard events seem to be working fine. However, the Ogre view is flickering like crazy!
Hi, when you were stripping stuff out is it possible you removed this function:

Code: Select all

...
...

  QPaintEngine *OgreWidget:: paintEngine() const
  {
    return 0;
  }

...
...
It is very important that you leave that function in, as without it the flickering occurs. Let me know if that solves your problem.
JonnyJP wrote:Does this framework and QT work as well if I have Ogre running in a browser?
I don't think so - Qt is a framework for standalone applications. To my knowledge there is no way to run Qt applications in a browser.
downstairs
Gnoblar
Posts: 4
Joined: Mon Jan 25, 2010 9:27 am

Re: QtOgre Application Framework - Now using Qt 4.5

Post by downstairs »

this is a great start point!! :lol:
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

I'm glad you like it!

For anyone else following this thread, I'm aware that I'm now slightly out of data as Qt 4.6 is out and Ogre 1.7 is just around the corner. I will update for the latest version as soon as I can (if any update is needed) but it might not be for a couple of months as I have another project on a tight deadline, and don't want to disrupt my system too much.
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Just a quick note to say that I have modified the logging system so that you can now safely log messages from other threads. I know a few people were having problems with this and it was likely to become more of an issue with the improved threading support in Ogre 1.7. Hopefully it works smoothly now though it's not thouroughly tested...
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: QtOgre Application Framework - Now using Qt 4.5

Post by dermont »

PolyVox wrote:Just a quick note to say that I have modified the logging system so that you can now safely log messages from other threads. I know a few people were having problems with this and it was likely to become more of an issue with the improved threading support in Ogre 1.7. Hopefully it works smoothly now though it's not thouroughly tested...
I think that your Q_DECLARE_METATYPE() macro for LogLevel has to be declared outside the QtOgre namespace, other than that it appears to work OK.

Code: Select all

Index: LogLevel.h
===================================================================
--- LogLevel.h	(revision 2852)
+++ LogLevel.h	(working copy)
@@ -16,9 +16,10 @@
 		LL_ERROR = 8192
 	};
 
+}
+
 	//We want to be able to pass log messages across QT
 	//threads, which means making the LogLevel an Qt MetaType.
-	Q_DECLARE_METATYPE(LogLevel)
-}
+	Q_DECLARE_METATYPE(QtOgre::LogLevel)
 
-#endif
\ No newline at end of file
+#endif
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Yep, you are right. Strange that it did seem to work (at least for me) though. But thanks, I have applied the fix.
User avatar
Sslaxx
Greenskin
Posts: 104
Joined: Thu Apr 27, 2006 12:37 pm
Location: Malvern, Worcs., UK
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Sslaxx »

Should there a section for this on your website, PolyVox?
Stuart "Sslaxx" Moore
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Sslaxx wrote:Should there a section for this on your website, PolyVox?
You mean with documentation and stuff? Actually I have been meaning to add some information to the Ogre Wiki about how to build and use the framework. I just haven't quite got around to it yet...
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm
x 8

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Moohasha »

I'm not using the QtOgre Framework, but I am rendering my Ogre scene inside of a Qt widget and I have an issue with flickering. My Ogre scene will occasionally flicker or go blank (as in, the color of the background widget) when the following occur:
  • A new window is drawn (popup menus, dialog, etc...), even if they're not on top of the Ogre widget
  • The application gains/loses focus (such as clicking on a window outside of my Qt app, even if it doesn't over lap my Qt app)
I'm using Qt 4.5.2 and I'm drawing inside of a QFrame, and the only special "options" that I'm setting for the QFrame are:

Code: Select all

setMouseTracking(true);
setLineWidth( style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this) );
setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
Any ideas on how to stop the flicker?
Black holes are where God divided by 0
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

I'm sorry, I don't recall seeing that issue. So either I haven't had it, or at least I haven't noticed and so haven't fixed it. The only flickering issue I've encountered was when moving from Qt 4.4 to 4.5, and it was much more serious than the problem you describe.
User avatar
Sslaxx
Greenskin
Posts: 104
Joined: Thu Apr 27, 2006 12:37 pm
Location: Malvern, Worcs., UK
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Sslaxx »

Moohasha wrote:I'm not using the QtOgre Framework, but I am rendering my Ogre scene inside of a Qt widget and I have an issue with flickering. My Ogre scene will occasionally flicker or go blank (as in, the color of the background widget) when the following occur:
  • A new window is drawn (popup menus, dialog, etc...), even if they're not on top of the Ogre widget
  • The application gains/loses focus (such as clicking on a window outside of my Qt app, even if it doesn't over lap my Qt app)
I'm using Qt 4.5.2 and I'm drawing inside of a QFrame, and the only special "options" that I'm setting for the QFrame are:

Code: Select all

setMouseTracking(true);
setLineWidth( style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this) );
setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
Any ideas on how to stop the flicker?
Didn't someone have the same issue when they inadvertantly removed the paint slot?
Stuart "Sslaxx" Moore
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Sslaxx wrote:Didn't someone have the same issue when they inadvertantly removed the paint slot?
Actually yes, that is possible. I had dismissed it because I found the flickering to be much more severe (it was constant, not just when showing menus or loosing focus), but that is probably because I am constantly sending update events where as Moohasha might just be updating when necessary.

@Moohasha - Make sure you override the paintEvent of your widget and return 0. In my case it is:

Code: Select all

...
...

  QPaintEngine *OgreWidget:: paintEngine() const
  {
    return 0;
  }

...
...
User avatar
Moohasha
Gnoll
Posts: 672
Joined: Fri Dec 07, 2007 7:37 pm
x 8

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Moohasha »

PolyVox wrote:@Moohasha - Make sure you override the paintEvent of your widget and return 0.
That fixed it! Awesome. :D As a note, simply overriding paintEngine() had no affect until I called

Code: Select all

setAttribute(Qt::WA_PaintOnScreen, true);
in my constructor. You're probably doing that in your framework, but I wasn't. Thanks for the help!!
Black holes are where God divided by 0
lwzgemini
Halfling
Posts: 53
Joined: Sat Jan 09, 2010 5:29 am

Re: QtOgre Application Framework - Now using Qt 4.5

Post by lwzgemini »

Hi,

I tired to include the QtOgre framework in my project, first i get it running fine. But after i reinstall the ogre,
it shows following problems:

Couldn't resolve property: radialGradient6084
link XMLID_34_ hasn't been detected!
link XMLID_34_ hasn't been detected!
link XMLID_36_ hasn't been detected!
Couldn't resolve property: linearGradient3409


I don't know why this error shows, any ideas?
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

I get these errors too, and I'm pretty sure I've always got them. Are you sure you didn't get them before? Have you noticed any problems as a result?

[Edit:] In fact, if you look in the third screenshot of this thread you can see the errors: http://www.ogre3d.org/forums/viewtopic.php?f=11&t=45709
scniton
Gnoblar
Posts: 11
Joined: Wed Mar 10, 2010 10:30 pm
x 1

Re: QtOgre Application Framework - Now using Qt 4.5

Post by scniton »

Those errors seem to be coming from the qt svg module, I changed the push button icons to the pngs and the errors disappeared.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by jacmoe »

Don't worry about those svg errors - they are afaik only warnings. You can clean the offending svgs, I guess, but it's harmless.
I cleaned some of Ogitors svg icons and removed most of them, but I don't think it affects performance in any way.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Thanks guys, it sounds like that is the problem. Maybe I will clean the SVG files at some point in the future but it won't be anytime soon. So convert them to .pngs if you want to get around this issue.
sukesh
Gnoblar
Posts: 1
Joined: Fri Mar 26, 2010 1:53 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by sukesh »

Hello QtOgre Gurus,

I am new to 2.5D (considering stereo rendering to be true 3D) programming and was exploring the wrapper/frame work created by PolyVox in Qt for OGRE.

I was able to build the demo and QtOgre dlls (both for release and debug) but for some reason demo.exe crashes after showing initial settings screen for selecting the rendering system and other parameters.

Details of build environment
Qt: 4.6
IDE: QtCreator 1.3
compiler: MinGW gcc 4.4
OGRE : 1.7
Os: Windows XP

I was able to trace where application was getting crashed the crash seems to happen at line 151 of log.cpp when the DemoGameLogic.cpp tries to display log message here is the trace

Code: Select all

   QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::data   qscopedpointer.h   135 0x6a2a2e52   
   qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > >   qglobal.h   2317   0x6a10f1fb   
   QObject::d_func   qobject.h   125   0x6a28e3bc   
   QMetaObject::activate   qobject.cpp   3192   0x6a2112d6   
   QtOgre::Log::_logMessageReceived   moc_Log.cpp   96   0x6d4cf14e   
   QtOgre::Log::logMessage   Log.cpp   151   0x6d4cb5eb   
   QtOgre::DemoGameLogic::initialise   DemoGameLogic.cpp   33   0x00401746   
   QtOgre::Application::initialise   Application.cpp   249   0x6d4c362d   
   QtOgre::Application::exec   Application.cpp   342   0x6d4c3e15   
   qMain   main.cpp   12   0x0040291b   
   WinMain@16   qtmain_win.cpp   131   0x00403542   
   main      0   0x00403268   
I would appreciate if any one can help me or give me pointers on how to solve this issue.

With regards
Sukesh
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

My best guess is that this is a threading related problem. Ogre went through some big threading changes for 1.7, and fairly recently I also made some changes to QtOgre which I hoped would allow log messages to be sent from different threads. But to be honest this is hardly tested as I haven't really used Ogre 1.7.

The first thing you should do is to comment out the following line:

Code: Select all

//emit _logMessageReceived(message, logLevel);
The application should still run so you can verify wherther this was indeed the problem, you just won't get any log output. Next you can try uncommenting the block of code before the one you just commented out. That is, your Log::logMessage() function should now look like this:

Code: Select all

void Log::logMessage(const QString& message, LogLevel logLevel)
{
	mLogModel->append(0, "file", message, logLevel);
	logTable->verticalHeader()->resizeSection(mLogModel->rowCount() - 1, 14);
	logTable->scrollToBottom();
	if(mForceProcessEvents)	{
		qApp->processEvents();
	}

	//emit _logMessageReceived(message, logLevel);
}
This will get your log messages back, but it will crash if you try and send messages from another thread (i.e. it's my old system before I changed it recently).

Please let me know if these changes help, because they will identify threadiing as being the cause. For an proper solution you will have to wait until I have a chance to investigate. But I would be curious - did you build Ogre from source or use the SDK? And if you built from source, do you know which threading library you used (think the options are Boost, POCO, and TBB). You can probably see this from your Ogre CMake file.
RenCheng
Gnoblar
Posts: 16
Joined: Thu Jan 03, 2008 1:42 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by RenCheng »

When I compile the latest source code, there are 3 files missing:
  • Cannot open include file: 'CameraWrapper.h': No such file or directory
    Cannot open include file: 'Keyboard.h': No such file or directory
    Cannot open include file: 'Mouse.h': No such file or directory
Can anybody tell where they are?
Thank you in advance.
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
Posts: 1316
Joined: Tue Nov 21, 2006 11:28 am
Location: Groningen, The Netherlands
x 18
Contact:

Re: QtOgre Application Framework - Now using Qt 4.5

Post by PolyVox »

Sorry, I forgeot to add those to SVN. It's fixed now if you get latest.

That said, the demo of the QtOgreFramework is in a strange state at the moment because I'm currently investigating how to integrate QtScript. If you just want to write you application in C++ then getting an older version from SVN (maybe from one onth ago) might make sense because the demo app simpler. The actual QtOgre library hasn't really changed much.
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

Re: QtOgre Application Framework - Now using Qt 4.5

Post by Brocan »

I don't know if Qt has a web browser as widget, but in case of yes, is it supportted in QtOgre?

Thanks in advance! :D
RenCheng
Gnoblar
Posts: 16
Joined: Thu Jan 03, 2008 1:42 pm

Re: QtOgre Application Framework - Now using Qt 4.5

Post by RenCheng »

PolyVox wrote:Sorry, I forgeot to add those to SVN. It's fixed now if you get latest.

That said, the demo of the QtOgreFramework is in a strange state at the moment because I'm currently investigating how to integrate QtScript. If you just want to write you application in C++ then getting an older version from SVN (maybe from one onth ago) might make sense because the demo app simpler. The actual QtOgre library hasn't really changed much.
Thank you PolyVox. I updated, now all the files are there.
I will try the compiling tomorrow. ( i'm at in the late evening here:) )
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: QtOgre Application Framework - Now using Qt 4.5

Post by dermont »

A couple of trivial issues building on Linux.

Code: Select all

Index: QtOgre/include/LogModel.h
===================================================================
--- QtOgre/include/LogModel.h	(revision 2927)
+++ QtOgre/include/LogModel.h	(working copy)
@@ -1,7 +1,7 @@
 #ifndef QTOGRE_LOGMODEL_H_
 #define QTOGRE_LOGMODEL_H_

-#include "LogLevel.h"
+#include "LogEntry.h"

 #include <QAbstractTableModel>

@@ -37,4 +37,4 @@
 		Log *mLog;
 	};
 }
-#endif
\ No newline at end of file
+#endif
Index: EngineTest/source/EngineTestGameLogic.cpp
===================================================================
--- EngineTest/source/EngineTestGameLogic.cpp	(revision 2927)
+++ EngineTest/source/EngineTestGameLogic.cpp	(working copy)
@@ -16,7 +16,7 @@
 #include <QKeyEvent>
 #include <QMouseEvent>
 #include <QSettings>
-#include <QStringList.h>
+#include <QStringList>
 #include <QMetaObject>

 using namespace QtOgre;
@@ -339,4 +339,4 @@
                      qPrintable(failExtensions.join(", ")), qPrintable(qApp->libraryPaths().join(", ")));
         }
     }
-}
\ No newline at end of file
+}
Post Reply