Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Active QGraphicsView from QGraphicsScene



  • Consider a QGraphicsscene that has multiple views. I wanted to get the view that is currently in focus(i mean a user is currently interacting with). Also is there any way to get current paint engine details from active QGraphicsView Object.

    QGraphicsScene::views() will give me a list but does the active view will be always at 0th position ?



  • @DonCoder

    You dont need your scene for this. Just check which view has focus.

    QGraphicsView * view
    view->hasFocus();
    
    

    or QApplication::focusWidget();


Log in to reply