Results 1 to 4 of 4

Thread: updating text in QTextEdit [SOLVED]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Cool updating text in QTextEdit [SOLVED]

    Hi
    I want to update the text in a QTextEdit upon the occurance of a specific event. Following is the snapshot of my application

    Qt Code:
    1. QTextEdit *metaDataText; // this is the text box to be updated
    2.  
    3. Window::Window(QWidget *parent) : QWidget(parent) { // constructor for the main window class
    4. metaDataText = new QTextEdit; // initializing the text box
    5. metaDataText->setText(MetaData::returnMetaData()); // puttin in initial values
    6. }
    To copy to clipboard, switch view to plain text mode 

    I want to display when the text in the MetaData class changes.
    So when the text changes in the MetaData class, a signal (triggerMetaDataUpdate) is issued, for which a slot is present in the window class as given below:

    Qt Code:
    1. void Window::triggerMetaDataUpdate(){ // slot for the signal
    2. metaDataText->setText(MetaData::returnMetaData()); // call to update, which does not update:(
    3. update();
    4. }
    To copy to clipboard, switch view to plain text mode 

    but this thing does not update the text in the QTextEdit.

    can someone please help me do this correctly?

    thanks
    Last edited by me_here_me; 25th September 2007 at 15:03.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. How to get text of last line only in QTextEdit?
    By rajesh in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2006, 13:37
  4. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  5. coordinates of selected text in QTextEdit
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2006, 17:22

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.