[Qt-interest] setWidget() problem for QScrollArea

Sujan Dasmahapatra sujan.dasmahapatra at gmail.com
Mon Jul 18 09:27:48 CEST 2011


Thanks Anton
But I think its because I am not setting the size of the widget thats why
its not coming.
wid->resize(800,600);
This is working for me without setting a layout. Thanks  for the reply
sujan

On Mon, Jul 18, 2011 at 12:36 PM, Anton Chernov <mechernov at gmail.com> wrote:

> Put a layout in the wid Widget
>
> QHboxLayout* layout = new QHboxLayout(wid);
> QPushButton *button = new QPushButton(“click me”,wid);
> layout->addWidget( button );
>
> 2011/7/18 Sujan Dasmahapatra <sdh at lmwindpower.com>:
>  > Dear Friends
> >
> > I am trying to create some widgets  on the QScrollArea…I can create them
> on
> > a widget and set that widget to QScrollArea OR I can directly create on
> the
> > ScrollArea.
> >
> > When I am creating it on the widget and setting that widget on
> QScrollArea I
> > can see the controls but when I am creating on the QScrollArea directly
> not
> > setWidget() function then I am able to see them.
> >
> > Why  is this happening  any suggestions.
> >
> >
> >
> > e.g
> >
> > QScrollArea * area = new QScrollAreal;
> >
> > QWidget *wid = new QWidget(area);
> >
> > area->resize(800,600);
> >
> > area->setWidget(wid);
> >
> > area->show();
> >
> >
> >
> > QPushButton *button = new QPushButton(“click me”,wid);
> >
> > button->setGeometry(0,0,200,50);
> >
> > button->show();
> >
> > Kind Regards,
> >
> >
> >
> >
> >
> > This is not working. Instead if  I don’t create a widget and simply I put
> >
> > QPushButton *button = new QPushButton(“click me”,area);
> >
> >  Then its working . its creating the button…But in this case I cannot
> scroll
> > because there’s not widget to move…
> >
> > Please give some suggestions  Thanks sujan
> >
> >
> >
> >
> >
> > Sujan Dasmahapatra
> > Project Leader, Aero Group
> > Aero Group
> >
> > Tel    +91 80 66470248
> > Mob
> >
> > sdh at lmwindpower.com
> >
> >
> >
> > 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
> >
> >
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>



-- 
Thanks & Regards
Sujan Dasmahapatra
B.E. (Aeronautics)
Bangalore, India
Ph:91-9900839788
mail id : sujan.dasmahapatra at gmail.com
yahoo msn : dasmahapatra.aerodynamics at yahoo.co.in
icq # 556023244
skype:sujan.dasmahapatra at skyepe.com
msn: sujan.dasmahapatra at hotmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110718/d656faa8/attachment.html 


More information about the Qt-interest-old mailing list