[kln2-devel] preferences & setHidden
Brought to you by:
wiecko
From: Carlo <si...@bl...> - 2004-09-17 00:16:04
|
Hi, ## some errors: * I got a compile error about the setHidden function call in midi_setup.cpp: 109 [compiler output at the end of the mail] I fixed it by including the function in the class. * by updating the translations I got these errors (just to report them, in particular the lack of Q_OBJECT macros): klearnnotes2.pro lupdate error: Cannot open C++ source file 'src/imageitem.h': No such file or directory src/oneletternotation.cpp:53: Class 'OneLetterNotation' lacks Q_OBJECT macro src/solfeggionotation.cpp:31: Class 'SolfeggioNotation' lacks Q_OBJECT macro ## klearnnotes2.cpp: 1017 > if (klnPrefs == NULL)return;//just to be sure...[or it might be created here] Also if the preferences file doesn't exist klnPrefs is created in loadOptions() wich is called by KLearnNotes2 construtor. So I cannot figure out why it shouldn't exist. This check is just for the worst of the worsts cases. Well, it could also be created here, but it would contain nothing. I think it's better to load defaults next time KLN is launched. Or call loadOptions() here !? ## exercises preferences I was thinking about writing Exercise::savePreferences (/loadPreferences) wich would - save exercise settings (like testLenthFactor) - not set a group (doesn't call Preferences::setGroup) - would be inherited by each exercise (- could raise a signal caught by the exercise) This function would be called by KLearnNotes2::saveOptions wich is charged to setGroup and would solve the problem for the current exercise. Alternatively each exercise could load his preferences in his constructor and save them in the destructor creating his own group. Is there anything wrong with this? > // [ on the second thought(and after reading prefs.cpp;) : NO! > // preferences saves changed data immediately; Preferences are written to a file only when Preferences::flush or Preferences::writeData is called. When you change a value by calling set*() only the QMap is changed. ## preferences errors I "fixed" error reporting. The status bar is changed by KLearnNotes2::loadOptions and KLearnNotes2::saveOptions and *not* in preferences.cpp, mainly because KLearnNotes2::statbar is protected. Though I don't have tryed all possible errors yet (i.e. corrupted files). regards, Carlo midi_setup.cpp: In constructor `MIDI_setup::MIDI_setup(QPixmap, QWidget*, const char*, bool, unsigned int)': midi_setup.cpp:109: error: no matching function for call to `MIDI_setup:: setHidden(QLabel*&, bool)' /usr/share/qt3/include/qwidget.h:349: error: candidates are: void QWidget::setHidden(bool) midi_setup.cpp:120: error: no matching function for call to `MIDI_setup:: setHidden(QSpinBox*&, bool)' /usr/share/qt3/include/qwidget.h:349: error: candidates are: void QWidget::setHidden(bool) |