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. Can't use parameter *event
Forum Updated to NodeBB v4.3 + New Features

Can't use parameter *event

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 462 Views 2 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by
    #1

    Hi everyone. Here is a problem, for some reason(i'm 2 days trying to figure it out) i can't use parameter of reimplemented function(in other projects i remember i could).

    Function:

    void mousePressEvent(QMouseEvent *event);
    

    My Custom class which simply create graphicsView and stuff in it:

    class myGview : public QGraphicsView
    

    And when i, in body of that function trying use event - nothing happens. I mean normaly, it would be possible to use arrow member selector after i typing out "event" but i press .dot, nothing happens, it do not transform in to -> as any pointer objects do.

    It should work, and i need to use it like this:

    event->button()
    

    Would be thankful of any help!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      Does it compile if you manually type the '->' and you call a valid member function? Did you include the QMouseEvent header?

      #include <QMouseEvent>
      
      EngelardE 1 Reply Last reply
      3
      • M mchinand

        Does it compile if you manually type the '->' and you call a valid member function? Did you include the QMouseEvent header?

        #include <QMouseEvent>
        
        EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by
        #3

        @mchinand said in Can't use parameter *event:
        Did you include the QMouseEvent header?

        Well that's a shame.
        Delete this topic fast admin plz.

        1 Reply Last reply
        1
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          @Engelard, don't worry, it can't happen to everybody. Furthermore, that mistake of yours might help somebody else in the future.

          Just mark the thread as solved and keep on hacking :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

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