Hello friends,
i´am nearly ready with my treeview. To expand the child i must double click on the parent.
But i want expand it by one click so i implement this
privat slots:
privat slots:
void expand(const QModelIndex & index);
To copy to clipboard, switch view to plain text mode
in my mainwindow i add this code:
connect(qtv,
SIGNAL(clicked
( const QModelIndex & index
)),
connect(qtv, SIGNAL(clicked( const QModelIndex & index )),
this, SLOT(expand(const QModelIndex & index)));
To copy to clipboard, switch view to plain text mode
and after all the implementation:
{
if ( index.isValid())
{
qtv->expand(index);
}
}
void MainWindow::expand(const QModelIndex & index)
{
if ( index.isValid())
{
qtv->expand(index);
}
}
To copy to clipboard, switch view to plain text mode
But nothing happens. I must always doubleclick the parent item to expand the child.
Have anybody an idea what i make wrong??
Bookmarks