Hello Community,
Iam all new to Qt and I’m trying to create a nice AsciiDoc Editor.
It should have an StructureBrowser.
So I created the class AsciiDocDocument, inherited from QAbstractItemModel.
On my Editorwindow (inherited from QMainWindow) i’ve got the following item:
QTreeView *treeView;
Now I want to load the Model into my View:
AsciiDocDocument model(data);
treeView = new QTreeView(this);
treeView->setModel(&model);
layout->addWidget(treeView);
But there is only a empty TreeView visible.
If I do the instructions above in main.cpp:main(), before creating the Window, it works fine.
Can somebody tell me what Iam doing wrong ?
Thank you very much.
↧