I'm writing on a small alarm watch app consisting of a main window showing times and allowing to start a predefined alarm time, and some user dialogs fpr setting up different alarm tunes (as mp3) and entering events to be shown on wake time. This so far is what I'm working on. Since I need to store the values of those Dialogs in the main window, I thought it as a good idea soing this in the MainWindow class private vars. I wanted to have them central, because of the need of writing them into a presets file and because they are njeeded by the main window in order to do its job. The example code above, however, is a simplified rewrite mirroring my problem - not the app I'm working on. Since I'm relatively new to C++ I expect more quirks and quarks to come there...
I worked myself through a German book titled "C++ in 21 Tagen", also through "The independant Qt tutorial" and the Blanchette Book on Qt, and I have some knowledge in C from my Amiga times.
Nevertheless, i see there's more needed to fully understand C++'ing with Qt. Some concepts still confuse me, since I'm still thinking in more procedural terms. Once after a while I hope it'll change to more OOP thinking, but I have to get used to it. Guess there's more practice to be done...
I'll start giving it a try with both possibilities in some test projects: handing a pointer to MainWindow and using getter functions. The last was what I thought I did, but obviously they are needed in the Dialog - and I implemented them in MainWindow.
Thanks a lot for all your hints! This seems to be a very friendly forum.
Bookmarks