Dock widgets have recently been introduced to replace the TabWidget on the left. The KML editor plugin (src/plugins/render/annotate) should provide its own dock widget for user interaction as well, replacing the currently used toolbar.
- Extend RenderPlugin by a new method equal or similar to
virtual QWidget* createDockWidget() const
with a default implementation doing nothing (returning 0).
- Extend QtMainWindow.cpp and marble_part.cpp to create dock widgets from render plugins that return a createDockWidget() != 0.
- Move the existing toolbar in src/plugins/render/annotate to a QWidget* that is returned in the overridden createDockWidget() method. Remove the part from it where the toolbar actions are returned.
- Optionally add a QTreeView to the same window which shows the outline of the currently edited KML file (using the existing TreeModel).
When done, the existing KML editor toolbar shouldn't be shown in the main application toolbar anymore, but in its own dock widget (with the title "KML Editor" or "Map Editor").
Created attachment 78909 [details]
KML Editor Dock Widget replacing the previous toolbar used to display the actions provided by the annotate plugin
I wonder if RenderPlugins should really depend on QWidget. I could well imagine that QWidgets are not available on every platform Qt 5.x will support, so this dependency could hit us hard when targeting these platforms. A quick'n'dirty fix would probably be to introduce an interface similar to the Marble::DialogConfigurationInterface.
Git commit 37977619162f91285b7862ac8dab5578d229f6e2 by Dennis Nienhüser, on behalf of Adrian Draghici.
Committed on 16/04/2013 at 20:59.
Pushed by nienhueser into branch 'master'.
KML Editor Dock Widget
M +18 -0 src/QtMainWindow.cpp
M +1 -0 src/QtMainWindow.h
M +1 -1 src/lib/BranchFilterProxyModel.h
M +5 -0 src/lib/RenderPlugin.cpp
M +12 -0 src/lib/RenderPlugin.h
M +131 -100 src/plugins/render/annotate/AnnotatePlugin.cpp
M +6 -1 src/plugins/render/annotate/AnnotatePlugin.h
(In reply to comment #2)
> I wonder if RenderPlugins should really depend on QWidget. I could well
> imagine that QWidgets are not available on every platform Qt 5.x will
> support, so this dependency could hit us hard when targeting these
> platforms. A quick'n'dirty fix would probably be to introduce an interface
> similar to the Marble::DialogConfigurationInterface.
Currently QDockWidget is only introduced as a forward declaration in RenderPlugin.h. Not using things from QtGui is too much planning ahead in my opinion and too restrictive. If we ever run into the problem of Qt classes missing on a target platform (Qt is platform independent after all) and Qt guys haven't thought of a solution ahead, we can still adjust things.