[Interest] QTextEdit not resizing with QFormLayout
Diego Iastrubni
diegoiast at gmail.com
Tue May 8 10:22:37 CEST 2012
Use layouts, not absolute positioning. Read the docs about it.
On Tue, May 8, 2012 at 11:13 AM, Sujan Dasmahapatra <sdh at lmwindpower.com>wrote:
> Please check this code snippet, with this when I resize the mainwindow,
> my textedit is not resizing. What could be the problem pls help.****
>
> ** **
>
> //mainwindow.h****
>
> QPushButton *button;****
>
> QTextEdit *edit;****
>
> QFormLayout *formL;****
>
> ** **
>
> //mainwindow.cpp****
>
> MainWindow::MainWindow(QWidget *parent):QMainWindow(parent)****
>
> {****
>
> setGeometry(0,0,800,600);****
>
> ** **
>
> button = new QPushButton("Click me!!",this);****
>
> button->setGeometry(5,5,100,25);****
>
> button->show();****
>
> ** **
>
> edit1 = new QTextEdit(this);****
>
> edit1->setGeometry(5, 35, width()-10, height()-40);****
>
> edit1->show();****
>
> ** **
>
> formL = new QFormLayout;****
>
> formL->addRow(("&Name:"), edit1);****
>
> setLayout(formL);****
>
> }****
>
> ** **
>
> Thanks sujan****
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120508/078baa70/attachment.html>
More information about the Interest
mailing list