I have implemented a QTreeview with QAbstractItemModel how can i be notified if i click on the tree view item with left mouse click.Do we have any function like OnLButtonDown() avalible for the tree view.
WavefrontRenderer::WavefrontRenderer(TreeModel* model , QWidget *parent) :
QMainWindow(parent)
{
setupUi(this);
treeView->setModel(model);
treeView->setDragEnabled(true);
treeView->setAcceptDrops(true);
treeView->installEventFilter(this);
connect(pushButtonAddGroup, SIGNAL(clicked()), this, SLOT(insertRow()));
connect(pushButtonAddChild , SIGNAL(clicked()), this,
SLOT(insertChild()));
connect(pushButtonDeleteGroup , SIGNAL(clicked()), this,
SLOT(removeRow()));
connect( ButtonSphere, SIGNAL(clicked()), this, SLOT(AddSphere()));
connect(treeView , SIGNAL(clicked()), this, SLOT(message()));
}
I tried to connect the treeview to clicked slot but this did not work for me.
Since i am new to qt i am not sure if we connect the treeview same way as we connect buttons to the clicked slots.
clicked
sginal. – thuga