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. How to avoid movility on a QGraphicsItem when it's selected?

How to avoid movility on a QGraphicsItem when it's selected?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 645 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.
  • R Offline
    R Offline
    Rhadel
    wrote on last edited by
    #1

    I've two custom classes from QGraphicsItem that it's drawn on a custom QGraphicsScene. One of them is selectable:

    @
    //Inicialize all data TYPE A
    this->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
    (...)
    @

    @
    //Inicialize all data TYPE B
    this->setFlags(QGraphicsItem::ItemIsMovable);
    (...)
    @

    The other one is just movable. Ok, then, when the selectable A object is selected (it shows an arrow when it is, drawn in its paint method) and I try to drag an object of the other type ("just movable type", type B), the selected object is also dragged. Only if I deselect it, I can drag only the B object.

    What can I do to indicate to Qt to move only if the mouse is clicked on the object?

    Thank you.

    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