diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-11-20 17:24:07 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-11-26 11:52:45 +0100 |
commit | 204cc21f0cc10fe268c1ab6b54e9916e8c98a316 (patch) | |
tree | 5438789939587eb62fe81c035145611ba2dd3cba /tests/designer | |
parent | da7b861e694ab433b5a44af663dbdab9e88d7ca5 (diff) | |
download | qt-creator-204cc21f0cc10fe268c1ab6b54e9916e8c98a316.tar.gz |
Designer: Insert into correct class for "Go to slot"
Make use of LookupContext to find the right class.
Task-number: QTCREATORBUG-10348
Change-Id: I7f8ec769ff2239d5123726e562a1bd430f8c4567
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'tests/designer')
7 files changed, 158 insertions, 0 deletions
diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp new file mode 100644 index 0000000000..5e246d377b --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.cpp @@ -0,0 +1,9 @@ +// Copyright header + +#include "form.h" + +Form::Form(QWidget *parent) : + QWidget(parent) +{ + ui.setupUi(this); +} diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h new file mode 100644 index 0000000000..4f35262bea --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_non-pointer/form.h @@ -0,0 +1,27 @@ +// Copyright header + +#ifndef FORM_H +#define FORM_H + +#include "ui_form.h" + +#include <QWidget> + +class Form; +struct MyClass +{ + Form *form; +}; + +class Form : public QWidget +{ + Q_OBJECT + +public: + explicit Form(QWidget *parent = 0); + +private: + Ui::Form ui; +}; + +#endif // FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp new file mode 100644 index 0000000000..449bda3749 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.cpp @@ -0,0 +1,16 @@ +// Copyright header + +#include "form.h" +#include "ui_form.h" + +Form::Form(QWidget *parent) : + QWidget(parent), + ui(new Ui::Form) +{ + ui->setupUi(this); +} + +Form::~Form() +{ + delete ui; +} diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h new file mode 100644 index 0000000000..3f5ddba574 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer/form.h @@ -0,0 +1,30 @@ +// Copyright header + +#ifndef FORM_H +#define FORM_H + +#include <QWidget> + +namespace Ui { +class Form; +} + +class Form; +struct MyClass +{ + Form *form; +}; + +class Form : public QWidget +{ + Q_OBJECT + +public: + explicit Form(QWidget *parent = 0); + ~Form(); + +private: + Ui::Form *ui; +}; + +#endif // FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp new file mode 100644 index 0000000000..449bda3749 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.cpp @@ -0,0 +1,16 @@ +// Copyright header + +#include "form.h" +#include "ui_form.h" + +Form::Form(QWidget *parent) : + QWidget(parent), + ui(new Ui::Form) +{ + ui->setupUi(this); +} + +Form::~Form() +{ + delete ui; +} diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h new file mode 100644 index 0000000000..13fdfa5b23 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.h @@ -0,0 +1,28 @@ +// Copyright header + +#ifndef N_FORM_H +#define N_FORM_H + +#include <QWidget> + +namespace N { +namespace Ui { +class Form; +} +} + +using namespace N; + +class Form : public QWidget +{ + Q_OBJECT + +public: + explicit Form(QWidget *parent = 0); + ~Form(); + +private: + Ui::Form *ui; +}; + +#endif // N_FORM_H diff --git a/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui new file mode 100644 index 0000000000..ebe1479342 --- /dev/null +++ b/tests/designer/gotoslot_insertIntoCorrectClass_pointer_ns_using/form.ui @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>N::Form</class> + <widget class="QWidget" name="N::Form"> + <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> + <widget class="QPushButton" name="pushButton"> + <property name="geometry"> + <rect> + <x>60</x> + <y>60</y> + <width>80</width> + <height>21</height> + </rect> + </property> + <property name="text"> + <string>PushButton</string> + </property> + </widget> + </widget> + <resources/> + <connections/> +</ui> |