Подскажите в чем баг???
C++ (Qt)
connect(treeview,SIGNAL(clicked(QModelIndex)),this,SLOT(clickedTreeView(QModelIndex)));
...
void MainWindow::clickedTreeView(QModelIndex index)
{
currentModelIndex = new QModelIndex;
currentModelIndex = &index;
currentElement = reinterpret_cast<CommonElement*>(currentModelIndex->internalPointer());
CommonElement *element = reinterpret_cast<CommonElement*>(currentModelIndex->internalPointer());
listmodel->setRoot(element);
setPathLabel(element);
}
void MainWindow::appendElement()
{
if((currentModelIndex != NULL) && currentModelIndex->isValid())
{
qDebug()<<reinterpret_cast<CommonElement*>(currentModelIndex->internalPointer()); //вылетает на этой строчке пишет Ошибка с кодом 255
CommonElement *element = reinterpret_cast<CommonElement*>(currentModelIndex->internalPointer());
element->appendChild();
Q_EMIT refreshTreeModel(root);
Q_EMIT refreshListModel(base);
delete currentModelIndex;
}
qDebug()<<"Error";
}