View Issue Details

IDProjectCategoryView StatusLast Update
0000477FreeCADFeaturepublic2018-06-13 13:25
Reporterwmayer Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status acknowledgedResolutionopen 
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.
FreeCAD Information

Relationships

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

Activities

Jriegel

2011-11-21 09:13

administrator   ~0001337

Really needed!

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.

wmayer

2017-03-20 13:52

administrator   ~0008659

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

Kunda1

2017-06-30 12:14

administrator   ~0009622

Also see wmayer's comment 0001954:0007874

Kunda1

2018-06-13 13:25

administrator   ~0011421

Unassigning Jriegel

Related Changesets

FreeCAD: master 9ce46db8

2015-03-31 01:02:16

wmayer

Details Diff
+ extend ActionFunction and use in mesh view provider Affected Issues
0000477
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
2017-06-30 12:14 Kunda1 Note Added: 0009622
2018-06-13 13:25 Kunda1 Assigned To Jriegel =>
2018-06-13 13:25 Kunda1 Note Added: 0011421