well, I thought the remove operation is being carry out directly on the text object of the lineEdit, but i get it khnow, the text() function returns the text value, it is not giving the acces directly.
So it has to be done this way:
void MainWindow::deleteClicked()
{
if(ui->lineEdit->text().length() == 1) ui->lineEdit->setText("0");
QString string_line
= ui
->lineEdit
->text
();
string_line.remove(string_line.length()-1, 1);
ui->lineEdit->setText(string_line);
}
void MainWindow::deleteClicked()
{
if(ui->lineEdit->text().length() == 1) ui->lineEdit->setText("0");
QString string_line = ui->lineEdit->text();
string_line.remove(string_line.length()-1, 1);
ui->lineEdit->setText(string_line);
}
To copy to clipboard, switch view to plain text mode
So we have to take 1 from the string length;
Bookmarks