First, make sure you have a working toolchain and can build and run Ladybird. Go here for instructions for setting that up.
File -> New File or Project...
Import Existing Project
ladybird
), and navigate to the root of your Ladybird project checkout. Click Next.Add to version control
to <None>
. Click Finish.Meta/refresh-ladybird-qtcreator.sh
script to regenerate the ladybird.files
file. You will also have to do this every time you delete or add a new file to the project.ladybird.config
file (In Qt Creator, hit ^K or CMD+K on a Mac to open the search dialog, type the name of the file and hit return to open it)Add the following #define
s to the file:
#define ENABLE_COMPILETIME_FORMAT_CHECK
#define SANITIZE_PTRS 1
Edit the ladybird.cxxflags
file to say -std=c++23 -fsigned-char -fconcepts -fno-exceptions -fno-semantic-interposition -fPIC
Edit the ladybird.includes
file to list the following lines (adapt to the actual path of your skia folder):
./
Libraries/
Services/
Build/release/Lagom/Libraries/
Build/release/Lagom/Services/
Build/release/vcpkg_installed/x64-linux/include/skia/
AK/
Finally, search in the options for "BOM" (Text Editor > Behavior > File Encodings > UTF-8 BOM), and switch to "Always delete".
Qt Creator should be set up correctly now, go ahead and explore the project and try making changes. Have fun! :^)
You can use clang-format
to help you with the style guide. Before you proceed, check that you're actually using the clang-format version specified in the style guide, as some OSes will ship other clang-format versions by default.
Beautifier (experimental)
row (for example, by typing beau
into the search).clang-format
into the "value" box, and click "OK"Note that not the entire project is clang-format-clean (yet), so sometimes you will see large diffs. Use your own judgement whether you want to include such changes. Generally speaking, if it's a few lines then it's a good idea; if it's the entire file then maybe there's a better way to do it, like doing a separate commit, or just ignoring the clang-format changes.
You may want to read up what git add -p
does (or git checkout -p
, to undo).
QtCreator tends to interpret IPC definitions as C++ headers, and then tries to format them. This is not useful. One way to avoid that is telling QtCreator that IPC definitions are not C++ headers.
*.txt;*.asc;*,v
. Extend it in the following way: *.txt;*.asc;*,v;*.ipc;*.gml
MIME type: text/plain
.You may have noticed how Andreas just types lic
and the license appears.
In order to so, create a new file anywhere, for example license-template.creator
, with the standard license:
/*
* Copyright (c) 2024, the Ladybird developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
In QtCreator, select the menu "Tools", item "Options", section "C++", tab
"File Naming" (don't ask me why it's here). At the bottom there should be the
option "License template:". Click "Browse…", select your file (i.e.,
license-template.creator
). Click "OK", and you're done! :)