KDevelop tips
Here are some extra tips for using KDevelop:
- Creating new files
New files can be created with the New Class Wizard. After that, add the file to src/CMakeLists.txt manually.
- Using extra libraries
It's usually not needed to use additional libraries, or use C-style tricks. The KDE libraries and Qt library offer a lot of ready-to-use classes and functions, making development with C++ a breeze (almost as easy as Java). If you really need to link to other libraries, it needs to be added to the src/CMakeLists.txt file.
- Signals and slots
Qt also adds additional features to C++, like "signals" and "slots". Think of them as "events" and "event handlers", "delegates" or "listeners" like Java has. Qt implements a similar mechanism by generating extra source code (.moc files) for each header file with a Q_OBJECT macro inside. The .moc file should be included in the corresponding .cpp file. Signals and Slots are connected at run-time using the QObject::connect() method. Each object implementing signals or slots should inherit from QObject.
- Creating user interface code
User interfaces can be created a drag&drop designer! See the Creating user interface code tutorial.
