mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-16 07:28:23 -05:00
Autogen: Tests: Extend AUTOUIC include patterns test
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
# Autogen tests common for Qt4 and Qt5
|
# Autogen tests common for Qt4 and Qt5
|
||||||
ADD_AUTOGEN_TEST(MocOnly mocOnly)
|
ADD_AUTOGEN_TEST(MocOnly mocOnly)
|
||||||
ADD_AUTOGEN_TEST(MocOptions mocOptions)
|
ADD_AUTOGEN_TEST(MocOptions mocOptions)
|
||||||
if(QT_TEST_ALLOW_QT_MACROS)
|
ADD_AUTOGEN_TEST(UicOnly uicOnly)
|
||||||
ADD_AUTOGEN_TEST(UicOnly uicOnly)
|
|
||||||
endif()
|
|
||||||
ADD_AUTOGEN_TEST(RccOnly rccOnly)
|
ADD_AUTOGEN_TEST(RccOnly rccOnly)
|
||||||
ADD_AUTOGEN_TEST(RccEmpty rccEmpty)
|
ADD_AUTOGEN_TEST(RccEmpty rccEmpty)
|
||||||
ADD_AUTOGEN_TEST(RccOffMocLibrary)
|
ADD_AUTOGEN_TEST(RccOffMocLibrary)
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ project(UicOnly)
|
|||||||
include("../AutogenTest.cmake")
|
include("../AutogenTest.cmake")
|
||||||
|
|
||||||
# Test AUTOUIC being enabled only
|
# Test AUTOUIC being enabled only
|
||||||
# The moc is provided by the Qt macro
|
add_executable(uicOnly main.cpp UicOnly.cpp)
|
||||||
qtx_wrap_cpp(uicOnlyMoc uiconly.h)
|
|
||||||
add_executable(uicOnly uiconly.cpp ${uicOnlyMoc})
|
|
||||||
set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
|
set_property(TARGET uicOnly PROPERTY AUTOUIC ON)
|
||||||
target_link_libraries(uicOnly ${QT_LIBRARIES})
|
target_link_libraries(uicOnly ${QT_LIBRARIES})
|
||||||
|
|||||||
18
Tests/QtAutogen/UicOnly/UicOnly.cpp
Normal file
18
Tests/QtAutogen/UicOnly/UicOnly.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#include "ui_uiC.h"
|
||||||
|
#include "ui_uiD.h"
|
||||||
|
// AUTOUIC includes on the first two lines of a source file
|
||||||
|
#include "UicOnly.hpp"
|
||||||
|
|
||||||
|
UicOnly::UicOnly()
|
||||||
|
: uiA(new Ui::UiA)
|
||||||
|
, uiB(new Ui::UiB)
|
||||||
|
{
|
||||||
|
Ui::UiC uiC;
|
||||||
|
Ui::UiD uiD;
|
||||||
|
}
|
||||||
|
|
||||||
|
UicOnly::~UicOnly()
|
||||||
|
{
|
||||||
|
delete uiB;
|
||||||
|
delete uiA;
|
||||||
|
}
|
||||||
15
Tests/QtAutogen/UicOnly/UicOnly.hpp
Normal file
15
Tests/QtAutogen/UicOnly/UicOnly.hpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include "ui_uiA.h"
|
||||||
|
#include "ui_uiB.h"
|
||||||
|
// AUTOUIC includes on the first two lines of a header file
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class UicOnly : public QObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UicOnly();
|
||||||
|
~UicOnly();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::UiA* uiA;
|
||||||
|
Ui::UiB* uiB;
|
||||||
|
};
|
||||||
7
Tests/QtAutogen/UicOnly/main.cpp
Normal file
7
Tests/QtAutogen/UicOnly/main.cpp
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include "UicOnly.hpp"
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
UicOnly uicOnly;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>UicOnly</class>
|
<class>UiA</class>
|
||||||
<widget class="QWidget" name="UicOnly">
|
<widget class="QWidget" name="UiA">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
24
Tests/QtAutogen/UicOnly/uiB.ui
Normal file
24
Tests/QtAutogen/UicOnly/uiB.ui
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>UiB</class>
|
||||||
|
<widget class="QWidget" name="UiB">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
24
Tests/QtAutogen/UicOnly/uiC.ui
Normal file
24
Tests/QtAutogen/UicOnly/uiC.ui
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>UiC</class>
|
||||||
|
<widget class="QWidget" name="UiC">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
24
Tests/QtAutogen/UicOnly/uiD.ui
Normal file
24
Tests/QtAutogen/UicOnly/uiD.ui
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>UiD</class>
|
||||||
|
<widget class="QWidget" name="UiD">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeView" name="treeView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
|
|
||||||
#include "uiconly.h"
|
|
||||||
|
|
||||||
UicOnly::UicOnly(QWidget* parent)
|
|
||||||
: QWidget(parent)
|
|
||||||
, ui(new Ui::UicOnly)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
UicOnly::~UicOnly()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
#ifndef UIC_ONLY_H
|
|
||||||
#define UIC_ONLY_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include "ui_uiconly.h"
|
|
||||||
|
|
||||||
class UicOnly : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit UicOnly(QWidget* parent = 0);
|
|
||||||
~UicOnly();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Ui::UicOnly* ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user