PDA

View Full Version : How to create a sibling widget



herculis
8th September 2014, 16:13
guys can anyone tell me how can i create sibling widget i am using two qvideowidget i want one to be sibling od other and the i need to use it the command stack under to put it under one another.
Please help me in this.

wysota
8th September 2014, 16:19
Sibling are entities that have a common parent.

herculis
8th September 2014, 16:21
how can i do that means syntax can you help me with a sample code.

wysota
8th September 2014, 16:23
Pass the same parent to constructors of both widgets.


QWidget *w1 = new QWidget(someParent);
QWidget *w2 = new QWidget(someParent);

herculis
8th September 2014, 16:27
QWidget *window=new QWidget();
{ window->resize(400,300);
window->show();}
screen = new QVideoWidget(window);
mediaPlayer.setVideoOutput(screen);
//screen->show();
screen1 = new QVideoWidget(window);
mediaPlayer1.setVideoOutput(screen1);
screen1->stackUnder(screen);

i did it like this
is screen 1 and screen siblings?

anda_skoa
9th September 2014, 15:55
is screen 1 and screen siblings?
They have the same parent, don't they?

Cheers,
_



is screen 1 and screen siblings?
They have the same parent, don't they?

Cheers,
_