Hi
I am facing a strange issue in the QDIRMODEL
I have written the below code on the SLOT function for the button SIGNAL( clicked), but when I run the code , the tree doesnt show and when I debug the code
QDirModel model
goes into qgrayraster

Qt Code:
  1. QDirModel model;
  2. QTreeView tree;
  3. tree.setModel(model);
  4. tree.setRootIndex(model->index(QDir::homePath()));
  5. tree.setColumnHidden( 1, true );
  6. tree.setColumnHidden( 2, true );
  7. tree.setColumnHidden( 3, true );
  8. tree.setWindowTitle(QObject::tr("Dir View:")+QDir::homePath());
  9. tree.resize(640, 480);
  10. tree.show();
To copy to clipboard, switch view to plain text mode 

May I know where am I going wrong