PDA

View Full Version : To create PDF and function paste() and undo() problem



Baviera89
28th May 2013, 15:21
Hello!

The issue of my consult are the followings.

I am working with several lineEdit linked with a SQL data base (I work with SQLite Manager), and I don´t get that the paste button and undo button work correctly. The problem is due to use the function ui->lineEdit->paste(); with each lineEdit, obviusly it pastes in all the lineEdit and my intention is just pasting lonely in the lineEdit where there are the cursos active. The same problema happens when I use the undo function with ui->lineEdit->undo(). I have tested too the functions QLineEdit, QKeySequence, but I don´t find exactly the way which everything works well.

To get a PDF from Qt is my other challenge, with a Word or PDF document as basic document where you can fill out with the differents dates of each lineEdit. I have been looking in Internet about this with a bad solution, because I have just found about printing images.

Any reference to help is also a good answer for me.

Thank you very much for your attention!
Sincerely Yours! :)

ChrisW67
28th May 2013, 22:26
It does exactly what you are asking for. QLineEdit::paste()


Inserts the clipboard's text at the cursor position, deleting any selected text, providing the line edit is not read-only.

If all the text in the line edit is selected then paste() replaces all the text. If no text in the line edit is selected then paste() inserts the text. See also
QLineEdit::deselect(), QLineEdit::selectAll(), QLineEdit::setCursorPosition() etc.

Baviera89
4th June 2013, 14:38
Hello! I write again because unfortunatly I couldn´t do what I wanted. I have been trying with everything but I don't get what I want. I am going to explain a little bit more about, because maybe with more details you might help better.

I have different lineEdit (lineEdit, lineEdit_2 and so on). Then when I want to copy a text from one of them to another one, I have the problem that I just can paste on the lineEdit that I have declared in the void MainWindow at the same time. I would like that the button Paste works for each one of the lineEdit where I put on the cursor.


void MainWindow::on_actionPaste_triggered()
{

ui->lineEdit->paste();
ui->lineEdit_2->paste();
...
}

What I want it is just to paste in the lineEdit where is the cursor. Please, can anybody help me?

Thanks in advance! :)