Results 1 to 3 of 3

Thread: To create PDF and function paste() and undo() problem

  1. #1
    Join Date
    May 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default To create PDF and function paste() and undo() problem

    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!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: To create PDF and function paste() and undo() problem

    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.

  3. #3
    Join Date
    May 2013
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: To create PDF and function paste() and undo() problem

    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.

    Qt Code:
    1. void MainWindow::on_actionPaste_triggered()
    2. {
    3.  
    4. ui->lineEdit->paste();
    5. ui->lineEdit_2->paste();
    6. ...
    7. }
    To copy to clipboard, switch view to plain text mode 

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

    Thanks in advance!

Similar Threads

  1. Replies: 1
    Last Post: 27th November 2014, 09:11
  2. QMainWindow: create onStartup-like function [SOLVED]
    By thomaspu in forum Qt Programming
    Replies: 3
    Last Post: 11th October 2012, 14:42
  3. Syncing QTextDocument's undo stack with custom undo stack
    By Dini Selimović in forum Newbie
    Replies: 0
    Last Post: 24th June 2012, 13:11
  4. QTableView,Delegate Cut and paste problem
    By baray98 in forum Qt Programming
    Replies: 0
    Last Post: 27th August 2010, 08:06
  5. how to create a new function
    By tommy in forum Qt Programming
    Replies: 3
    Last Post: 10th November 2007, 17:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.