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 6835767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:16:19+00:00 2026-05-26T23:16:19+00:00

When I select several QGraphicsItem (with Ctrl key) I can move them together, but

  • 0

When I select several QGraphicsItem (with Ctrl key) I can move them together, but the mouseMoveEvent is triggered only for the item that actually receives the event. Is there a way to make every selected items receive the event ? I can’t find it in Qt’s doc.

Could I group selected items together and handle it within QGraphicsView’s mouseMoveEvent ?

Thanks a lot for any help 🙂

  • 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-05-26T23:16:20+00:00Added an answer on May 26, 2026 at 11:16 pm

    No there is no default way to do what you want as far as I know. Something you could do is the following:

    • Subclass QGraphicsScene and implement the mouseMoveEvent
    • In the mouse move event check if there is an item at the event position using the itemAt function
    • If there is an item and it is selected (isSelected), get all selected items of the scene.
    • For all selected items call the same function you would call.

    Sample code follows:

    void mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent) 
    {
        QPointF mousePosition = mouseEvent->scenePos();
        QGraphicsItem* pItem = itemAt(mousePosition.x(), mousePosition.y());
        if (pItem == NULL)
        {
            QGraphicsScene::mouseMoveEvent(mouseEvent);
            return;
        }
    
        if (pItem->isSelected() == false)  
        {
            QGraphicsScene::mouseMoveEvent(mouseEvent);
            return;
        }
    
        // Get all selected items
        QList<QGraphicsItem *> items = selectedItems();
    
        for (unsinged i=0; i<items.count(); i++)
            // Do what you want to do when a mouse move over a selected item.
            items[i]->doSomething(); 
    
        QGraphicsScene::mouseMoveEvent(mouseEvent);  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to do a select in MySql that combines several columns... something like
I have a query that makes several calls within a SELECT statement to a
In IIS7 for Vista, you can select your machine and it gives you several
I have a form in HTML, that has several select elements, what is the
I'm looking for HTML list tag where user can select several options from the
I have several classes that I want to select .group1-1 .group1-2 .group1-3, each one
I have the following information that should be retrieved by using several dependent select
I need to create a GUI, using which users can select several attributes which
I'm creating simple payment form that allows users to select from several different gateways
How can I select several not continuous rows ? If I wanted to select

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.