open sourced Core library for laserdock
Clone or download
Latest commit abe1802 Jan 13, 2019


cmake repository for laserdock library

Supported platforms

Windows (msvc2015)
macOS (clang)
Android (library only, arm)

Prepare to development

  1. Download Qt Online installer from
  2. Run installer and install Qt for mac/windows (the latest version is recommended, library was tested on 5.11)

How to start:

  1. copy dist.local.cmake and rename it to local.cmake
  2. Open local.cmake and set the path QT_BASE_DIR to your local Qt installation directory
  3. Open root CMakeLists.txt with IDE you like. Qt Creator is recommended. Also you should be able to generate solutions for MSVS or Xcode, or open it with CLion.
  4. Compile and run example

Code Style

Code style helps to read and edit the project easier to all of us. Please follow it.


Do not use exceptions.

Do not use tabs symbols in code. You can setup your IDE to save tabs as spaces (1 tab is 4 spaces).

Try to declare float variables with f suffix in a new code - 1.0f or 1.f instead of 1.0 or 1

Try to avoid copy-paste.



Recommended class field prefix is m_*, but try to keep the same style if some old class has other prefix.

Try to create significant names to variables and functions and avoid short names (except some obvious one like x,y, etc).


Please try to keep the existing braces style.

Clasess/structs/functions should have braces on new line:

class ldClass

void doSomething()

for/while/if should have braces in the end of the first line:

for(int i = 0; i < size; i++) {

It is recommended avoid braces if you have only one line of cycle/if content. Just leave blank line before and after this construction to make it clear.



Common prefix for all classes/structs is ld*. If some class is strictly connected to one mini-app, you can use app name as second prefix - ldTunes*, ldClock*.

Member Order

Recommended class member order: public, public slots, signals, protected slots, protected, private slots, private. In each section order is: enum, static functions, constructor, functions, fields.

Include Order

From common to local:

<The corresponding *.h file (if it is cpp file)>
<C++ std module>
<Qt Module with explicit submodule>
<Windows/mac/linux specific>
<3rdparty library>

Try to sort includes in each subgroup in an alphabetical order.

Try to use forward declaration of classes in *.h files.



When it is possible try to use C++11 syntax for with iterators, e.g for(const ldClass &myClass : myClasses) instead of index-based for.

Const correctness

Try to use const references for classes/structs in arguments whenever it is possible. If some function doesn't change class field and shouldn't do it in future by design mark this function as const (getters usually).

enum class

enum class syntax from C++11 is preferrable instead of old-style enum in most cases. For any enum try to avoid if-else long trees and use switch(){} instead.


In new code use C++11 nullptr keyword.

Field initialization

Use C++11 style of variable initialization if it is possible - in *.h file. If something is initialized from constructor then initialize it in constructor declaration. And initialize field in constructor itself if you don't have other options. All fields should be initialiazed.


Use auto keyword only for iterators and lambdas.

Smart pointers

Try to avoid using keywords delete / free and any manul memory operations. Prefer to use std::unique_ptr, std::shared_ptr or Qt parent-based object system.


Use QString always when it is possible. char* should be avoided generally. std::string is not so bad but it creates mess with QString conversions so try to avoid it oo.