Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSqlRelational filter.
Qt 6.11 is out! See what's new in the release blog

QSqlRelational filter.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Dan3460D Offline
    Dan3460D Offline
    Dan3460
    wrote on last edited by
    #1

    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)));
    ^

    1 Reply Last reply
    0
    • T Offline
      T Offline
      taedium
      wrote on last edited by taedium
      #2

      it's

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

      arg() is a QString method.

      1 Reply Last reply
      2
      • Dan3460D Offline
        Dan3460D Offline
        Dan3460
        wrote on last edited by
        #3

        Embarrassed, did not see that closing parenthesis.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved