Creating 2 Column for 2 videos (solved)
-
want to create 2 column for two videos. Can give some pointers on the code below.
@ header file
class Dialog : public QDialog
{ Q_OBJECT
public:
Dialog();
void CreateVideo1GroupBox();
void CreateVideo2GroupBox();
private:
QGroupBox *Video1GroupBox;
QGroupBox *Video2GroupBox;
//QLabel *labels;
@@ cpp file
Dialog::Dialog()
{
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(video1GroupBox);
mainLayout->addWidget(video2GroupBox);
setLayout(mainLayout);
}void Dialog::CreateVideo1GroupBox()
{formGroupBox = new QGroupBox(); QFormLayout *layout = new QFormLayout; Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, parentWidget); layout->play("/path/mysong1.MP4"); formGroupBox->setLayout(layout);
}
void Dialog::CreateVideo2GroupBox()
{
formGroupBox = new QGroupBox();
QFormLayout *layout = new QFormLayout;Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, parentWidget); layout->play("/path/mysong2.MP4"); formGroupBox->setLayout(layout);
}
@ -
Use QHBoxLayout to layout them side by side.