Re: Packing plots into a QLayout
Brought to you by:
rathmann
From: Hendrik V. <HVe...@gm...> - 2013-08-30 15:43:38
|
Hi Uwe, thanks for your comments and for correcting my (and I apologize for this) somewhat poorly researched statements. Just one more follow-up question: > > Moreover, the plot will accept any > > QWidget as a canvas and does not really use any specific functionality > > of the canvas. > > Well this is not completely true: methods of a canvas are called at > several places using QMetaObject::invokeMethod(). Both types of canvases > offer these methods with the same signature via this API. > > > Have you tried using just a QWidget instead of the > > QwtPlotCanvas? > > Better don't try ! Agreed, it's silly, but now that you said it, I had to try and it works, in the sense that it doesn't crash (thank's to the "// fallback, when canvas has no a replot method") but just shows that widget instead of the canvas (and does not plot because that's the invokeMethod()'s role). Actually I was sort of hoping for this to fail at some point but couldn't quite find that code (I'm new to QMetaObject). Hence my question: Is this really intended to essentially disable type checking? I understand that probably the most obvious alternatives lead to some sort of "diamond of death" (http://cpptips.com/case_for_mi), but it still leaves an uneasy feeling behind... Best wishes, Hendrik |