Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. qt::leftbutton can work but qt::middlebutton can't work
Forum Updated to NodeBB v4.3 + New Features

qt::leftbutton can work but qt::middlebutton can't work

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 206 Views
  • 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.
  • P Offline
    P Offline
    Perlman
    wrote on last edited by
    #1
    if (event->buttons() & Qt::MiddleButton)
    {
    	QGraphicsView::mouseMoveEvent(event);
    }
    if (event->buttons() & Qt::LeftButton)
    {
    	QGraphicsView::mouseMoveEvent(event);
    }
    if (event->buttons() & Qt::RightButton)
    {
    	QGraphicsView::mouseMoveEvent(event);
    }
    
    jsulmJ 1 Reply Last reply
    0
    • P Perlman
      if (event->buttons() & Qt::MiddleButton)
      {
      	QGraphicsView::mouseMoveEvent(event);
      }
      if (event->buttons() & Qt::LeftButton)
      {
      	QGraphicsView::mouseMoveEvent(event);
      }
      if (event->buttons() & Qt::RightButton)
      {
      	QGraphicsView::mouseMoveEvent(event);
      }
      
      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Perlman More information would be helpful for others to understand what the problem is.
      Do you mean the first if condition is never true?
      On what platform are you?
      Do you use a mouse, touchpad or touch screen?
      What event do you override?

      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