Qt 6.11 is out! See what's new in the release
blog
Accesing mainWindow variable in a Dialog Window
General and Desktop
6
Posts
5
Posters
3.9k
Views
1
Watching
-
I am a newbie in qt and c++ and i took the input filename in the MainWindow,but i wanted to access the filename in the dialog Window as well . I am having problems in doing so.I have included the MainWindow header file.
I tried using
@ui->lineEdit->insert(parent->fileName);@But i get a error saying:
Class QWidget has no member named fileName.
So how can i access the fileName.? -
bq. tanny007 wrote: i took the input filename in the MainWindow,but i wanted to access the filename in the dialog Window as well
How did you get the file name? If it isn't a property of Parent (that too a public property), then I guess you might not access as you did
@ui->lineEdit->insert(parent->fileName);@Easiest way would be to pass the file name to Dialog
~veeraps