That's still the wrong way to do it, Qt-wise. You should create the tree view instance on the heap, not the stack:I put the declaration of QTreeView into the header file, and it works!!!
Qt Code:
w->setModel(&model); swatch1->setWidget( w ); w->setEnabled(true);To copy to clipboard, switch view to plain text mode
If you need access to the tree widget from outside the methond where you create it, then put the "QTreeView * w;" declaration as a member variable of the class in the header file.
Bookmarks