Hello,
The constructor is like this:
	
	{
  //Model
  //text
  int row = model->rowCount(parentIndex);
  int col = model->columnCount(parentIndex);
  for(int i(0); i<row; ++i)
    for(int j(0); j<col; ++j)
    {
      text->append(model->data(index, Qt::DisplayRole).toString());
    }
  //view
  view->setModel(model);
  view->setRootIndex(parentIndex);
  //splitter
  splitter->addWidget(text);
  splitter->addWidget(view);
}
        Test::Test(QWidget* parent)
  : QWidget(parent)
{
  //Model
  QDirModel* model = new QDirModel;
  QModelIndex parentIndex = model->index(QDir::currentPath());
  //text
  text = new QTextEdit;  
  int row = model->rowCount(parentIndex);
  int col = model->columnCount(parentIndex);
  for(int i(0); i<row; ++i)
    for(int j(0); j<col; ++j)
    {
      QModelIndex index = model->index(i, j, parentIndex);
      text->append(model->data(index, Qt::DisplayRole).toString());
    }
  //view
  view = new QTableView;
  view->setModel(model);
  view->setRootIndex(parentIndex);
  //splitter
  splitter = new QSplitter(this);
  splitter->addWidget(text);
  splitter->addWidget(view);
}
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.
				
			
Bookmarks