You do not need to call either repaint() or update() in your example. Calling either function is unusual in a generic Qt program.
The problem is that modify() is never called. You have connected the clicked() signal to the line edit's modify() slot... except it does not have one. The modify() function (is it declared a slot?) is a member of the Window class not the QLineEdit class. You should be seeing a warning message in the application output at run time because the connection cannot be made.
connect(acep, SIGNAL(clicked()), this, SLOT(modify()));
// or
connect(acep, SIGNAL(clicked()), SLOT(modify()));
connect(acep, SIGNAL(clicked()), this, SLOT(modify()));
// or
connect(acep, SIGNAL(clicked()), SLOT(modify()));
To copy to clipboard, switch view to plain text mode
The repaint() call immediately redraws the widget it is called on. The update() call schedules a repaint() to occur some (short) time in the future when the program next returns to the event loop. Multiple calls to update() are generally merged into a single repaint of the widget at the appropriate time.
Bookmarks