hi
i can close the application from the main function using widget object
like below; my application having 3 files main,widget.cpp,widget.h below is main.cpp
Qt Code:
  1. QApplication a(argc, argv);
  2. Widget *w=new Widget();
  3. w->close();
  4. w->show();
  5. return a.exec();
To copy to clipboard, switch view to plain text mode 
but im unable to close the application from the widget.cpp like below
Qt Code:
  1. void Widget::read_db_settings()
  2. {
  3. QFile file("ncssettingss.ini");
  4. if(file.open(QFile::ReadOnly))
  5. {
  6. this->close();
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 
ie if the file is not fount then close the application ...
can any help me how to do this...
thanks in advance...