11-02-2012 07:30 PM - edited 11-02-2012 07:55 PM
Today, I just realize that pure Qt is completly working on QNX Momentics IDE.... So, If you want to make an application without cascade UI and draw all by yourself , ( for games it's a good idea) , use QGraphicsView/QGraphicsScene system.
Just create a cascade project , and replace the main contain by pure Qt code...
11-02-2012 07:57 PM
Now, use the standard QML ... And it works !! Seriously, I was beleiving that Qt gui module was disable.. But no
02-06-2013 12:38 AM
I just tried the following code:
#include <QtGui/QApplication>
#include<QGraphicsView>
#include<QGraphicsScene>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsView * view;
QGraphicsScene * scene;
view->setScene(scene);
view->showFullScreen();
return a.exec();
}
The app builds and compiles but on the Dev Alpha B device, does not launch. Any clues?
02-06-2013 03:07 AM
you did not initialize the view and the scene, so you are trying to access Null-Pointers
QGraphicsView* view; -> QGraphicsView * view = new QGraphicsView()
02-06-2013 03:14 AM - edited 02-06-2013 03:16 AM
try this in ypour main-function
QApplicationapp(argc, argv);
// localization support
QTranslatortranslator;
QString locale_string = QLocale().name();
QString filename = QString( "YOUR_APP_NAME_%1" ).arg( locale_string );
if (translator.load(filename, "app/native/qm")) {
app.installTranslator( &translator );
}
QGraphicsView * view = newQGraphicsView();
QGraphicsScene * scene = newQGraphicsScene();
view->setScene(scene);
view->showFullScreen();
QLabel* test = newQLabel();
test->setText("Hello World");
scene->addWidget(test);
app.exec();
includes are:
#include<QtGui/QApplication>
#include<QtGui/QLabel>
#include<QLocale>
#include<QTranslator>
#include<Qt/qdeclarativedebug.h>