Autogen: Add test for AUTOMOC_MACRO_NAMES

This commit is contained in:
Sebastian Holtermann
2017-08-18 12:29:50 +02:00
parent 93f0ba2823
commit 05891d8f77
5 changed files with 52 additions and 0 deletions

View File

@@ -65,6 +65,15 @@ add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySo
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
# -- Test
# MOC AUTOMOC_MACRO_NAMES
if (NOT QT_TEST_VERSION STREQUAL 4)
add_executable(mocMacroName mocMacroName/main.cpp mocMacroName/MacroName.cpp)
set_property(TARGET mocMacroName PROPERTY AUTOMOC ON)
set_property(TARGET mocMacroName PROPERTY AUTOMOC_MACRO_NAMES "QO_ALIAS")
target_link_libraries(mocMacroName ${QT_LIBRARIES})
endif()
# -- Test
# UIC only
if(ALLOW_WRAP_CPP)

View File

@@ -0,0 +1,7 @@
#ifndef MACROALIAS_HPP
#define MACROALIAS_HPP
#include <QObject>
#define QO_ALIAS Q_OBJECT
#endif

View File

@@ -0,0 +1,9 @@
#include "MacroName.hpp"
MacroName::MacroName()
{
}
void MacroName::aSlot()
{
}

View File

@@ -0,0 +1,20 @@
#ifndef MACRONAME_HPP
#define MACRONAME_HPP
#include "MacroAlias.hpp"
// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
class MacroName : public QObject
{
QO_ALIAS
public:
MacroName();
signals:
void aSignal();
public slots:
void aSlot();
};
#endif

View File

@@ -0,0 +1,7 @@
#include "MacroName.hpp"
int main(int argv, char** args)
{
MacroName macroName;
return 0;
}