0

I am new on the QT world. And I am confused to where to put my small bool function:

    bool Widget::compareBy(const dist_obj &a, const dist_obj &b)
{
    return a.distance < b.distance;
}

and I want to call it from `void Widget::update_window()

like: `

std::sort(found_obj.begin() , found_obj.end() , compareBy);

it gave:

error: reference to non-static member function must be called

I am using this function in my normal c++11 Clion environment. What am I doing wroin in this QT world :O

thanks

Rahibe Meryem
  • 269
  • 3
  • 14

1 Answers1

0

I found an answer which is worked for me from sorting a vector of classes based on a variable in the class

worked like a charm without defining any function or class.

Rahibe Meryem
  • 269
  • 3
  • 14