On Thu, Dec 03, 2015 at 09:52:28PM +0000, Sebastian Kügler wrote: > On Thursday, December 03, 2015 13:33:48 Dirk Hohndel wrote: > > > A couple of things I have found: > > > 1) The profile scaling seems to get confused if I switch between portrait > > > and landscape. The vertical size of the plot stays at the same scale as > > > the first one drawn. > > Yes - the reason is the way the pixmap gets computed. I need to figure out > > how to be notified if the geometry changes (landscape/portrait rotation) > > so it can be re-calculated. > > > > My bet is that the paint is actually called again, but because of the > > asynchronous nature of all this I have moved the code that would need to > > be called out of the paint function... > > > > I knew my fix was too easy > You could try hooking up this guy > http://doc.qt.io/qt-5/qquickitem.html#geometryChanged > > to the second part of setDiveId(), so the geometry of the hidden profilewidget > gets updated. Not sure if that helps with the race, though, but it could even > be tried to force (in render(), checking if the size is still synced, and > potentially calling profileWidget->setGeometry(...) first before painting.
I remember Tomaz telling me to be very very careful what I call from within paint. Both for performance issues but also for infinite recursions. > BTW, if you're looking how to get the qDebug() output visible on the Android > device, run logcat on the host with the device connected: > > adb logcat -s Subsurface:V Oh yeah, I've been doing this the whole time when trying to debug the profile drawing... that's how I figured out what was going wrong :-) /D _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
