Hello,
The constructor is like this:
Qt Code:
  1. Test::Test(QWidget* parent)
  2. : QWidget(parent)
  3. {
  4. //Model
  5. QDirModel* model = new QDirModel;
  6. QModelIndex parentIndex = model->index(QDir::currentPath());
  7. //text
  8. text = new QTextEdit;
  9. int row = model->rowCount(parentIndex);
  10. int col = model->columnCount(parentIndex);
  11. for(int i(0); i<row; ++i)
  12. for(int j(0); j<col; ++j)
  13. {
  14. QModelIndex index = model->index(i, j, parentIndex);
  15. text->append(model->data(index, Qt::DisplayRole).toString());
  16. }
  17. //view
  18. view = new QTableView;
  19. view->setModel(model);
  20. view->setRootIndex(parentIndex);
  21. //splitter
  22. splitter = new QSplitter(this);
  23. splitter->addWidget(text);
  24. splitter->addWidget(view);
  25. }
To copy to clipboard, switch view to plain text mode 
How can I make sure that the text, view, and splitter will resize automatically to display all the data?
Many thanks in advance.