Hi All

I am creating an application where on a button click , the "browse to directory" window pops up
I have created the application , but when I initialise the QFileSystemModel, I get error
The code has been given below where the SLOT(FileBrowseWindow()) should be called when we click the browse_button
BUt currently , I am unable to initialise
m_Model = new QFileSystemModel(this); Line 11
while debugging the code goes in QGRAYRASTER.C


Qt Code:
  1. window::window()
  2. {
  3. setAcceptDrops(false);
  4. namelabel = new QLabel("Name",this);
  5. nametext = new QTextEdit(this);
  6. loclabel = new QLabel("Location",this);
  7. locText = new QTextEdit(this);
  8. browse_button = new QPushButton("Browse",this);
  9. ok_button = new QPushButton("Ok",this);
  10. cancel_button = new QPushButton("Cancel",this);
  11. m_Model = new QFileSystemModel(this);
  12.  
  13. //creation of menu
  14. createMenu();
  15.  
  16.  
  17.  
  18.  
  19. //connection: signal & slots
  20. connect(browse_button,SIGNAL(clicked()),this,SLOT(FileBrowseWindow()),Qt::AutoConnection);
  21. connect(cancel_button,SIGNAL(clicked()),this,SLOT(ClearButton()),Qt::AutoConnection);
  22.  
  23. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void window::FileBrowseWindow()
  2. {
  3.  
  4. QTreeView tree;
  5. tree.setModel(m_Model);
  6. m_Model->setRootPath(QString("/home/kamlesh/"));
  7. tree.resize(640,480);
  8. tree.show();
  9. }
To copy to clipboard, switch view to plain text mode