[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Help with KDialogButtonBox
From: Steven Sroka <sroka.steven () gmail ! com>
Date: 2010-12-23 23:55:35
Message-ID: AANLkTimdJJLHqBhHvpvBzVHS8XZ8=N9tk_Ma5zm9mFgN () mail ! gmail ! com
[Download RAW message or body]
On 23 December 2010 18:10, Michael Pyne <mpyne@kde.org> 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 <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic