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.

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

Attachment: signature.asc
Description: This is a digitally signed message part.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to