Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7872019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:05:08+00:00 2026-06-03T02:05:08+00:00

When I call getCount function in the below code, QT 4.7.3 complier giving the

  • 0

When I call getCount function in the below code, QT 4.7.3 complier giving the error. Build Error

pasing ‘cont Person’ as ‘this’ argument of ‘int Person::getCount(const QString&) discards qualifiers

 bool Person::IsEligible(const QString& name)
 {
      int count = 0;
      count = getCount(name);
 }

 int Person::getCount(const QString& name)
 {
  int k =0
  return k;
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:05:09+00:00Added an answer on June 3, 2026 at 2:05 am

    The error isn’t a problem with passing string arguments, it’s that you’ve got a const person, e.g.:

    const Person p1;
    Person p2;
    p1.IsEligible("whatever"); //Error   
    p2.IsEligible("whatever"); //Fine because p2 isn't const
    

    If IsEligible is meant to be callable on const Persons then you can say:

    bool Person::IsEligible(const QString& name) const
     {
          int count = 0;
          count = getCount(name);
     }
    

    (and change the corresponding declaration that you’ve not shown too obviously), but I’m not 100% sure that’s what you intended to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I call my JavaScript function. Why do I sometimes get the error 'myFunction is
I call a javascript function from a textbox by using OnKeyPress=clickSearchButton() Here is my
I call the following function with a mouseover event but it's not working. My
I call this a flash meeting, but maybe there is another more appropriate name.
I call an ajax enabled wcf service method , <script type=text/javascript> function GetEmployee() {
I call the following function with Call GameTimer(FormatDate(objLiveCommentary(DateFirstStarted), WithTime), FormatDate(objLiveCommentary(DateSecondStarted), WithTime), Soccer) And it
Best to explain with an example: int RecordCount { return dataAdapter.getCount(); // database access
In my code i just used two listview and two CustomAdapter for this two
Call me stupid but this thing has been eating away my productive time like
Problem: Call to send() , returns Winsock Error 10038 against socket handle Illustration: acceptedSocket

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.