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@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to