Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt - Making a Splitter Horizontal and Vertical at same time

Tags:

I have a QGridLayout with a QSplitter on it. In that QSplitter I have two elements with a splitter that lets me move the splitter from left to right. Fine, there it's fine. But then I want to add another splitter but that moves up to down. (I'll explain with an image.)

split window with two boxes atop a single wide box

So it's mostly having 2 splitters, one that moves left-to-right and other that moves up-to-down.

I hope you understand.

QGridLayout *layout = new QGridLayout(this);
QSplitter *splitter = new QSplitter();
text1 = new QPlainTextEdit();
text2 = new QPlainTextEdit();
splitter->addWidget(text1);
splitter->addWidget(text2);
text1->resize(800, this->height());
layout->addWidget(splitter, 1, 0);
browser = new QTextBrowser();
browser->resize(1, 1);
layout->addWidget(browser, 2, 0);
setLayout(layout);

Here i add only 1 splitter, since i don't know how to do the 2nd one.