[Qt-creator] Patch: create function definition - need help

Nicolas Arnaud-Cormos nicolas at kdab.net
Sat Feb 14 00:18:42 CET 2009


Hi,

I'm working on a little patch to the cppeditor plugin, to be able to create 
the function definition when pressing shift+F2 if it doesn't exist.

For the moment, the patch :
* switch to the source file
* go to the end
* create the function definition like this
	return_type function_name(parameter1, parameter2)
	{

	}
with the cursor ready for editing

But I was unable to add the class name in front of the function name.

The patch is really short and I hope easy enough to understand. And it's 
definitely pre-alpha quality.

Questions :
* to switch to the source file, I use the actionManager to call 
SWITCH_HEADER_SOURCE from the cpptools plugin, is it the right way to do 
this, or is it better to call/create my own function?
* how on earth to get the class name, and also any namespace?

Note that I would love to see more developer documentation ;)

Thanks,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createdefinition.patch
Type: text/x-diff
Size: 2498 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090214/4cde0a43/attachment.bin 


More information about the Qt-creator-old mailing list