Closed samuelfmlourenco closed 1 year ago
Three new functions were implemented in version 1.6: on_lineEditManufacturer_textEdited(), on_lineEditProduct_textEdited() and on_lineEditSerial_textEdited(). These functions actively replace newline characters by spaces, affecting the targeted line edit boxes. The replacement is done on the go, and not after editing.
Here is the implementation of on_lineEditManufacturer_textEdited(), to serve as an example:
// Implemented in version 1.6
void ConfiguratorWindow::on_lineEditManufacturer_textEdited()
{
int curPosition = ui->lineEditManufacturer->cursorPosition();
ui->lineEditManufacturer->setText(ui->lineEditManufacturer->text().replace('\n', ' '));
ui->lineEditManufacturer->setCursorPosition(curPosition);
}
The above line edit boxes accept newline characters if they are pasted from the clipboard. These characters appear as spaces, but are still treated as newline characters. Such characters should be converted to spaces after editing the boxes mentioned in the title, following a WYSIWYG philosophy.