From 5b5ae971045adebe40209150cf9e1cac6cc62191 Mon Sep 17 00:00:00 2001 From: Leander Schulten Date: Thu, 20 Aug 2020 00:33:24 +0200 Subject: CppEditor: Introduce QuickFix settings and unify getter/setter generation Introduces a QuickFix settings page where the generation of getters and setters can be customized. The settings can be saved into a file that can go into a VCS. All QuickFixes that generate getter/setter/signals/ Q_PROPERTIES now use the same backend. QuickFixes that generate getters/ setters are now extended to also generate signals and Q_PROPERTIES. Fixes: QTCREATORBUG-1532 Fixes: QTCREATORBUG-17941 Fixes: QTCREATORBUG-12678 Fixes: QTCREATORBUG-15779 Fixes: QTCREATORBUG-11620 Fixes: QTCREATORBUG-22707 Fixes: QTCREATORBUG-20157 Fixes: QTCREATORBUG-21804 Fixes: QTCREATORBUG-19814 Fixes: QTCREATORBUG-14622 Fixes: QTCREATORBUG-19803 Change-Id: I50ed2dad9b4a637fbd87b3e1f2856060ad0ad920 Reviewed-by: Christian Kandeler --- src/plugins/cppeditor/cppquickfixsettingswidget.ui | 961 +++++++++++++++++++++ 1 file changed, 961 insertions(+) create mode 100644 src/plugins/cppeditor/cppquickfixsettingswidget.ui (limited to 'src/plugins/cppeditor/cppquickfixsettingswidget.ui') diff --git a/src/plugins/cppeditor/cppquickfixsettingswidget.ui b/src/plugins/cppeditor/cppquickfixsettingswidget.ui new file mode 100644 index 0000000000..41b68d8ba9 --- /dev/null +++ b/src/plugins/cppeditor/cppquickfixsettingswidget.ui @@ -0,0 +1,961 @@ + + + CppQuickFixSettingsWidget + + + + 0 + 0 + 641 + 1074 + + + + Form + + + + + + Generated Function Locations + + + + 48 + + + + + Default + + + Qt::AlignCenter + + + + + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + 1 + + + + + + + + 0 + 0 + + + + lines + + + + + + + + + + + + + + 6 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + 1 + + + + + + + + 0 + 0 + + + + lines + + + + + + + + + + + + + + 16777215 + 40 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + + + + true + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + 1 + + + + + + + + 0 + 0 + + + + lines + + + + + + + + + + + + + Default + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + true + + + + Generate Getters + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + true + + + + Generate Setters + + + Qt::AlignCenter + + + + + + + In .cpp file: + + + + + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + 1 + + + + + + + + 0 + 0 + + + + lines + + + + + + + + + + + + + Qt::Horizontal + + + + 1 + 0 + + + + + + + + Outside class: + + + + + + + Inside class: + + + + + + + + + + Getter Setter Generation Properties + + + + + + Getter name: + + + + + + + For example, new<Name> + + + + + + + Setter name: + + + + + + + Setters should be slots + + + + + + + Generate signals with the new value as parameter + + + + + + + Getter attributes: + + + + + + + Setter parameter name: + + + + + + + Reset name: + + + + + + + Signal name: + + + + + + + See tool tip for more information + + + + + + + Normally reset<Name> + + + + + + + For example, [[nodiscard]] + + + + + + + See tool tip for more information + + + + + + + Normally <name>Changed + + + + + + + Member variable name: + + + + + + + For example, m_<name> + + + + + + + + + + Missing Namespace Handling + + + + + + Generate missing namespaces + + + + + + + Add "using namespace ..." + + + + + + + Rewrite types to match the existing namespaces + + + + + + + + + + Custom Getter Setter Templates + + + false + + + + + + + 0 + 0 + + + + Template + + + false + + + + + + Types: + + + + + + + Separate the types by comma. + + + + + + + Comparison: + + + + + + + + + + Assignment: + + + + + + + + + + Return expression: + + + + + + + + + + Return type: + + + + + + + + + + + 0 + 0 + + + + Use <new> and <cur> to access the parameter and current value. Use <type> to access the type and <T> for the template parameter. + + + true + + + + + + + + + + + 0 + 0 + + + + + 200 + 16777215 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + 0 + 0 + + + + + + + + + + Add + + + + + + + Remove + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 150 + + + + Normally arguments get passed by const reference. If the Type is one of the following ones, the argument gets passed by value. Namespaces and template arguments are removed. The real Type must contain the given Type. For example, "int" matches "int32_t" but not "vector<int>". "vector" matches "std::pmr::vector<int>" but not "std::optional<vector<int>>" + + + + + + + + 212 + 0 + + + + Value types: + + + + + + + + + Add + + + + + + + Remove + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + checkBox_getterCpp + toggled(bool) + widget_getterCpp + setEnabled(bool) + + + 509 + 125 + + + 570 + 125 + + + + + checkBox_getterOutside + toggled(bool) + widget_getterOutside + setEnabled(bool) + + + 509 + 91 + + + 570 + 91 + + + + + checkBox_setterOutside + toggled(bool) + widget_setterOutside + setEnabled(bool) + + + 312 + 91 + + + 373 + 91 + + + + + checkBox_setterCpp + toggled(bool) + widget_setterCpp + setEnabled(bool) + + + 312 + 125 + + + 373 + 125 + + + + + -- cgit v1.2.3