//create widget1,and put a text1 on it,
layout1->addWidget(text1);
widget1->setLayout(layout1);
//create widget2,and put a text2 on it,
layout2->addWidget(text2);
widget2->setLayout(layout2);
//create widget3,and put a text3 on it,
layout3->addWidget(text3);
widget3->setLayout(layout3);
// insert widget1,widget2,widget3 into horizonSpliter1
horizonSpliter1->insertWidget(0,widget1);
horizonSpliter1->insertWidget(1,widget2);
horizonSpliter1->insertWidget(2,widget3);
//Does thing about horizonSpliter2 is the same as that of horizonSpliter1.
layout4->addWidget(text4);
widget4->setLayout(layout4);
layout5->addWidget(text5);
widget5->setLayout(layout5);
layout6->addWidget(text6);
widget6->setLayout(layout6);
horizonSpliter2->insertWidget(0,widget4);
horizonSpliter2->insertWidget(1,widget5);
horizonSpliter2->insertWidget(2,widget6);
//Does thing about horizonSpliter3 is the same as that of horizonSpliter1.
layout7->addWidget(text7);
widget7->setLayout(layout7);
layout8->addWidget(text8);
widget8->setLayout(layout8);
layout9->addWidget(text9);
widget9->setLayout(layout9);
horizonSpliter3->insertWidget(0,widget7);
horizonSpliter3->insertWidget(1,widget8);
horizonSpliter3->insertWidget(2,widget9);
verticalSpliter->setOrientation(Qt::Vertical);
//insert horizonSpliter1,horizonSpliter2,horizonSpliter3 into verticalSpliter.
verticalSpliter->insertWidget(0,horizonSpliter1);
verticalSpliter->insertWidget(1,horizonSpliter2);
verticalSpliter->insertWidget(2,horizonSpliter3);
....
//create widget1,and put a text1 on it,
QSplitter *horizonSpliter1=new QSplitter;
QWidget *widget1=new QWidget;
QTextEdit *text1=new QTextEdit;
QHBoxLayout *layout1=new QHBoxLayout;
layout1->addWidget(text1);
widget1->setLayout(layout1);
//create widget2,and put a text2 on it,
QWidget *widget2=new QWidget;
QTextEdit *text2=new QTextEdit;
QHBoxLayout *layout2=new QHBoxLayout;
layout2->addWidget(text2);
widget2->setLayout(layout2);
//create widget3,and put a text3 on it,
QWidget *widget3=new QWidget;
QTextEdit *text3=new QTextEdit;
QHBoxLayout *layout3=new QHBoxLayout;
layout3->addWidget(text3);
widget3->setLayout(layout3);
// insert widget1,widget2,widget3 into horizonSpliter1
horizonSpliter1->insertWidget(0,widget1);
horizonSpliter1->insertWidget(1,widget2);
horizonSpliter1->insertWidget(2,widget3);
//Does thing about horizonSpliter2 is the same as that of horizonSpliter1.
QSplitter *horizonSpliter2=new QSplitter;
QWidget *widget4=new QWidget;
QTextEdit *text4=new QTextEdit;
QHBoxLayout *layout4=new QHBoxLayout;
layout4->addWidget(text4);
widget4->setLayout(layout4);
QWidget *widget5=new QWidget;
QTextEdit *text5=new QTextEdit;
QHBoxLayout *layout5=new QHBoxLayout;
layout5->addWidget(text5);
widget5->setLayout(layout5);
QWidget *widget6=new QWidget;
QTextEdit *text6=new QTextEdit;
QHBoxLayout *layout6=new QHBoxLayout;
layout6->addWidget(text6);
widget6->setLayout(layout6);
horizonSpliter2->insertWidget(0,widget4);
horizonSpliter2->insertWidget(1,widget5);
horizonSpliter2->insertWidget(2,widget6);
//Does thing about horizonSpliter3 is the same as that of horizonSpliter1.
QSplitter *horizonSpliter3=new QSplitter;
QWidget *widget7=new QWidget;
QTextEdit *text7=new QTextEdit;
QHBoxLayout *layout7=new QHBoxLayout;
layout7->addWidget(text7);
widget7->setLayout(layout7);
QWidget *widget8=new QWidget;
QTextEdit *text8=new QTextEdit;
QHBoxLayout *layout8=new QHBoxLayout;
layout8->addWidget(text8);
widget8->setLayout(layout8);
QWidget *widget9=new QWidget;
QTextEdit *text9=new QTextEdit;
QHBoxLayout *layout9=new QHBoxLayout;
layout9->addWidget(text9);
widget9->setLayout(layout9);
horizonSpliter3->insertWidget(0,widget7);
horizonSpliter3->insertWidget(1,widget8);
horizonSpliter3->insertWidget(2,widget9);
QSplitter *verticalSpliter=new QSplitter;
verticalSpliter->setOrientation(Qt::Vertical);
//insert horizonSpliter1,horizonSpliter2,horizonSpliter3 into verticalSpliter.
verticalSpliter->insertWidget(0,horizonSpliter1);
verticalSpliter->insertWidget(1,horizonSpliter2);
verticalSpliter->insertWidget(2,horizonSpliter3);
....
To copy to clipboard, switch view to plain text mode
Bookmarks