Registered Member
|
In KDialogBoxButton::addButton() what is the third argument?
The QObject *receiver=0 part of it. I'm trying to put in:
But, I don't know what to put into the third argument. |
Administrator
|
The third argument is the object that will have the slot specified in argument 4 invoked upon it. I gather you have a slot called next() in the class you are currently in? If so, try the following:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
The third argument expects a QObject*, but the class that the slot next() is in, is my custom class derived from KDialogButtonBox(), so I get an error about not having a matching function call.
I'm essentially passing in KReminder* const (when I type 'this' into the third argument), but it expects a QObject*. Is there anyway around this? |
Administrator
|
Is the object which is the parent to your KDialogButtonBox a QWidget? Usually this is subclassed as well, so you should be doing the setup there.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
No, the parent is not an object at all. I have it setup as:
<main.cpp>
<kreminder.cpp>
main constructs an instance of KReminder which is subclassed from KDialogButtonBox(). |
Administrator
|
I see. KReminder looks like a KDE PIM class, so I suggest you contact the KDE PIM development team for assistance, as they will know how to best use that class. kde-pim@kde.org.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Hmmm, no not a PIM class.
KReminder is what I'm making myself from scratch. I'm making a program that reminds me of appointments (you know, like the other billion programs that do this.) I'm just using this to get my feet wet in KDE programming. I'll try kde-devel, see what they have to say. |
Registered Member
|
I think someone from kde-devel pinned it down to that fact that the error message says I'm trying to pass in a const.
As I have not declared my class as const, we have no idea where it is coming from. Any suggestions? |
Administrator
|
It is probable the function you are currently in is declared, either at the Qt or KDE level as const.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
What the hell is this?
Obvious a bad hack, but this made my code compile. I'm dereferencing a pointer then getting its' memory address? How would this work? I have a feeling that my program will explode if I try running it. Any ideas why this allows my code to compile? |
Administrator
|
It likely removes the const-ness from the pointer. You can also do this with "const_cast<YourType*>( this );"
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]