Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9024375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:59:31+00:00 2026-06-16T05:59:31+00:00

I have a simple QGraphicsWidget, MyGraphicsWidget. Here’s my mouseMoveEvent(), which seems to work fine

  • 0

I have a simple QGraphicsWidget, MyGraphicsWidget. Here’s my mouseMoveEvent(), which seems to work fine :

void MyGraphicsWidget::mouseMoveEvent (QGraphicsSceneMouseEvent *event)
{
    QPointF p = event->scenePos() - m_StartPos;
    if(p.manhattanLength() < 20)
        return;
    //omitted drawing a rounded rect on the drag
    QDrag *drag = new QDrag(event->widget());
    drag->start(Qt::MoveAction);
}

The scene’s dropEvent() just moves this widget to its new position, and I don’t have a press/move event for the scene itself, so those should get passed on correctly to the widgets within.

However, once the drag completes, the next mouse press will be on this widget. So if I try to click and drag another widget, I’ll be stuck dragging this one on accident, despite the fact that my cursor is not on this widget. I’ve printed out the event->pos() and event->scenePos(), and both reported that the cursor is where it appears to be (not on the widget at all). If I click once before trying to click and drag, everything works normally. Is there maybe something I need to implement within mouseReleaseEvent() or my mouseMoveEvent() ?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:59:32+00:00Added an answer on June 16, 2026 at 5:59 am

    It’s working now. I’m pretty sure this was the issue:
    MyGraphicsWidget had another custom GraphicsWidget sitting on top of it, and in its mousePressEvent, I was calling QGraphicsWidget::mousePressEvent(event); at the start of the event. The rest of the event was never getting triggered, which was messing it all up. I moved that line to the end of the method, and everything seems okay now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple client/server SSL code which worked fine on Python 3.2. However, I
I have simple class with width and height member fields which define number of
I have a fairly simple PyQt application in which I'm placing instances of a
I have simple xlib program which creates window. I think it has to show
I have simple scenario in which i hide and show a signle MenuItem in
I have simple front controller plugin which contains this code: http://pastebin.com/m155c59b0 When session expire
I have simple application with single AppDomain which is periodicaly launched on a server.
I have simple test project which creates a frame and adds one JTextPane to
I have simple JSF application. Everything works fine, but not navigation. It behaves like
Have simple C# console app which imports text data into SQL. It takes around

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.