-2

I have a simple dialog of type QDialog. When the uses clicks OK button I want to do some validation before closing the form and returning to caller (main form).

I tried to add in my "CustomDialog.cpp" file the following code:

void CustomDialog::accept(){
  // My code...
}

But I get this error:

error: virtual function 'accept' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () attribute((thiscall))')

What am I doing wrong? Do I need to add something in the CustomDialog.hpp too?

DEKKER
  • 877
  • 6
  • 19

1 Answers1

0

In your .hpp, you should declare accept() method inside your CustomDialog class. i.e. void accept() override; under public slots.

Rhathin
  • 1,176
  • 2
  • 14
  • 20