[Interest] FW: Appending QTextEdit in the QWidget

Sujan Dasmahapatra sdh at lmwindpower.com
Tue Apr 17 15:16:18 CEST 2012


Thanks a lot friends for showing me the way, I am looking into QGridLayout I hope it solves my problem. Thanks a lot Sujan

 

 

From: interest-bounces+sdh=lmwindpower.com at qt-project.org [mailto:interest-bounces+sdh=lmwindpower.com at qt-project.org] On Behalf Of BERAUD Alexandre
Sent: Tuesday, April 17, 2012 5:45 PM
To: interest at qt-project.org
Subject: Re: [Interest] FW: Appending QTextEdit in the QWidget

 

Maybe QGridLayout is what you are looking for. Maybe you should also consider using the modulo operator somewhere.

Regards,

Alex


Le 17/04/2012 14:07, Sujan Dasmahapatra a écrit : 

Ignore my last mail it was incomplete.

 

I want to append QTextEdit in the QWidget. QWidget has a specified width and height. I want to append QTextEdit on the widget in such a way that max 2 textedit should be there horizontally, after that 3rd textedit should be added vertically, means the widget should be split into 2 halves and 3rd textedit should append to the next row. 4th textedit should append to the 2nd row 2nd column. And so on.

 

I dunno whether I am able to explain my problem or not. Please check the code snippet below.

 

CSheet::CSheet(QTabWidget *parent):QWidget(parent)

{

    tab = parent;

    setGeometry(0, 0, tab->width(), tab->height());

    layoutH = new  QHBoxLayout(this);

    layoutH->setGeometry(QRect(0,0,width(),height()));

    QTextEdit *wid1 = new QTextEdit(this);

    QTextEdit *wid2 = new QTextEdit(this);

    layoutH->addWidget(wid1);

    layoutH->addWidget(wid2);

}

 

Now when I add a 3rd widget in the layout it's adding horizontally, I want it to come to the next row. And so on.

 

Please help me how can I achieve this. Thanks Sujan






_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest






-- 
Alexandre BERAUD
Ingénieur Développement
INFFLUX
01.49.57.92.00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120417/d92cb59b/attachment.html>


More information about the Interest mailing list