Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

QTreeView in QMainWindow

$
0
0
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.

Viewing all articles
Browse latest Browse all 18427

Trending Articles