Jacek,
Thanks; things are starting to look good:

Qt Code:
  1. Test::Test(QWidget* parent)
  2. : QWidget(parent)
  3. {
  4. QHBoxLayout* mainLayout = new QHBoxLayout(this);
  5. //Model
  6. QDirModel* model = new QDirModel;
  7. QModelIndex parentIndex = model->index(QDir::currentPath());
  8. //text
  9. QTextEdit* text;
  10. text = new QTextEdit;
  11. int row = model->rowCount(parentIndex);
  12. int col = model->columnCount(parentIndex);
  13. for(int i(0); i<row; ++i)
  14. for(int j(0); j<col; ++j)
  15. {
  16. QModelIndex index = model->index(i, j, parentIndex);
  17. text->append(model->data(index, Qt::DisplayRole).toString());
  18. }
  19. //view
  20. view->setModel(model);
  21. view->setRootIndex(parentIndex);
  22. //splitter
  23. QSplitter* splitter = new QSplitter;
  24. mainLayout->addWidget(splitter);
  25. splitter->addWidget(text);
  26. splitter->addWidget(view);
  27. QList<int> list;
  28. list << 1000 << 1000;
  29. splitter->setSizes(list);
  30. }
To copy to clipboard, switch view to plain text mode 
But the "text" and "view" boxes of the splitter are of the same size. I would like their sizes to adjust automatically to the amount of data that needs to be displayed so that scroll bars would not be needed. I tried to play with the setSizes function but without luck.