From: Martin T. <lkb...@gm...> - 2007-11-12 10:51:48
|
Hi, > > There > > may be a reason it was done in the less straightforward way that aren't > > obvious to you or I (perhaps to ease embedding... just guessing). > > I don't think we can use the QMainWindow's addToolBar for this. It creates a > single toolbar for the entire window, but what if we want to add two > canveses, each with its own toolbar, in a single window? I am writing an > application that does this. Well, technically this is not a problem, since you can add several toolbars with addToolBar. But well, you are right, this would look awkward, two times the same toolbar... But anyhow, I am calling addToolBar in the class FigureManagerQT, which is not able to handle more than one plot in a window it seems to me (am I missing something?). If, on the other hand, you create your own QMainWindow, there is no problem putting the toolbar like it was done classically. I added an example for that to the patch request ID 1828848 (Qt4 backend improvement). I don't know your code, but it is possible, maybe even probable, that it works even with my modifications, as I did not change the class structure. Only possible incompatibilities I could see is if you are inheriting FigureManagerQT and doing something in there. So in the end I think my patch is still a good idea. It might be needed to change it to keep compatibility with old code, though. Greetings, Martin |