In the process of studying Qt I ran into a small problem, there is a program "Browser", it is written in the main() function in the book, everything works as it should, I want to write this code into a separate file / class inherited from QSplitter , it does not generate an error, but starts with an empty window. 
code itself:
Splitter::Splitter(QSplitter* parent) : QSplitter(Qt::Horizontal, parent) { QFileSystemModel model; model.setRootPath(QDir::rootPath()); QTreeView* pTreeView = new QTreeView; pTreeView->setModel(&model); QTableView* pTableView = new QTableView; pTableView->setModel(&model); QObject::connect(pTreeView, SIGNAL(clicked(const QModelIndex&)), pTableView, SLOT(setRootIndex(const QModelIndex&))); QObject::connect(pTableView, SIGNAL(activated(const QModelIndex&)), pTreeView, SLOT(setCurrentIndex(const QModelIndex&))); QObject::connect(pTableView, SIGNAL(activated(const QModelIndex&)), pTableView, SLOT(setRootIndex(const QModelIndex&))); addWidget(pTreeView); addWidget(pTableView); resize(600, 400); setWindowTitle("Файловый менеджер"); }