PDA

View Full Version : Using QRubberBand class?!?!?



nupul
1st April 2006, 07:05
hi i wish to use the QRubberBand class to select the Icons put forth by QListView (i.e ViewMode is set to show Icons). Can this selection happen automatically or will I have to explicitly create a rubberband object to do this??

I did read the Qt4 doc, but I was not able to understand as how do I put the rubberband to use, w.r.t. the above scenario????

Thanks

Nupul

wysota
1st April 2006, 08:29
Did you at least try using a list view before posting? Rubber band is drawn automatically. You would have known if you tried it (for example by putting a list view in Designer and previewing).

nupul
1st April 2006, 16:10
thanks wysota,...

I actuall tried it again...(code problems!!! ;) )and it worked.

Well the reason i put forth this doubt was basically to know when does one explicitly need to use the QRubberBand Class.............

wysota
1st April 2006, 17:19
To be honest? I don't know. Even the Trolls don't use it in their examples (at least I haven't seen it in use). They use QStyle::drawControl() with QStyle::CE_RubberBand.

I guess it could be used if you wanted the band to be persistent and stretchable/movable. If you just need to draw a band during mouse dragging and don't intend to interact with the rubber band, you can use drawControl() instead.