-
-
Notifications
You must be signed in to change notification settings - Fork 983
Becoming a developer
LibreCAD is written in C++11 and now requires at least Qt 5.2.1.
Other than Qt the only requirement is boost;
although you need freetype for the tff2lff command line tool.
Windows Specific
On Windows you will need to add the boost path to librecad/src/custom.pro (or .pri):
BOOST_DIR = C:/boost/boost_1_60_0/
BOOST_LIBDIR = C:/boost/boost_1_60_0/
OS X Specific
On OS X you also need to download XCode to build with Qt Creator / Clang.
After installing you need to accept the license by opening the OS X terminal and inputing:
$ sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer
$ sudo xcodebuild -license
Remove -beta
if you are not using a beta version.
You can get the latest version of Boost by using Homebrew.
brew install boost
You will need to run macdeployqt
after building to complete the App.
http://doc.qt.io/qt-5/osx-deployment.html
Download an appropriate offline installer from http://www.qt.io/download-open-source/ (hint: look for the "view all downloads" link). Windows users will want to get the MinGW version.
Open librecad.pro in Qt Creator.
It's easiest to just accept the default configuration,
and then go to the 'Projects' side tab, and uncheck 'Shadow build'.
You can improve build speed by adding -j to the make arguments.
Using -j3 on a quad core i5 builds in a little under 3 minutes with clang.
Qt Assistant also comes with the package and is documentation in the form of a program.
Essential concepts
- http://doc.qt.io/qt-5/qmake-manual.html
- http://doc.qt.io/qt-5/resources.html
- http://doc.qt.io/qt-5/objecttrees.html
- http://doc.qt.io/qt-5/signalsandslots.html
- http://doc.qt.io/qt-5/layout.html
- http://doc.qt.io/qt-5/internationalization.html
- http://doc.qt.io/qt-5/qtdesigner-manual.html
- educational plugin example
Essential classes
- http://doc.qt.io/qt-5/qapplication.html
- http://doc.qt.io/qt-5/qmainwindow.html
- http://doc.qt.io/qt-5/qmdiarea.html
- http://doc.qt.io/qt-5/qsettings.html
- http://doc.qt.io/qt-5/qaction.html
- http://doc.qt.io/qt-5/qobject.html
- http://doc.qt.io/qt-5/qwidget.html
- http://doc.qt.io/qt-5/qpainter.html
http://doc.qt.io/qtcreator/creator-editor-locator.html
Useful in the text area's context menu:
- Switch Header/Source
- Follow symbol under cursor
- Find usages
Ctrl+F has an "Advanced" section that can search all files in the project.
The bar above the text area drops down and has sorted symbols;
and the Outline in the sidebar shows them in order of appearance.
It can be helpful to use bookmarks. http://doc.qt.io/qtcreator/creator-coding-navigating.html
Doxygen: http://wiki.librecad.org/lc2doc/main.html
We have a clang static analyzer build running during travis checks. See the below link for annotated hints of possible memory leaks and other bugs: http://librecad.github.io/static-analyzer-reports/