Inconsistency between sample app and kde web site

Alan Chandler alan at chandlerfamily.org.uk
Sun Dec 15 11:31:39 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Using gideon (from CVS from 9th December) I created a simple kde app.

I am using gcc-3.2, and it fails to build, siting a problem with the view 
class - thus

 /home/alan/kbooked/src/kbookedview.cpp: In constructor   
`kbookedView::kbookedView(QWidget*)': /home/alan/kbooked/src/kbookedview.cpp:19: 
type `class DCOPObject' is not a   direct or virtual base of `kbookedView'


Since I using this to learn about kde - I went to the web site to find out 
what was happening with DCOPObject.  In the example there ( 
http://developer.kde.org/documentation/library/cvs-api/classref/dcop/index.html 
)they quote

"Alter the inheritance of this class such that it virtually inherits from 
MyInterface. Then add declarations to your class interface similar to those 
on MyInterface.h, but virtual, not pure virtual. 


Example: 

class MyClass: public QObject, virtual public MyInterface
{
  Q_OBJECT ...."

The code for this as created by gideon is 

class kbookedView : public QWidget, public kbookedIface
{
    Q_OBJECT


I checked back on kdevelop cvs for the template that created this and found 
the last change to this template made a few days ago by David Faure has the 
following comment.

"Amazing how one mistake long ago can propagate that much. Do _not_ use
virtual inheritance for DCOPObjects. It makes it very hard to pass a name
to the DCOPObject constructor - and there's no reason to use virtual 
inheritance
here anyway."

And the change is to take the "virtual" out of the class definition.

So there seems to be some inconsistency here.  [I assume that there is a 
problem with the web site example if David's comment is correct - but since I 
don't know enough to even fix my compile problem, who am I to say - I just 
thought someone should know]

I would also like some advice as to why my app fails to compile.

- -- 
Alan Chandler
alan at chandlerfamily.org.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE9/GgfuFHxcV2FFoIRApK2AJ431r2zynLCH0k7x9Rag1gQWLhqGgCgtSH8
krVe+2TZ2/Ak+g/VbWtJAfk=
=BBS8
-----END PGP SIGNATURE-----


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list