Refactoring #1472

Introduce additional template parameter for IFactory to be able to use QString as a key

Added by pospelov over 3 years ago. Updated over 3 years ago.

Status:ArchivedStart date:20 Jun 2016
Priority:NormalDue date:
Assignee:herck% Done:

0%

Category:-
Target version:Sprint 31

Description

I need IFactory to accept QString as key, to be able to write in GUI
resiterItem(QString("Color Map"), &createInstance<ColorMapWidget>)

or similar way using std::function for item creation.

and then use it
QWidget *createItem(QString("Color Map");

Suggestion is also to get rid from methods setOwnObject(true)

History

#1 Updated by herck over 3 years ago

  • Assignee set to herck

#2 Updated by herck over 3 years ago

  • Status changed from Sprint to Resolved

IFactory can now be customized by key-type and no longer needs build function templates that explicitly return base pointers, because the underlying std::function is return type covariant

#3 Updated by herck over 3 years ago

  • Status changed from Resolved to Archived

Also available in: Atom PDF