[Kstars-devel] info boxes

Khudyakov Alexey alexey.skladnoy at gmail.com
Sat Dec 5 22:25:57 CET 2009


В сообщении от Суббота 05 декабря 2009 21:11:39 Lukas Middendorf написал:
> Hi,
> 
> I have messed around with the info boxes a bit and would like to have some
> feedback.
> 
> I implemented some code to use the "sticky" integers from options to
>  prevent the info boxes from floating in the center of the skymap or
>  outside of visible range after window resize. I have attached my result,u
>  the debug-patch shows the stickyness of the info boxes through their
>  background colors. I guess there is something terribly wrong with my
>  approach, please tell me what it is.
> 
Unfortunately. I already implemented stickyness. So it was wasted work.

It seems that it should work. There is nothing criminal at first sight. Only 
thing I which could be problematic is adjustment of position in resizeEvent.
However this could cause no problems. 

Also there is no need for frindship between InfoBoxWidget and InfoBoxes.

Thnak you for your efforts. 

> In SkyMap::~SkyMap() the state of the info boxes is stored to the Options.
>  It seems as if "m_iboxes->isVisible()" allways returns false at this point
>  and therefore the boxes are always hidden on program start. If I use the
>  state of the checkbox instead, it seems to work. What is the problem here?
> 
It turns out that in destructor SkyMap is invisible so all its subwidgets are 
invisible too. Thus right way to check visibility is to use 
isVisibleTo( parent_widget )

> I'm wondering where the info boxes are deleted on program termination. Does
>  it happen at all?
> 
Yes, they are deleted by QObject destructor since they are owned by SkyMap.
Qt has kind of garbage collection. Very handy


More information about the Kstars-devel mailing list