[Interest] QTextEdit not resizing with QFormLayout

Samuel Gaist samuel.gaist at edeltech.ch
Tue May 8 10:26:11 CEST 2012


And also the doc about QMainWindow:

http://qt-project.org/doc/qt-4.8/qmainwindow.html#details

On 8 mai 2012, at 10:22, Diego Iastrubni wrote:

> 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
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list