I can add a player object to my UI layout in the MainWindow constructor, but how do I use the widget container as a placeholder so I set properties and layout for the VideoPlayer in QtDesigner?
A:
Did you just try adding the placeholder widget as the parent in the constructor for the Videoplayer when you create it?
e.g.
VideoPlayer v* = new VideoPlayer(Phonon::VideoCategory, ui->someWidget);
teukkam
2010-08-17 11:38:08
that should work, although you probably want to add a layout to somewidget, and add v to it.
Frank
2010-08-17 16:53:54
A:
How I did it in the end was subclass the VideoPlayer as my own class then promote that class in the placeholder widget.
At this time trying to connect to slots in the placeholder widget crashes QTCreator so instead I connected via standard code (wgtPlayer is placeholder widget):
connect(ui->btnPlay, SIGNAL(clicked()), ui->wgtPlayer, SLOT(play()));
connect(ui->btnStop, SIGNAL(clicked()), ui->wgtlayer, SLOT(stop()));
DaveO
2010-08-19 09:54:56
rubenvb
2010-08-19 10:03:05