In my class declaration (header file) I have following sections: "public:", "private:", "private slots:" (in this order). I'm writing calling new function - example into constructor's definition (cpp file): "newFunction()". When I'm putting semi at the end of calling this function then shows me additional menu: "Declare 'void newFunction()' as: 1 - public function in NewClass 2 - private function in NewClass 0 - Hide". When I choose 2 ("private:") then declaration is inserted in section "private slots:" except "private:".
Example: class MyClass { Q_OBJECT public: MyClass(); private: void foo(); public slots: void slotFoo(); }; MyClass::MyClass() { newFoo(); } Below header file after using assistant: Declare 'void newFoo()' as: 1 - public function in MyClass 2 - private function in NewClass 0 - Hide". And selected Alt+1 (public function). class MyClass { Q_OBJECT public: MyClass(); private: void foo(); public slots: void slotFoo(); void newFoo(); }; Declaration: "void newFoo();" should be in section "public". And one thing KDevelop not respect set (in configuration) separators when inserts new function's declaration. I will request new bug.
Created attachment 75978 [details] test case Archive contains a sample classes to testing bug. Instruction: 1. Extract all files from directory: testcase_myclass/myclass_before to any project 2. open in KDevelop file myclass.cpp 3. move the cursor to the end of the line: " newFoo();" 4. select "3 - public" in popuping window: "Declare 'void newFoo()' as member ...." 5. check file: myclass.h (should look like file in: testcase_myclass/myclass_after) In class are two section of the public: "public:" and "public slots:". KDevelop should give a choice to what section add new member/method.
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.
Feature where I found this bug just disappeared. There is no proper status for this so I need to select 'RESOLVED'.