I am currently trying to fill a QTreeView and having some issues with my mainwindow.cpp file seeing the definition of the tree in ui_mainwindow.h. Here are the pieces of code I feel should let this variable be defined:
from ui_mainwindow.h (generated)
treeView_test
->setObjectName
(QString::fromUtf8("treeView_test"));
treeView_test
->setGeometry
(QRect(80,
320,
211,
471));
treeView_test = new QTreeView(groupBox);
treeView_test->setObjectName(QString::fromUtf8("treeView_test"));
treeView_test->setGeometry(QRect(80, 320, 211, 471));
To copy to clipboard, switch view to plain text mode
from mainwindow.cpp
treeView_test->setModel(standardModel);
treeView_test->expandAll();
treeView_test->setModel(standardModel);
treeView_test->expandAll();
To copy to clipboard, switch view to plain text mode
from mainwindow.h
#include "ui_mainwindow.h"
#include "ui_mainwindow.h"
class QTreeView;
To copy to clipboard, switch view to plain text mode
I am receiving the following error in mainwindow.cpp (the first location treeView_test is set)
error 2065: 'treeView_test' : undeclared identifier
error 2065: 'treeView_test' : undeclared identifier
To copy to clipboard, switch view to plain text mode
Why can't mainwindow.cpp see treeView_test from ui_mainwindow.h? any ideas? Thanks!
Bookmarks