I am not trying to spam here just trying to be more specific about the issue of Qt mouse pointer not being available for PowerVR. So I hope someone will have a answer to my question.
Qt PowerVR driver needs to be compiled with QT_NO_QWS_CURSOR which stops usage of mouse but still leaves room for touch screens.
I just want to know why this is needed is it because of a hardware limitation or is it just a incomplete driver.
Thank you very much for assistanse well in advance.
I've never tried that driver, I just saw the code. I suppose that is only used for performance reasons. Placing a pointer requires Qt to do its own software compositing over hardware accelerated OpenGL graphics, reducing performance.
It is possible that simply omitting that definition your pointer appears, or anyway making it appear requires only to instantiate it. Consider anyway that if simple software cursor is used, it may not be good when placed over OpenGL surfaces. You might need an implementation using platform specific structures which you might have or might not. Sorry if I can't be of more help.
Related
I'm trying to make an 'fps' camera in OpenGL using Qt. I'm able to move the mouse and rotate the camera accordingly, the only problem I'm having is that I have to click and drag in order for it to happen (the mouseMoveEvent is only called when the mouse is being pressed). Now I've been searching around all day, and there is a lot of conflicting and outdated information about OpenGL on the internet. My question is really quite simple, does the QOpenGLWidget have some functionality similar to glutPassiveMotionFunc, or do I have to install the glut library to get this functionality? Other suggestions to get this functionality (other, better documented libraries for example) are also welcome. In case I have to install the glut library, it would also be amazing if someone would have documented a proper way of doing this, because I seem to find a million different ways, all equally hard to understand.
By default, Qt doesn't handle simple mouse move events. It has to be turned on via the mouseTracking property:
yourOpenGLWidget->setMouseTracking(true);
I am working with QT development. I am using QT 3D engine to render 3D view from pointer cloud, but it is very slow, bad performance. Can anyone suggest a good one working with QT for high performance? Orge3D or Irrlicht or something else. Thanks
I don't think that integration of 3rd party 3D engine would be easier for you than fixing the code you already have. If all you need is drawing those point clouds then think about your code from the GPU standpoint - do you upload all your points to the GPU before drawing? Do you draw everything in one batch? Is it animated or static? Can you simplify your shaders and/or blending settings? etc...
If you REALLY need a full blown engine you can go with anything written in C++ as Dmitry said (well, not only in C++ but that's easier). But bear in mind that you'll need to learn engine-specific API and you'll need to do many things in some specific way. You may also encounter bugs in your chosen engine, that you'll need to fix or work around. Besides all of this you'll add few MB or more of additional dll's, which make your project bigger and slower to load.
If you still want to have 3rd party engine integrated here are few links you could start from. Few for Ogre:
http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Integrating+Ogre+into+QT5
http://www.ogre3d.org/tikiwiki/QtOgre
http://www.ogre3d.org/forums/viewtopic.php?p=515314
I've used QtOgre once but it was few years ago, with 4.x Qt, I'm not sure how does it work with Qt5.
If you need a broader view here's a Qt page about possible integrations:
https://wiki.qt.io/Using_3D_engines_with_Qt
I've just started learning Qt recently, finding QML quite interesting for implementing UI component. Before the project really kick off, I've got some questions:
For a fresh start project, should I just use QML? Does QML be designed for replacing QWidget?)
If I go with QML, is there anything else must be implemented with C++? Or better implemented with C++ for better performance? (I know some customized UI components can be integrated through plugin) What's the relationship between QML and C++ widget?
As for performance or rendering issue, does QML better than native C++ widget?
When you start a question with 'Should I use', it is quite a good hint that SO might not be the right place to ask it. Even more when there are only answers, which start with 'It depends on...'.
QML is not designed to replace QWidget. It is a different technique. Which one to use, depends on your requirements.
Whether or not you must implement additional stuff in C++ depends on your project. Some things are easier in C++, others in QML. And some stuff is not possible in QML at all.
There is no relationship between QML and C++ widgets.
And the performance of QML is in most cases more than sufficient. In almost every case QML is used to create user interfaces. I doubt that there are many cases where clicking a button or opening a dropbox folder is performance critical.
I had a chance to put this question to a few Qt experts at the World Summit today and the general take was that because QML component rendering can be done through hardware acceleration that it is preferred for apps requiring high performance graphics, eg automotive dashboards. OTOH widgets seem to be used for desktop applications. Another consideration is that while widgets can be styled using Qss (Qt's version of Css), QML components cannot.
In QML based applications computationally intensive functions are generally written in C++.
HTH,
Eric G
I have enabled qt+OpenGl+SimpleGl on one of the ARM platform and was able to run opengl example programs.
I also has a qt+Webkit, which is working with a graphic plugin.
I wanted to use simpleGl context for every thing, instead of using the normal graphic screen. So, when I try to run Qt+Webkit with simpleGl, I just get a blank screen.
Does QT support this? If so how can we make it?
Yes, this is correct. OpenGL draws directly to the framebuffer. The simplegl driver doesn't handle what is drawn using the raster paint engine of the QWS, so you may see only black.
Using simplegl for "everything" means you want everything to be drawn using OpenGL in your EGL full-screen window? This is possible under some assumptions. You have to write all your applications to be rendered using the Qt OpenGL paint engine (using the opengl graphics system is not supported under Qt/E). This is possible also for QtWebKit, I'm doing it now. Note that this does not mean that everything is rendered using hardware acceleration. You'll have to write your applications "the right way" to get all actually hardware accelerated. Consider that you'll have to handle the mouse pointer some other way in this case.
The other way is to just modify the simplegl driver to allow for the use of Qt applications using the raster paint engine. This is possible as well with some limitations. Qt can use blit to place its own windows over OpenGL. Look for the framebuffer driver inside the Qt source tree to know how to do this. You can then have common Qt applications and OpenGL Qt applications some way. I'm doing this as well. Not everything can be done anyway.
EDIT: I'm sure you already did, but in case, give this http://doc.qt.io/qt-4.8/qt-embeddedlinux-opengl.html much attention.
Unfortunately I don't know anything about SimpleGL, but I do know that there is a way to render a standard Qt widget in a QGLWidget. Maybe have a look at this Qt Quarterly which I think is somewhat related to your question:
http://doc.qt.nokia.com/qq/qq26-openglcanvas.html
Amazingly, i switched a QWidget to be a QGLWidget and now my QPainter::drawImage calls are 5x faster. I changed nothing else, except the widget type. How does that make QPainter calls perform better? I'm glad it works, but i just do not understand how. Any ideas?
Thanks.
The QGLWidget uses the OpenGL implementation you have available on your system, which may be hardware accelerated. It depends on your system. Qt widgets can be rendered using different QPaintEngine's.
You can even try to change the entire graphics system to use OpenGL by trying to run an application with the parameter -graphicssystem. This cannot be done currently in Qt for Linux Embedded. You can try the difference running the animatedtiles example for instance.
Note that this doesn't necessarily mean performance will be better than with the raster painter. It depends on the OpenGL implementation of the system, if it is only software, performance may be even worst.
It uses OpenGL for rendering its content.
If it's using OpenGL, it's probably also using hardware acceleration