View Single Post
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#82
Could you kindly tell me how to set the comboboxes show the value I want?

I tried all kinds of stuff but couldn't find how to do it right. Here's what I've tried so far and I'm getting build error " classQComboBox has no member named 'setCurrentText'
Code:
void MainWindow::writeSettings()
{
    QSettings sett("blackplastic-theme/config");
    sett.setValue("color", ui->Color->currentText());
    sett.setValue("transitions", ui->Transition->currentText());
}

void MainWindow::readSettings()
{
    QSettings sett("blackplastic-theme/config");
//    bool OK;
    QString color = sett.value("color", QVariant("")).toString();
    QString transitions = sett.value("transitions", QVariant("")).toString();
    ui->Color->setCurrentText(color);
    ui->Transition->setCurrentText(transitions);
}
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE