Results 1 to 7 of 7

Thread: copy string from text box

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Posts
    18
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default copy string from text box

    how to copy a string from one text box to another textbox?
    there are 2 text boxes, text1 and text2 and an enter button.. on pressing enter button contents from text1 widget should get transferred to text2..
    only the function to copy from text1 to text2 is required..
    Pls check the following code is correct
    Qt Code:
    1. void update()
    2. {
    3. QString str;
    4. str=text1->toPlainText();
    5. text2->setText(str);
    6. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 26th July 2006 at 12:42. Reason: changed [ quote ] to [ code ]

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02
  3. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  4. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.