
Originally Posted by
jyoti
can u further tell how to remove item from list widget.....on clicking of pushbutton
In the same way, just create a custom slot connected to the button's clicked() signal and do the task by hand:
connect(ui.someButton, SIGNAL(clicked()), this, SLOT(deleteItems()));
void MyForm::deleteItems()
{
qDeleteAll(ui.listWidget->selectedItems());
}
connect(ui.someButton, SIGNAL(clicked()), this, SLOT(deleteItems()));
void MyForm::deleteItems()
{
qDeleteAll(ui.listWidget->selectedItems());
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
jyoti
n one thing more in previous query...when we click the pushbutton then line edit text item inserted in list as well as line_edit should be clear n ready to get the next item (i.e insertion for next item)......
QLineEdit::clear()
ui.lineEdit->clear();
ui.lineEdit->clear();
To copy to clipboard, switch view to plain text mode
Bookmarks