TaskItem is a QWidget, that I'm setting on the QListWidget using
list->setItemWidget(list->item(0), new TaskItem);
list->setItemWidget(list->item(0), new TaskItem);
To copy to clipboard, switch view to plain text mode
I don't know HOW to write the connect BECAUSE I don't know, how to point out which list item sent the signal...
Added after 16 minutes:
I think I am a little bit closer to the truth:
When the pushButton in taskitem get's clicked, it emits a signal
deleteTaskItem();
deleteTaskItem();
To copy to clipboard, switch view to plain text mode
I can catch it in the class where My list is by using:
connect(item, SIGNAL(deleteTaskItem()), this, SLOT(deleteTaskItem()));
connect(item, SIGNAL(deleteTaskItem()), this, SLOT(deleteTaskItem()));
To copy to clipboard, switch view to plain text mode
Then in the slot I have to use something like QObject* QObject::sender();
But I can't figure out what to do with it...
Added after 11 minutes:
I tried to Write in the slot something like this:
void TaskMain::deleteTaskItem()
{
list->removeItemWidget(sender());
}
void TaskMain::deleteTaskItem()
{
list->removeItemWidget(sender());
}
To copy to clipboard, switch view to plain text mode
But I need to give as a parameter QListWidgetItem*, and not a QObject*
Bookmarks