[Moved] Document/View application
-
[quote author="CapnMikey" date="1315495836"]That seems to have come from copying and pasting. The definitions are okay in my files.[/quote]
Then please update your previous post to reflect the actual state of your code. -
Line 15 in Information.h should be line 25 in MainWindow.h. Sorry about the mixup.
-
[quote author="CapnMikey" date="1315496093"]Line 15 in Information.h should be line 25 in MainWindow.h. Sorry about the mixup.[/quote]
Please just use the Edit button next to your post to modify it and fix the mixup. -
Okay, the code above has been modified.
Thanks for pointing out the edit button.
-
Your struct is named information, but the definition in mainwindow.h is Information. C++ is case sensitive...
-
I corrected the case error as well (see post above). I still get the same error message.
-
Did you also note the remark I posted above?
[quote author="Andre" date="1315495737"]Oh, and in your MainWindow, you have a pointer to an Information instance, while you do not seem to be creating an instance and trying to assign to it as if it is a normal member variable. [/quote]
-
I added line 13 to the MainWindow.cpp above, but I still get the same error message. Is this what you are referring to?
-
Either, change line 20 in MainWindow.h to
@
Information info;
@
and remove line 13 from MainWindow.cpp, orchange line 20 in MainWindow.h to
@
Information* info;
@
and change lines 15-17 in MainWindow.cpp into:
@
info->a = "A";
info->b = "B";
info->c = "C";
@
and insert this line as line 24:
@
delete info;
@In either case, get yourself a good book on C++ to get yourself a solid introduction into the language you are working with. Qt does not shield you from having to learn C++.
-
Andre (and everyone else)-
Thanks for your help. The first option compiled correctly. Having seen something that works I hope I can figure it out from here.
Your last suggestion is appropriate. However, I have a large stack of books on C++ programming. The problem is the definition of the word "good". I learned chemical thermodynamics by using a large stack of textbooks. None of them were particulary good. But, where one authors explanation failed another author provided a more thorough explanation. I was able to piece it together that way. I haven't found that approach to work well for understanding C++.