mavlink/qgroundcontrol — pull request #1159 by DonLakeFlyer (2014-12-30 03:31:51+00:00)
Title: Main window central view and dock widget re-architecture

This is a pretty major change to both how the central view in MainWindow works as well as DockWidgets. The initial driver was to fix issue with QML not working as a MainWindow central widget. Although not fully proved, I believe the issue is associated with the central view being a stacked widget and the contents of the stacked widgets being child QMainWindow's. I think these nested QMainWindow's were confusing Qt. In general the previous setup seemed like a dangerous hack usage of QMainWindow.

Here is what is different:
* The central view is no longer a stacked widget. A single view is added to the central widget layout and removed as needed.
* Central Views (Setup, Plan, Fly, ...) are only created as they are needed instead of creating all of them at boot time.
* There is now a single set of Dock Widgets which are used by all views and available to all views.
* DockWidgets are only created when they are needed, not all at boot.
* Each view still has it's own seperate saved window state and set of visible dock widgets just like it did before.
* The change was so major I had to bump the settings version which is going to cause previous settings to be tossed. I tried to avoid this, but got too paranoid with such a major change that it would just lead to subtle bugs which were just saved settings issues.
* Almost forgot the thing that may annoy people (other than having to trash previous settings): I got rid of the "Advanced Mode" and "Show Titlebars" settings. It now always shows title bars and you can always drag to re-order widgets. I would like to try it this way to simplify random settings and menu items. If it makes people crazy I'll put it back the way it was before. Keep in mind that I have a plan to completely re-do the main window widget infrastructure to be able to have a more 21st Century ui where the widgets float above the main view instead of taking up space from it. This will lead to a much more usable UI for both PC and tablet. I removed these settings to start working my way towards that new ui.

I ran memory usage numbers on OS X by booting to Fly view and connecting:
* Before change: 131M
* After change: 82M

So as you can see a really significant reduction in memory usage. CPU usage show go down as well since there are fewer duplicate widgets chewing up CPU. Fingers crossed that this will fix the QML main window problems as well.