Jump to content

Translate

AllKDevelop4/TipsAndTricks
Translate to Fakaʻuvea

Translation of the wiki page KDevelop4/TipsAndTricks from English (en) to Faka'uvea (wls)

This tool does not work without JavaScript. JavaScript is disabled, failed to work, or this browser is unsupported.
KDevelop4/TipsAndTricks
Translations:KDevelop4/TipsAndTricks/Page display title/wls
KDevelop4/TipsAndTricks
You need translation rights to translate messages.Get permission
Latest updatesAll changes
Suggestions
In other languages
KDevelop4/Trucs et astuces
français
== Tips And Tricks ==
== Tips And Tricks ==
You need translation rights to translate messages.Get permission
Latest updatesAll changes
Suggestions
In other languages
== Trucs Et Astuces ==
français
=== Code Completion ===
While you have automatic code completion, requesting it manually is often a very good idea. Press <keycap>Ctrl + Space</keycap> and you'll get a detailed code completion list. Navigate with the arrow buttons (<keycap>Up</keycap>/<keycap>Down</keycap>) and press (and keep pressed) <keycap>Alt</keycap> to show documentation of the focused item. Press <keycap>Enter</keycap> to insert the item.
=== C++ Type Assistant ===
Assume you have something similar to this:
Now you want to iterate over the contents, instead of writing the type of the iterator, you just write:
Now wait a second until the assistant pops up at the bottom of the editor. Press <keycap>Alt + 1</keycap> to execute the assistant and you end up with:
Nice, lots of time saved. {{Smiley}} And this should work with most/all expressions, as long as the right side can be evaluated, you should get an assistant that adds the correct type to the left side.
=== C++ Signature Assistant ===
Example code:
Now try the following things and after each step wait shortly and apply the assistant that pops up at the bottom of the editor with <keycap>Alt + 1</keycap>:
# add a parameter, e.g. <code>int foo</code> to either signature in the definition or the declaration. # make one signature <code>const</code> # change a type of a parameter # remove a parameter
Again, a very handy time saver!
=== C++ Missing Declaration Assistant ===
Example Code:
Now write this into the implementation of bar:
You should get an assistant that offers you three options:
# declare local <code>int myVar</code> (see type assistant above) # declare public <code>int myVar</code>, adds the declaration to the class body # declare private <code>int myVar</code>, same as above, but in private section.
This even works for functions:
Now write this below <code>foo f;</code>:
The assistant now offers you to declare that function, you'll end up with:
Cool {{Smiley}}.
=== Overload Helper ===
Example code:
Inside the class body of <code>B</code> press <keycap>Ctrl + Space</keycap> to bring up code completion. You should notice an item to overload <code>foo(int something);</code>. Execute it with <keycap>Enter</keycap> and you should get:
Cool {{Smiley}}.
=== Implementation Helper ===
Continue where we left of in the '''Overload Helper''':
Place your cursor below the class context, request code completion with <keycap>Ctrl + Space</keycap>, you should notice an item to implement <code>B::foo(int something);</code>. Execute it with <keycap>Enter</keycap> and you should get:
Awesome {{Smiley}}.
=== Quick Open ===
<menuchoice>Quick Open</menuchoice> is probably one of ''the'' features in '''KDevelop''' that increases productivity:
* Quick Open Files Press <keycap>Ctrl + Alt + O</keycap> and type part of a filepath, press <keycap>Enter</keycap> and the selected file gets opened. The search is separated by forward slashes, i.e. you can write this: <code>/a/.cpp</code> and the list will only show paths that have a folder starting with <code>a</code> and files that end on <code>.cpp</code>. Try it out.
* Quick Open Classes <keycap>Ctrl + Alt + C</keycap> and input (parts) of the qualified class identifier, press <keycap>Return</keycap> and jump to the declaration of that class.
Also make sure to explore the other advanced features in <menuchoice>Quick Open</menuchoice>.
=== Outline ===
Similar to quick open, pressing <keycap>Ctrl + Alt + N</keycap> gives you an outline of the current document with the ability to search for an identifier and quickly jump to its declaration.
=== Context Browsing ===
Hover a use, declaration or definition and you'll get a popup with information about it. You can also move your cursor in there and press (and keep pressed) the <keycap>Alt</keycap> button to show that popup without using the mouse. Use the arrow keys to navigate between the links in the popup, use <keycap>Enter</keycap> to jump to the destination of a link.
When inside a use, press <keycap>Meta + Left</keycap> or <keycap>Meta + Right</keycap> to jump to the previous/next use. Press <keycap>Ctrl + .</keycap> or <keycap>Ctrl + ,</keycap> to jump to the declaration or definition of the symbol under the cursor. Alternatively click on a symbol with <keycap>Ctrl</keycap> button pressed to do the same.
Also take a look at the <menuchoice>Navigation</menuchoice> menu and it's various shortcuts. Context browsing is awesome!
=== How to work with autotools: automake, autoconf and libtool ===
'''KDevelop 4''' does not support very well the autotools. I suggest using [[Special:myLanguage/Konsole|Konsole]] to run configure scripts to build makefile. The custom makefile support works quite well. I suggest using separate building folder (say <tt>project/build</tt>).
After the custom makefiles are in place (say in <tt>build</tt>-directory) one can add that to build list by clicking the {{Plus}} button on lower left corner '''Project selection''' while build directory is selected. This causes command '''make''' to be run when pressing <menuchoice>Build</menuchoice>. One can also directly run say '''make install''' on specific directory by right clicking the folder and selecting '''make install'''. This is nice if you have lots of projects in working set.
'''Libtool''' also causes problems if you try to debug application that has been linked with '''libtool''': the program that you see in for example <tt>src/bin/program</tt> is not the executable, but a script that handles the libraries.
Problem is properly solved in console by running {{Input|1=libtool --mode=execute'' '''<dst_binary>''' ''}} but at least currently '''KDevelop4''' does not work good (at all) with other console than default. I have been stuck of using the real binary (found usually from <tt>src/bin/.libs/<exec></tt>) that might use wrong libraries, so do '''make install''' before every run.
=== KDE Classes Documentation ===
Using the '''Qt Documentation''' plugin you may integrate KDE documentation along with Qt documentation. Point your browser at [http://api.kde.org/ KDE API Reference] and download the desired <tt>.qch</tt> file (not all modules provide one). Then configure the '''Qt Documentation''' plugin by adding the downloaded files. That's it! Whenever you hover a KDE class you can see a link <menuchoice>Show documentation for KFooClass</menuchoice> which points to KFooClass documentation. Enjoy.
[[Category:Development]]
Loading messages...
0% translated, 0% reviewed
All
Recent