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)

Qt Code:
  1. treeView_test = new QTreeView(groupBox);
  2. treeView_test->setObjectName(QString::fromUtf8("treeView_test"));
  3. treeView_test->setGeometry(QRect(80, 320, 211, 471));
To copy to clipboard, switch view to plain text mode 
from mainwindow.cpp

Qt Code:
  1. treeView_test->setModel(standardModel);
  2. treeView_test->expandAll();
To copy to clipboard, switch view to plain text mode 
from mainwindow.h

Qt Code:
  1. #include "ui_mainwindow.h"
  2.  
  3. 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)
Qt Code:
  1. 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!