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. QGraphicsView and QGraphicsScene events

QGraphicsView and QGraphicsScene events

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

    Hello,

    I have a problem to understand how events are propagated to the graphicsScene and GraphicsView.

    I have a OpenGl view at the background of the QGraphicsScene (drawbackground event) and some widgets which are in
    my GraphicsScene with transparency.

    When I clicked on a push_button of a widget inside the scene, the event is propagated in the OPENGL view before
    the widget push button

    I tried 2 things :

    @bool QGraphicsView::viewportEvent(QEvent *event){

    bool tag = QGraphicsView::viewportEvent(event);
    QAdapterScene * pAdapterScene = dynamic_cast<QAdapterScene*>(scene());
    if (pAdapterScene) {
    //OpenGL events
    pAdapterScene->mapEvent(event);
    }

    return tag;

    }@

    and

    bool QAdapterScene::event(QEvent *event){
    bool tag = QGraphicsScene::event(event);
    //OpenGL events
    this->mapEvent(event);

     return tag;
    

    }

    But each time, events on widget were received after le map event function.

    Do you know how I can resolve my problem ?
    Thanks for your help

    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