diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-07-30 11:56:50 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-07-31 10:21:14 +0200 |
commit | 8d283ffd1695b9d3accaaa58d40db82ac04fdf16 (patch) | |
tree | fe50c7caae8fa82a034d0d23e36ee365f23260e3 /src/plugins/cpptools/cppcompletion_test.cpp | |
parent | 05c6a5724f9479341a0ffc0839ae9ab597ac39d3 (diff) | |
download | qt-creator-8d283ffd1695b9d3accaaa58d40db82ac04fdf16.tar.gz |
CppTools: Hide "QPrivateSignal" on signal completion (Qt5)
See also http://woboq.com/blog/how-qt-signals-slots-work-part2-qt5.html
Task-number: QTCREATORBUG-8540
Change-Id: Iccad837d7a0da982e7d7a1eda95ff1828cf1dce6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcompletion_test.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcompletion_test.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 369f520cd2..017559bdca 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -2463,3 +2463,36 @@ void CppToolsPlugin::test_completion_recursive_using_typedef_declarations() QCOMPARE(completions.size(), 0); } + +void CppToolsPlugin::test_completion_signals_hide_QPrivateSignal() +{ + const QByteArray source = + "#define SIGNAL(a) #a\n" + "#define SLOT(a) #a\n" + "#define signals public\n" + "#define Q_OBJECT struct QPrivateSignal {};\n" + "\n" + "class QObject\n" + "{\n" + "public:\n" + " void connect(QObject *, char *, QObject *, char *);\n" + "};\n" + "\n" + "class Timer : public QObject\n" + "{\n" + " Q_OBJECT\n" + "signals:\n" + " void timeout(QPrivateSignal);\n" + "};\n" + "\n" + "void client()\n" + "{\n" + " Timer *timer = new Timer;\n" + " connect(timer, SIGNAL(@\n" + "}\n"; + CompletionTestCase test(source); + + const QStringList completions = test.getCompletions(); + QCOMPARE(completions.size(), 1); + QVERIFY(completions.contains(QLatin1String("timeout()"))); +} |