QSqlRelational filter.



  • This is probably asked a million times before, but could not find the short answer. I'm setting up a model->setFilter from a drop down menu. This is the function called by clicking on the dropdown:

    void CostCountry::on_country_activated(const QString &arg1)
    {
        model->setFilter(QString("countries.name=%1".arg(arg1)));
    
    }
    

    Getting this error: request for member 'arg' in '"countries.name=%1"', which is of non-class type 'const char [18]'
    model->setFilter(QString("countries.name=%1".arg(arg1)));
    ^



  • it's

    QString("countries.name=%1").arg(arg1)
    

    arg() is a QString method.



  • Embarrassed, did not see that closing parenthesis.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.