View Full Version : a simple question: spinbox

27th February 2006, 11:57
Hi, Ihave my app with a Qdialog design from QTDesigner. Inside myDialog I have put many spinbox. When I invoke myDialog and check some spinbox, I'd like the dialog remember the spinbox checked the next time! Does QT provide to this? Thanks

27th February 2006, 12:11
What does "checked spinbox" mean? Did you mean either of:

QSpinBox, which has focus
QCheckBox, whose checkState() == Qt::Checked

27th February 2006, 16:18
the second choice...

27th February 2006, 16:37
Ok. Now the other question: what do you mean by saying

next time
Do you mean the next time your application will run or the next time myDialog will be popped up?
In the first case you should save checkbox states before finishing your application and restore them on application startup. Try QSettings (http://doc.trolltech.com/4.1/qsettings.html).
In the later case you should preserve the first instance of your dialog after the first creation of it.