diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/forward-declared-param.h | 76 | ||||
-rw-r--r-- | tests/auto/tools/moc/moc.pro | 1 |
2 files changed, 77 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/forward-declared-param.h b/tests/auto/tools/moc/forward-declared-param.h new file mode 100644 index 0000000000..9e0769f36c --- /dev/null +++ b/tests/auto/tools/moc/forward-declared-param.h @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Intel Corporation +** Contact: http://www.qt-project.org/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qobject.h> +#include <qmetatype.h> + +// test support for const refs to forward-declared structs in parameters + +struct ForwardDeclaredParam; +template <typename T> class ForwardDeclaredContainer; + +struct FullyDefined {}; +Q_DECLARE_METATYPE(FullyDefined) + +class ForwardDeclaredParamClass : public QObject +{ + Q_OBJECT +public slots: + void slotNaked(const ForwardDeclaredParam &) {} + void slotFDC(const ForwardDeclaredContainer<ForwardDeclaredParam> &) {} + void slotFDC(const ForwardDeclaredContainer<int> &) {} + void slotFDC(const ForwardDeclaredContainer<QString> &) {} + void slotFDC(const ForwardDeclaredContainer<FullyDefined> &) {} + void slotQSet(const QSet<ForwardDeclaredParam> &) {} + void slotQSet(const QSet<int> &) {} + void slotQSet(const QSet<QString> &) {} + void slotQSet(const QSet<FullyDefined> &) {} + +signals: + void signalNaked(const ForwardDeclaredParam &); + void signalFDC(const ForwardDeclaredContainer<ForwardDeclaredParam> &); + void signalFDC(const ForwardDeclaredContainer<int> &); + void signalFDC(const ForwardDeclaredContainer<QString> &); + void signalFDC(const ForwardDeclaredContainer<FullyDefined> &); + void signalQSet(const QSet<ForwardDeclaredParam> &); + void signalQSet(const QSet<int> &); + void signalQSet(const QSet<QString> &); + void signalQSet(const QSet<FullyDefined> &); +};
\ No newline at end of file diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index b3ed5df469..0932f5a471 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -21,6 +21,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n task234909.h task240368.h pure-virtual-signals.h cxx11-enums.h \ cxx11-final-classes.h \ cxx11-explicit-override-control.h \ + forward-declared-param.h \ if(*-g++*|*-icc*|*-clang*|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h |