[Qt-interest] Best way to implement a group of Widgets
Rohan Prabhu
rohan at rohanprabhu.com
Sat Feb 6 07:08:32 CET 2010
I want to implement a QWidget derived class which acts like a group of
widgets. I just need ideas on how to do it best. My concerns currently
are:
1. How to implement the paintEvent()? Inside the paintEvent() of my
Parent Widget, do I call the paintEvent() of every other child widget?
2. How do I handle positioning? I want that each child widget be
positioned by nothing but x and y co-ordiantes relative to the parent
widget. How do I go about doing this?
3. Each of my child widget will be QWidget derivates, not QWidgets, so
how do I implement the 'Widget stack' as Qt calls it. I also need to
implement it properly so that a widget higher in the stack goes on the
front or back of other widgets as appropriate.
4. Can I make my child widgets draggable?
I have tried doing a little thinking from my side. But, I've mostly
thought of a parent class with a QVector<CmWidget*> to hold my widgets
and I'm absolutely clueless of how to implement the paintEvent().
Any help is truly appreciated.
regards,
rohan
More information about the Qt-interest-old
mailing list