> But I could not figure out on how TimeSignatureDialog communicates these > settings to the rest of the system as they are constructed in the dialog. > Again, could somebody please point me in the right direction? Thanks for > your patience...
OK, there are a few things going on. The stuff you're looking at is all about QSettings, which is part of the QT toolkit. The QT site http://doc.qt.nokia.com gives it all in much more detail, but I'll annotate what's basically happening: > QSettings settings; This is a QT object which does of the save/restore work for you just by existing. > settings.beginGroup( GeneralOptionsConfigGroup ); This is just organizing the persistent objects. It's telling it that everything that follows (up to endGroup IIRC) belongs in this group; to avoid name clashes etc. You can nest this. Begingroup / endGroup are like brackets. I forget where and how GeneralOptionsConfigGroup is defined, but IIRC it's pretty easy. > settings.setValue("timesigdialogmakehidden", > m_hideSignatureButton->isChecked()); Translating it from what's in the dialog into settings. settings.value does the opposite job. You probably guessed most or all of that, but it leads me into the other stuff thing that's going on: Everything up to here just makes settings persistent. The values are temporarily stored in the dialog object, usually in checkboxes etc. The dialogs are launched somewhere, typically by a slot method in NotationView, MatrixView or similar. Ie, we make a dialog object and then exec it. When it returns, we check whether it succeeded or was aborted. If it succeeded, we're still not done. In fact, we haven't *done* anything at that point. Now we extract the values from the dialog and pass them to a command, which is another object. That has to be executed too, but then you're done. There are all sorts of exceptions and variant cases around, so don't take this as an absolute rule of how RG always does things. > > Additionally, are there rules about where to put the settings (which > group) and how to name them? I don't know of any formal rules. If you plan to support a number of options, it probably makes sense to make a group just for that. Tom Breton (Tehom) ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Rosegarden-devel mailing list Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel