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
}
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
}
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:
void Window::triggerMetaDataUpdate(){ // slot for the signal
metaDataText->setText(MetaData::returnMetaData()); // call to update, which does not update:(
update();
}
void Window::triggerMetaDataUpdate(){ // slot for the signal
metaDataText->setText(MetaData::returnMetaData()); // call to update, which does not update:(
update();
}
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
Bookmarks