JediSpam
25th August 2011, 00:19
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 = new QTreeView(groupBox);
treeView_test->setObjectName(QString::fromUtf8("treeView_test"));
treeView_test->setGeometry(QRect(80, 320, 211, 471));
from mainwindow.cpp
treeView_test->setModel(standardModel);
treeView_test->expandAll();
from mainwindow.h
#include "ui_mainwindow.h"
class QTreeView;
I am receiving the following error in mainwindow.cpp (the first location treeView_test is set)
error 2065: 'treeView_test' : undeclared identifier
Why can't mainwindow.cpp see treeView_test from ui_mainwindow.h? any ideas? Thanks!
from ui_mainwindow.h (generated)
treeView_test = new QTreeView(groupBox);
treeView_test->setObjectName(QString::fromUtf8("treeView_test"));
treeView_test->setGeometry(QRect(80, 320, 211, 471));
from mainwindow.cpp
treeView_test->setModel(standardModel);
treeView_test->expandAll();
from mainwindow.h
#include "ui_mainwindow.h"
class QTreeView;
I am receiving the following error in mainwindow.cpp (the first location treeView_test is set)
error 2065: 'treeView_test' : undeclared identifier
Why can't mainwindow.cpp see treeView_test from ui_mainwindow.h? any ideas? Thanks!