mercredi 22 janvier 2020

reference to type 'const QVariant' could not bind to an rvalue of type 'void'

I am trying to save the following modification : to enable the pushButton_4.

void Vessels::SaveSettings()
{
    QSettings setting("My_vessels","My_selected_vessels");
    setting.beginGroup("Vessels");
    setting.setValue("selected",ui->pushButton_4->setEnabled(false));
    setting.endGroup();
}

When I run, I get this error: vessels.cpp:838:33: error: reference to type 'const QVariant' could not bind to an rvalue of type 'void' qsettings.h:167:55: note: passing argument to parameter 'value' here

All what I wanna know, is how to setvalue for an object from this window. I mean enabling the button is just an example.

Aucun commentaire:

Enregistrer un commentaire