PDA

View Full Version : updating text in QTextEdit [SOLVED]



me_here_me
25th September 2007, 14:56
Hi
I want to update the text in a QTextEdit upon the occurance of a specific event. Following is the snapshot of my application



QTextEdit *metaDataText; // this is the text box to be updated

Window::Window(QWidget *parent) : QWidget(parent) { // constructor for the main window class
metaDataText = new QTextEdit; // initializing the text box
metaDataText->setText(MetaData::returnMetaData()); // puttin in initial values
}


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:



void Window::triggerMetaDataUpdate(){ // slot for the signal
metaDataText->setText(MetaData::returnMetaData()); // call to update, which does not update:(
update();
}


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

can someone please help me do this correctly?

thanks

wysota
25th September 2007, 14:57
Can you verify that the slot indeed gets called and that MetaData::returnMetaData() returns changed data?

me_here_me
25th September 2007, 15:00
its solved. sorry for bothering.


there was some error in receiving the signal.

regards

me_here_me
25th September 2007, 15:01
thanks wysota


you are right on THE TARGET.

this was the matter that took me soo long :(

thanks for help