Typography
A small Qt recipe for headings, body copy and supporting text with the bundled Inter default.
Installation
- Source
- Installed package
add_subdirectory(shadcn-cpp)
target_link_libraries(app PRIVATE shadcn::widgets)
find_package(shadcn CONFIG REQUIRED)
target_link_libraries(app PRIVATE shadcn::widgets)
Usage
#include <QFont>
#include <QLabel>
QLabel heading("Account settings", parent);
QFont font = heading.font();
font.setPointSize(20);
font.setWeight(QFont::DemiBold);
heading.setFont(font);
QLabel body("Manage your profile and notifications.", parent);
Use the application palette and the active Qt style for colour and spacing. Keep the heading text short and place supporting copy directly after it.
Keyboard and accessibility
Labels are read in document order. Use a real control label for inputs and reserve heading labels for structure and context.
Ownership
The parent widget owns each label. Font values are copied into the label.
Known limits
Qt does not provide browser heading semantics. Use accessible names and an explicit reading order when a screen reader needs more structure.