Hi,
I have successfully made a table where I can add two columns of user specified data, one row at a time. (Please see attachment)
What I am trying to do now is allow the user to delete a row in case they want to change things,
I currently have it so that the same row is deleted every time the "Remove Channel" button is clicked by using the following code
void Loader::removeChannelFromTable()
{
model->removeRows ( 1, 1);
row = row - 1;
}
void Loader::removeChannelFromTable()
{
model->removeRows ( 1, 1);
row = row - 1;
}
To copy to clipboard, switch view to plain text mode
What I would like to do now is let the user select a row (so its highlighted), and then if the "Remove Channel" button is clicked the selected row will removed.
I have made the following connection so that when my table (channelsView) is clicked, a signal gets emitted
QObject::connect(channelsView, SIGNAL(clicked(QModelIndex)),
this, SLOT(clicked(QModelIndex)));
To copy to clipboard, switch view to plain text mode
from here I find I'm not sure what to do next, (or if I am on the right track even?)
Bookmarks