Home > database >  To solve the QT QMouseEvent cannot use mouse events
To solve the QT QMouseEvent cannot use mouse events

Time:10-07

Qt 5.12.2

Problem description:
Once in the header file within the class (whether in the public, protected, or private) write
"Void mouseMoveEvent (QMouseEvent *)"

Will appear error:

If left me to create a new project widget app... , 64 - bit kit choice mingw, base class qmainwindow, check the create interface,

Undefined reference to 'MainWindow: : mouseMoveEvent (QMouseEvent *)
'Not found moc_mainwindow. CPP
Error: the id returned 1 exit status
Collect2. Exe

To solve the ing

CodePudding user response:

Resolved:
As long as written under the corresponding CPP definition:
Void the source file name: : mouseMoveEvent (QMouseEvent *)
{}
  • Related