QtCreator custom "macro" or alias for automative text creation
Hello,
First sorry for hazy title, but I don't exactly know how this is properly named.
What I want to ask is:
does QtCreator supporting "aliases" definition?
Explanation:
Lets say I want to print debug message, so normally I write
Code:
qDebug() << "some message";
but I would like to print that message only in debug mode, so i type:
Code:
#ifdef QT_DEBUG
qDebug() << "some message";
#endif
but typing those 3 lines is time consuming, so I would like to i.e. type "mydebug <enter>", then QtCreator would look in "aliases" definition and create for me structure #ifdef...
Is there something similar in functionality available in QtCretor? (I looked but didn't found anything)
BTW. I saw something like this in Eclipse, so that's why I ask.
PS. I don't ask about macros and key bindings.
Thanks for reply
Re: QtCreator custom "macro" or alias for automative text creation
If that is your real problem, then forget about it, because qDebug only shows the message only if you have build the application in debug mode. So no #if is required.
Quote:
This function does nothing if QT_NO_DEBUG_OUTPUT was defined during compilation.
Else have a look at preferences -> text editor -> snippets.
Re: QtCreator custom "macro" or alias for automative text creation
No qDebug() was merely an example (poorly chosen to add).
Snippets is what I was looking for.
Thanks.