User:Jcc242
Stuff
http://stevelosh.com/blog/2013/09/teach-dont-tell/
ToDo
Creating your own class for Drawing Workbench. This is a rundown for the ViewTemplate.
Files to add:
App/FeatureViewTemplate.cp/.h
FeatureViewTemplate ~FeatureViewTemplate execute
Gui/QGraphicsViewTemplate.cpp/.h
public: explicit QGraphicsItemViewTemplate(const QPoint &position, QGraphicsScene *scene); ~QGraphicsItemViewTemplate(); setViewPartFeature
Files to edit:
App/CMakeLists.txt
Simply add the App/FeatureViewTemplate.cpp/.h files to the CMakeLists.txt. Add these under the SET(Feature_SRCS ... ) section.
App/AppDrawing.cpp
Include App/FeatureViewTemplate.h and add your class to the list of classes.
Gui/Command.cpp
This is where the stuff happens when your button is clicked (the button is added to the toolbar in Workbench.cpp, see below). You only need to include your App/FeatureViewTemplate.h file. At the bottom make sure to add your command to the list in the CreateDrawingCommands method.
The activated() is the main loop where all the work will be done to do whatever you want.
Gui/CanvasView.cpp/.h
The actual QGraphicsScene object. Adds objects to the scene. Needs to have a way to add QGraphicsSvgItem to it.
Added addViewTemplate(Drawing::FeatureViewTemplate *template);
Gui/CMakeLists.txt
Add the Gui/QGraphicsViewTemplate.cpp/.h to the CMakeLists.txt.
Gui/Workbench.cpp/.h
Adds icons to workbench toolbars and stuff.
Gui/DrawingView.cpp/.h
Add stuff to identify and add template to the scene? In particular, see attachPageObject()
ViewProviderView.cpp/.h (or ViewProviderPage?)
Not sure if I need this yet.