On 23 December 2010 18:10, Michael Pyne wrote: > On Thursday, December 23, 2010 18:02:36 Steven Sroka wrote: >> I need some help with a KDE program I'm trying to write. >> I have my main function calling a custom class, KReminder(), which is >> sub-classed from KDialogButtonBox. Within the KReminder() I have: >> >> KPushButton *nextButton = addButton(nextGuiItem, AcceptRole, this, >> SLOT(next())); >> >> 'this' refers to KReminder(). The 'addButton' function expects the >> third argument to be a QObject* and not a KReminder* const, so I'm >> getting an error. I've tried the KDE forums, but I haven't found a fix >> for this. > > Whatever KReminder member function you're in is declared to be const. That > changes the type of this from KReminder* to KReminder *const. I'm in setupObjects(), which is not declared as const. Only a slot and my d-pointer are declared const. setupObjects() is declared in my .h file as: private: void setupObjects(); > Either make that member function non-const, or don't do things which can > mutate that object (addButton needs to update structures within the QObject > you're subclassing so there's no way it's a const method). > > Regards, >  - Michael Pyne > > >>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << > > -- Steven Sroka >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<