Hi guys,
I am using old version of Qt which comes with the Friendly arm device for embedded development.
It consists of Qtopia 2.2.0 with Qt2 designer.
I prepared a small application for testing using a QListView. I drew ListView widget on my form which i named ListView and named ny UI file as myapp_base.ui.
In my header file i wrote-
Code:
#ifndef MYAPP_H #define MYAPP_H #include "myapp_base.h" class MyApp : public MyAppBase { public: ~MyApp(); }
My implementation file is following-
Code:
#include "myapp.h" #include <qlistview.h> MyAppBase(parent,name,fl) { QListViewItem *newItem; newItem->setText(0,"newItem"); ListView->insertItem(newItem); } MyApp::~MyApp() { }
And my main file is-
Code:
#include "myapp.h" #include <qapplication.h> int main(int argc, char *argv[]) { MyApp *obj; obj->show(); return app.exec(); }
My code gets compiled successfully but gives a runtime segmentation fault. What is the problem??