I need to overlap two qvideowidget in same lyout how can i do it plz could anyone help me in this
I need to overlap two qvideowidget in same lyout how can i do it plz could anyone help me in this
Implement your own layout that will do that. However that's (I mean overlapping widgets) probably not the proper approach to solve your real problem, whatever it might be.
i didnt get it.Can u explain it lil bit more''Implement your own layout that will do that.''
Use QStackedWidget class. The QStackedWidget is a "notebook" but without "bookmarks". Changing a page in QStackedWidget is made otherwise (using setCurrentIndex(), which is a slot, but like any other slot, which can be called directly).
Subclass QLayout and implement virtual functions that will position the widgets the way you want.
However, again, that will probably not solve your real problem which is the goal of overlapping widgets. Overlapping widgets is usually a bad idea and there are other ways to achieve similar results. Choosing the right approach depends on the task that needs to be solved.
http://www.catb.org/esr/faqs/smart-questions.html#goal
I want to show a video on let say on display1 after some time will hide the display1 and then display2 will show the remaining video.
So i need widget tobe overlap.
No, you don't. You can e.g. use QGraphicsView with two QGraphicsVideoItem instances and fade (or whatever you want) those. Even if you choose to go with widgets, you don't need any layout for overlapping them, just place them in a common parent and make sure their geometry covers the geometry of the parent.
Thanks wysota.
Actually i am new to Qt and C++ so can you plz give me one short exmaple of this parent and child concept.
This is the most basic thing about Qt. See docs on Object Trees & Ownership
ok thanks
and How can i hide or fade one widget and show other.
So if i use hide and show the problem is it takes a few mili seconds to hide and show other and therefore there is a gap very small but it exist i dont want that gap how can i remove gap
With widgets you will always have a small gap. That's why I suggested to use QGraphicsView. Then you can easily manipulate opacity of each item to provide a fluent transition.
I tried to make the qwidget tranparent as i m using qstackwidget class and i did the upper widget transparent but i cannot see the lower widget its just a black screen can u help me in this
and regarding qgraphicview how can i make it transparent.
Please have a look at API exposed for graphics items, you will surely find a relevant method. I even mentioned it a couple of posts back. I don't want to repeat myself over and over again.
Hi wysota,
I used qgraphicvideoitem ,overlap them with setsize and make one of the item transparent but then also there is somemili sec gap to make it transpaent and show other video item
screen=qgraphicvideoitem();
screen1->setOpacity(0);
with this command I am making it transparent.
Bookmarks