[Qt-interest] QVBOxLayout problem with QSCrollArea and QWidget
sarvesh saran
aquarian.thunder at gmail.com
Wed Mar 16 10:03:29 CET 2011
Hi,
is showcasepage being initialized after you pass it to CHeadWidget and
PageForGraph?
Also, when you use a layout, you do not need to pass a parent when
constructing the child widgets. The layout will automatically re-parent the
widgets so that they are children of the widget on which the layout is
installed.
thanks,
Sarvesh
.
On Tue, Mar 15, 2011 at 6:52 PM, Sujan Dasmahapatra <sdh at lmwindpower.com>wrote:
> Dear Friends
>
>
>
> I have three widgets as below.
>
>
>
> void MainWindow::Somefunc()
>
> {
>
> CHeadWidget * header = new CHeadWidget(this,showcasepage);
>
> PageForGraph *plotpage = new PageForGraph(this,showcasepage);
>
>
>
> QWidget * showcasepage = new QWidget(this);
>
> QVBoxLayout *layout = new QVBoxLayout;
>
> layout->setDirection(QBoxLayout::TopToBottom);
>
> layout->addWidget(header);
>
> layout->addWidget(plotpage);
>
> layout->setContentsMargins(0, 0, 0, 0);
>
> layout->setSpacing(0);
>
>
>
>
>
> showcasepage->setLayout(layout);
>
>
>
> QStackedWidget *center = new QStackedWidget;
>
> center->addWidget(showcasepage);
>
> center->setCurrentWidget(showcasepage);
>
> }
>
> /////////////////////////////////////////////////////////////////
>
> But with this I cannot see the header at the top. I can only see the
> plotpage. Any help would be appreciated. Thanks sujan
>
>
>
>
>
>
>
> Kind Regards,
>
>
>
>
>
> *Sujan Dasmahapatra
> *Project Leader, Aero Group
> Aero Group
>
> Tel +91 80 66470248
> Mob
>
> sdh at lmwindpower.com <%25EMAIL%25>
>
>
>
> *LM Wind Power Blades*
>
> lmwindpower.com
>
>
>
> *Together we capture the wind to power a cleaner world*
> ------------------------------
>
>
>
> This e-mail and any attachments are confidential. If you are not the named
> or intended recipient, please notify the sender immediately and do not
> disclose the contents to any other person, use it for any purpose, or store
> or copy the information in any medium. Any unauthorized disclosure, use or
> storage is prohibited and might be unlawful.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110316/55c7a3a2/attachment.html
More information about the Qt-interest-old
mailing list