I have a custom QWidget class called VideoWidget
which I used to populate my QListWidget ui->myList
. Doubleclicking on any item of the list should give me its VideoWidget
.
connect(ui->myList,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(playClip(QModelIndex)));
void MainWindow::playClip(QModelIndex index){
QListWidgetItem* item = ui->myList->itemAt(0,index.row());
VideoWidget widget = <dynamic_cast>(VideoWidget*)( ui->myList->itemWidget(item) );
cout << "custom widget data" << widget.getMyData() << endl;
}
It won't let me compile the line VideoWidget widget = <dynamic_cast>(VideoWidget*)( ui->myList->itemWidget(item) );
. I'm not sure what I am missing here.