1

I have a QGridLayout which contains all the layout for my class. Until there everything goes fine.

I added a QSplitter for other things and then at the bottom (After the splitter) i want the QTextBrowser to be. Fine, works. But i want to resize, i meant i want to make the QTextBrowser smaller. But resize doesn't work.

    QGridLayout *layout = new QGridLayout(this);
QSplitter *splitter = new QSplitter(Qt::Horizontal);
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);

Actually resizing the text1 works fine, but i can't make the QTextBrowser resize fine. Any idea?

Kazuma
  • 1,371
  • 6
  • 19
  • 33
  • Normally the layout would be adjust the size of everything inside of it for you, why are you trying to manually adjust the sizes? – Chris Dec 29 '11 at 16:51
  • It's some old code. I don't know what it's doing there. @Chris Since the QTextBrowser is too big i need to make it smaller. – Kazuma Dec 29 '11 at 20:51
  • Yeah but if it's in a layout, the layout has control of its size not you. So if it's not the right size you need to adjust its size polize and/or the layout itself. – Chris Dec 30 '11 at 03:52
  • Well the element is so big, i need to make it smaller. – Kazuma Dec 30 '11 at 09:48

0 Answers0