Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/cxx/TulipItemDelegate.cxx
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 namespace tlp {
00020 
00021 template<typename T>
00022 void TulipItemDelegate::registerCreator(tlp::TulipItemEditorCreator *c) {
00023   int id = qMetaTypeId<T>();
00024 
00025   if (_creators.contains(id))
00026     return;
00027 
00028   _creators[id] = c;
00029 }
00030 
00031 template<typename T>
00032 void TulipItemDelegate::unregisterCreator() {
00033   int id = qMetaTypeId<T>();
00034 
00035   if (_creators.contains(id))
00036     _creators.remove(id);
00037 }
00038 
00039 template<typename T>
00040 tlp::TulipItemEditorCreator* TulipItemDelegate::creator() const {
00041   return creator(qMetaTypeId<T>());
00042 }
00043 
00044 }
 All Classes Files Functions Variables Enumerations Enumerator Properties