Save in QSettings the current checked button of a groubbox..

  • How is it possible?

        @settings.setValue("current_page" , ui->buttonGroup->checkedButton());

    won't work cause ui->buttonGroup->checkedButton() is a QAbstactButton and not an int.

  • Firstly, a QButtonGroup is not a QGroupBox, so your title is misleading.

    QButtonGroup::checkedId() gives you the id number you associated with the button that is currently checked: store this. You can use that to find the button to check, using QButtonGroup::id(), when you retrieve the value from QSettings.

Log in to reply