L
lou zion
hi all,
i've got a class that takes a parameterless function pointer as a parameter.
i want to store that function pointer in a variable and i'm trying to figure
out the syntax. i came up with the stuff below, but it's telling me it can't
convert from void *(void) to void(void), which i didn't think i was doing.
what's the proper syntax for defining and initializing a function pointer
like this?
thnks a bunch,
lou
class TabWatcher : public QObject
{
public:
TabWatcher( const char * name = 0, QWidget * NewFocusWidget = 0, void
*funcptr()=0 ) ;
~TabWatcher();
protected:
void (*FuncPtr)();
}
TabWatcher::TabWatcher( const char * name, QWidget * NewFocusWidget, void
*funcptr()) : QObject(parent,0),
newfocus(NewFocusWidget),
FuncPtr(funcptr)
{
}
i've got a class that takes a parameterless function pointer as a parameter.
i want to store that function pointer in a variable and i'm trying to figure
out the syntax. i came up with the stuff below, but it's telling me it can't
convert from void *(void) to void(void), which i didn't think i was doing.
what's the proper syntax for defining and initializing a function pointer
like this?
thnks a bunch,
lou
class TabWatcher : public QObject
{
public:
TabWatcher( const char * name = 0, QWidget * NewFocusWidget = 0, void
*funcptr()=0 ) ;
~TabWatcher();
protected:
void (*FuncPtr)();
}
TabWatcher::TabWatcher( const char * name, QWidget * NewFocusWidget, void
*funcptr()) : QObject(parent,0),
newfocus(NewFocusWidget),
FuncPtr(funcptr)
{
}