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
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