PDA

View Full Version : Name_str was not declared in this scope.....



handsome_94
21st July 2015, 10:46
Hi

I'm a newbee to both c++ and QT.

I'm trying to create a phonebook. So, I've created a MainWindow which opens up a Dialog when Add button is clicked. After this user is supposed to enter strings in two LineEdits. After editing, if the user presses "Ok", then these values should go to "LineWidget" in the mainwindow.

But I'm getting this error upon building the project, which I've shown in the attached picture. I'm also attaching the entire project for your consideration.

So, far I've created the mainwindow as well as the dialog and I'm able to open the dialog from the mainwindow.

Thanks,

Rohit

11290

anda_skoa
21st July 2015, 11:04
Name_str and Number_str are members of the "ui" pointer inside the dialog, they are not visible in MainWindow.

Just add two methods to the Dialog class that return these two values and then call them on "ptr"

Cheers,
_

handsome_94
21st July 2015, 11:41
Thanks!! It worked!! Yay!! ;)