In general QSettings is there to save persistent data - so its not a bad practice.there is any problem if i use QSettigns to write settings "on the fly"?
i'd like to save a setting value whe the user change the text of a QLineEdit
is this a bad practice or something?
However, if you need to save it very often, you might want to cache it first, and save only the last change before closing.
There is no measurable difference between the two approaches in terms of performance.Question 2:
What is better FOR PERFOMANCE, a lot of QWidget->setValue("Secction/Sub").toInt(); ( for example )
or an "intelligent coded based/dynamic engine" like:
( with pseudocode )
for (int x=0; x<MaxWidgets; x++) {
QWidget->setValue( "Function that assigns section name using Widget name" ).toInt();
}
(same question for saving settings)
Specially since you wont have thousands of lines setting the value.
And if you need many such lines you can't avoid using a loop.
You can connected the toggled() signal of the radio button to the setEnabled() slot of the check box in designer.another question, so i have not to open another thread:
there is any way of making make a checkbox uncheckable, via QT Designer, if a radiobutton is not checked? ( its easy to do with code, but maybe there is a fastest way with QT Designer )
For me personally however, in this case writing the code would be faster then doing it in designer.





Reply With Quote

Bookmarks