[Kde-pim] problem when integration kdepim4 package in my project

Kevin Krammer krammer at kde.org
Fri Nov 9 18:28:08 GMT 2012


On Friday, 2012-11-09, Michaƫl Parchet wrote:
> > Hello,
> > 
> > I would like to integrate, and possibly adapt  some kdepim4 component in
> > my qt project such as address book,  diary, contact editor etc...
> > 
> > When I try to call components from my code and try to compile, I get
> > thees errors (see attachment for more details).
> > 
> > Here is an extract of my code.
> > 
> > #include "kdepim-4.8.5/kaddressbook/mainwidget.h"

This looks wrong. I seems you are trying to include a header from a program 
instead of a library header.
If you want to modify KAddressBook you can do that directly in its source. Any 
other use case of its main window doesn't make much sense.

Your code snippet suggest that you are trying to create a new program so it is 
likely that you will want your own main window.

> > #include <KDE/KABC/AddresseeDialog>

No idea about how mac ports handles libraries, but usually that would be just
#include <KABC/AddreseeDialog>

> > int main(int argc, char *argv[])
> > {
> > 
> > 

From a Qt point of view this is missing the creation of the QApplication 
object, from a KDE point of view it is missing the KApplication object.
(either one is usually the first thing a main() function creates).

> > wiget.show();

From a C++ point of view this looks very wrong.
widet is not declared anywhere here in main.
Is this some kind of global object?


> >     KABC::AddresseeDialog dialog = new KABC::AddresseeDialog(w);

From a C++ point of view this looks like a syntax error. The new operator 
returns a pointer to the specified type.

> >     w.show();

w doesn't seem to be defined either?

> >     dialog.show();
> >     
> >     
> >     return a.exec();

a doesn't seemto be defined either?

Given that the above code snippet makes no sense whatsoever in C++, I have to 
assume this is a language which just has some similarites with C++.
It doesn't look like Objective C either, but I don't know enough about it to 
be sure. Could help to know which language you are trying to use here.

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20121109/eea1cc32/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list