Solved How to update promoted widget of new window when show it?
-
I can't access this private ui ,like this
newWindow->ui->widget ->update(); newWindow->show();
What can i do?
Edit: Added code tags -- @Wieland
-
Hi @beqa
What about adding showEvent function on your promoted widget source ?
-
hi.
thanks, but this showEvent funthion call while i call newWindow->show()? -
@beqa
Yes it is.
You cannot acces newwindows ui directly so other option is to add
access function for what you want to do to the Widget from outsidevoid newWindow::setSomeText( ... ) {
ui->widget->setText(..)
}and then
newWindow->setSomeText("whatever");
newWindow->show();That helps keep the code going too spaghetti and all the outside needs to know about
newWindow is what it can set or get for others. The outside should not know anything from ui::
as it makes better code. -
@beqa
Yes, i think that it is called when you call newWidnow->show() just before rendering the widget on your screenNon-spontaneous show events are sent to widgets immediately before they are shown
-
thanks all of you
-
You are welcome =)