Showing multiple scene/view at a same time

  • Hi All,
    Is it possible to show the two scene/views at a same time,at a same place. I mean can we apply transparency to the below scene/view so that upper scene/view can also be visible.


  • Use QStackWidget for this purpose.

  • but with QStackWidget also we cant show multiple widgets(scene/view) at the same time.

  • Then use QMdiArea

  • No its not satisfies my requirement. Im having one scene with the map, that I want to show it in background and another scene which contains other items, And my requirement is that I want to display both the map and other items at a same time with some transparency. So that all should be visible at the same time.

  • Maybe you shall put all items from the second scene in the first scene, than you have all items in one scene...

  • :) that is not possible. Because one view/scene(where Im loading map) is from QGIS and another one is from my application. So that map item I dont want to put in my scene, QGIS is providing nice options to handle with map.

  • It might be possible in scene, but I will rather go for a QGraphicsObject, or QGraphicsItem or QGraphicsWidget subclass and play with its visible property. If you have more than one item which you intend to show on the proposed new scene, you can make them a group.

  • Im not telling its not possible to combine the items from both the scene and display. That is possible but I dont want to do, moreover its already there in my application(map and other items) and im able to see all the items nicely in the single view and scene.
    Since I want to use the QGIS for the map loading, I have removed the map item from my application scene and using QGIS code to load the same. I have written sample code in QGIS( which uses Qt's GraphicsView concept internally) and I want to use same piece of code in my application to load the map.

  • AFAIK, you can implement exactly what you want if you make your layer as a QGraphicsItem subclass. Otherwise, more than one view can show the same scene. You can keep the your qgis item on main scene, or use a new scene for it. And point the scene to the new view.
    The view being a qwidget subclass itself, it must be possible to play with its background and transparency. Those methods however happen to be more messy than to my liking.
    Thus, one scene can have many views. But not vice-versa, to the best of my understanding

  • The method what ever Ur telling Im not getting.

  • bq. The method what ever Ur telling Im not getting.

    One scene can have many views. But not vice-versa. So you cannot have two or more scenes on the same view as per your requirement. At best you can switch, which is more easily implementable in QStackWidget, but that doesn;t serve you right.

    For your exact requirement, which may be thought of as a layer(ala photoshop). One way of implementing it, is to have the items as QGraphicsItem subclass. But you are not ok with it.

    The second way is to have another scene for your qgis, and create another view for it. It will be something similar to QMdiArea solution. Then for the graphics view widget, you can go for widget transparency method. However, those transparency tricks are troublesome according to me.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.