mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-04 04:03:22 +03:00
Autogen: Q_OBJECT behind brace test
This commit is contained in:
1 parent
01d2b745aa
commit
50b3837c64
6 files changed
+65
-9
No files matched your search
@@ -60,6 +60,21 @@ if(NON_ASCII_BDIR AND WIN32)
|
||||
set(ALLOW_WRAP_CPP FALSE)
|
||||
endif()
|
||||
|
||||
# -- Test
|
||||
# MOC only
|
||||
add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySource/StyleB.cpp)
|
||||
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
|
||||
target_link_libraries(mocOnly ${QT_LIBRARIES})
|
||||
|
||||
# -- Test
|
||||
# UIC only
|
||||
if(ALLOW_WRAP_CPP)
|
||||
qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
|
||||
add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
|
||||
set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
|
||||
target_link_libraries(uicOnly ${QT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# -- Test
|
||||
# RCC only
|
||||
add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc)
|
||||
@@ -72,15 +87,6 @@ add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc)
|
||||
set_property(TARGET rccEmpty PROPERTY AUTORCC ON)
|
||||
target_link_libraries(rccEmpty ${QT_QTCORE_TARGET})
|
||||
|
||||
# -- Test
|
||||
# UIC only
|
||||
if(ALLOW_WRAP_CPP)
|
||||
qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
|
||||
add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc})
|
||||
set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
|
||||
target_link_libraries(uicOnly ${QT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# -- Test
|
||||
# Add not_generated_file.qrc to the source list to get the file-level
|
||||
# dependency, but don't generate a c++ file from it. Disable the AUTORCC
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "StyleA.hpp"
|
||||
|
||||
StyleA::StyleA()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef STYLEA_HPP
|
||||
#define STYLEA_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
/// Q_OBJECT on a single new line
|
||||
///
|
||||
class StyleA : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StyleA();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,5 @@
|
||||
#include "StyleB.hpp"
|
||||
|
||||
StyleB::StyleB()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef STYLEB_HPP
|
||||
#define STYLEB_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
/* clang-format off */
|
||||
/// Q_OBJECT behind a brace
|
||||
///
|
||||
class StyleB : public QObject
|
||||
{ Q_OBJECT
|
||||
public:
|
||||
StyleB();
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#include "StyleA.hpp"
|
||||
#include "StyleB.hpp"
|
||||
|
||||
int main(int argv, char** args)
|
||||
{
|
||||
StyleA styleA;
|
||||
StyleB styleB;
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user