All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
#include <Cast.h>
Static Public Member Functions | |
template<typename TIn , typename TOut > | |
static TOut | getFirst (QList< TIn > list) |
template<typename T > | |
static T | getTab (QTabWidget *tab, QString tabName) |
TOut QGpGuiTools::Cast::getFirst | ( | QList< TIn > | list | ) | [static] |
Return the first element if list which can be casted to TOut type. List is of type QList<TIn>.
TIn and TOut are pointers to classes that inherit QObject.
{ typedef typename QList<TIn>::iterator ListIterator; ListIterator it; TOut obj; for(it=list.begin();it!=list.end();++it) { obj=qobject_cast<TOut>( *it); if(obj) return obj; } return 0; }
T QGpGuiTools::Cast::getTab | ( | QTabWidget * | tab, |
QString | tabName | ||
) | [static] |