Hi,

I'm not sure if this is a bug or intentional, but the kde4 moc magic is
missing some of my classes. Basically I have two QObject classes, one
defined in the header file and the other in the corresponding source
file. The created moc file only contains the stuff for the second class.
Example attached.
No problems when both classes are defined in the same file.

michael

#include <QtCore/QObject>

#ifndef _FOO_H_
#define _FOO_H_

class A : public QObject
{
    friend int main();
    Q_OBJECT

    Q_SIGNALS:
        void foo();
};

#endif

#include "foo.h"

class B : public QObject
{
    friend int main();
    Q_OBJECT

    public Q_SLOTS:
        void moo()
        {
        }
    Q_SIGNALS:
        void bar();
};

int main()
{
    A a;
    B b;

    QObject::connect(&a, SIGNAL(foo()), &b, SLOT(moo()));
    QObject::connect(&b, SIGNAL(bar()), &b, SLOT(moo()));
    a.foo();
    b.bar();
    return 0;
}

#include "foo.moc"

project(foobar)

find_package(KDE4 REQUIRED)
include (KDE4Defaults)

include_directories (${KDE4_INCLUDES})

include_directories(${KDEBASE_WORKSPACE_SOURCE_DIR}/libs)

set(foo_SRCS
    foo.cpp
)

kde4_add_executable(foo ${foo_SRCS})
target_link_libraries(foo  ${KDE4_KDECORE_LIBS})

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to