View Issue Details

IDProjectCategoryView StatusLast Update
0000477FreeCADFeaturepublic2017-03-20 13:52
ReporterwmayerAssigned ToJriegel 
PrioritynormalSeverityminorReproducibilityhave not tried
Status acknowledgedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000477: Proper interface for edit modes of view provider
Descriptionhttp://forum.freecadweb.org/viewtopic.php?f=10&t=1875&p=12429#p12429
TagsNo tags attached.

Relationships

related to 0001954 assignedwmayer Set colors doesn't work on objects that have edit mode reimplemented 

Activities

2011-11-10 15:28wmayerNew Issue
2011-11-10 18:01wmayerTarget Version => 0.13

Jriegel

2011-11-21 09:13

administrator   ~0001337

Really needed!
2011-11-21 09:13JriegelAssigned To => Jriegel
2011-11-21 09:13JriegelStatusnew => acknowledged
2012-11-13 20:24JriegelTarget Version0.13 => 0.14
2014-06-25 12:09wmayerTarget Version0.14 => 0.15
2014-12-31 19:37normandcDescription UpdatedView Revisions
2015-01-25 16:14yorikTarget Version0.15 =>
2015-03-31 08:20wmayerChangeset attached => FreeCAD Master master 9ce46db8

wmayer

2015-03-31 08:38

administrator   ~0005958

There is a new class ActionFunction which allows you to connect a QAction with a standard C++ member function of a class that is not inherited from QObject.

So, this makes it quite easy to use with the view providers. There is an example for MeshGui::ViewProvider.

In the setupContextMenu method you get a pointer to a QMenu instance where you can add further items with addAction. The returned QAction instance then can be connected with a member function of the view provider using the ActionFunction class.

Since you can use arbitrary member functions (but the argument and return type must be void) this solution can be considered as an alternative to the setEdit function.
2017-01-19 12:20wmayerRelationship addedrelated to 0001954

wmayer

2017-03-20 13:52

administrator   ~0008659

See also: https://forum.freecadweb.org/viewtopic.php?f=22&t=21330

Related Changesets

FreeCAD: master 9ce46db8

2015-03-31 01:02:16

wmayer

Details Diff
+ extend ActionFunction and use in mesh view provider
mod - src/Gui/ActionFunction.cpp Diff File
mod - src/Gui/ActionFunction.h Diff File
mod - src/Mod/Mesh/Gui/ViewProvider.cpp Diff File
mod - src/Mod/Mesh/Gui/ViewProvider.h Diff File

Issue History

Date Modified Username Field Change
2011-11-10 15:28 wmayer New Issue
2011-11-10 18:01 wmayer Target Version => 0.13
2011-11-21 09:13 Jriegel Note Added: 0001337
2011-11-21 09:13 Jriegel Assigned To => Jriegel
2011-11-21 09:13 Jriegel Status new => acknowledged
2012-11-13 20:24 Jriegel Target Version 0.13 => 0.14
2014-06-25 12:09 wmayer Target Version 0.14 => 0.15
2014-12-31 19:37 normandc Description Updated View Revisions
2015-01-25 16:14 yorik Target Version 0.15 =>
2015-03-31 08:20 wmayer Changeset attached => FreeCAD Master master 9ce46db8
2015-03-31 08:38 wmayer Note Added: 0005958
2017-01-19 12:20 wmayer Relationship added related to 0001954
2017-03-20 13:52 wmayer Note Added: 0008659