Add a test case for the use of Q_PRIVATE_SLOT.
This commit is contained in:
parent
bde4edb6ab
commit
47457159c7
|
@ -13,7 +13,7 @@ add_definitions(-DFOO)
|
|||
# create an executable and a library target, both requiring automoc:
|
||||
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)
|
||||
|
||||
|
|
|
@ -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"
|
|
@ -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
|
Loading…
Reference in New Issue