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-

Qt Code:
  1. #ifndef MYAPP_H
  2. #define MYAPP_H
  3.  
  4. #include "myapp_base.h"
  5.  
  6. class MyApp : public MyAppBase
  7. {
  8. public:
  9. MyApp(QWidget *parent=0,const char *name=0, WFlags fl=0);
  10. ~MyApp();
  11.  
  12. }
To copy to clipboard, switch view to plain text mode 

My implementation file is following-

Qt Code:
  1. #include "myapp.h"
  2. #include <qlistview.h>
  3.  
  4. MyApp::MyApp(QWidget *parent, const char *name,WFlags fl):
  5. MyAppBase(parent,name,fl)
  6. {
  7. QListViewItem *newItem;
  8. newItem->setText(0,"newItem");
  9. ListView->insertItem(newItem);
  10. }
  11.  
  12. MyApp::~MyApp()
  13. {
  14. }
To copy to clipboard, switch view to plain text mode 

And my main file is-

Qt Code:
  1. #include "myapp.h"
  2. #include <qapplication.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication app(argc,argv);
  7. MyApp *obj;
  8. obj->show();
  9.  
  10. return app.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

My code gets compiled successfully but gives a runtime segmentation fault. What is the problem??