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. MouseMoveEvent ERROR!
Qt 6.11 is out! See what's new in the release blog

MouseMoveEvent ERROR!

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 9.0k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    beowulf
    wrote on last edited by
    #1

    mywidget.cpp:

    @void MyWidget::mouseMoveEvent(QMouseEvent *event)
    {

    qDebug() << event->pos();
    

    }@

    mywidget.h:

    @void mouseMoveEvent(QMouseEvent *event);@

    ERROR:

    @:-1: In member function 'virtual void MyWidget::mouseMoveEvent(QMouseEvent*)':
    error: invalid use of incomplete type 'struct QMouseEvent'
    error: forward declaration of 'struct QMouseEvent'@

    -- 0x00

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guziemic
      wrote on last edited by
      #2

      You are missing include in your code

      @
      #include <QMouseEvent>
      @

      1 Reply Last reply
      1
      • B Offline
        B Offline
        beemaster
        wrote on last edited by
        #3

        #include <QMouseEvent>

        1 Reply Last reply
        1
        • M Offline
          M Offline
          Macro
          wrote on last edited by
          #4

          Try by including the Header file #include <QMouseEvent>

          Note: Always don't forget to use the necessary Headers. Including all the Header files is a good sign of programming practice... :) All d best..

          1 Reply Last reply
          1

          • Login

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