Add a test case for the use of Q_PRIVATE_SLOT.

This commit is contained in:
Stephen Kelly 2011-11-22 22:26:42 +01:00
parent bde4edb6ab
commit 47457159c7
3 changed files with 42 additions and 1 deletions

View File

@ -13,7 +13,7 @@ add_definitions(-DFOO)
# create an executable and a library target, both requiring automoc: # create an executable and a library target, both requiring automoc:
add_library(codeeditorLib STATIC codeeditor.cpp) add_library(codeeditorLib STATIC codeeditor.cpp)
add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp) add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp private_slot.cpp)
set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE) set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE)

View File

@ -0,0 +1,21 @@
#include "private_slot.h"
class PrivateSlotPrivate
{
public:
void privateSlot()
{
}
};
PrivateSlot::PrivateSlot(QObject *parent)
: QObject(parent),
d(new PrivateSlotPrivate)
{
}
#include "private_slot.moc"

View File

@ -0,0 +1,20 @@
#ifndef PRIVATE_SLOT_H
#define PRIVATE_SLOT_H
#include <QObject>
class PrivateSlotPrivate;
class PrivateSlot : public QObject
{
Q_OBJECT
public:
PrivateSlot(QObject *parent = 0);
private:
PrivateSlotPrivate * const d;
Q_PRIVATE_SLOT(d, void privateSlot())
};
#endif