BreadcrumbBar

A row of segments, one for each level above a page, with a path and a branch under it.

Inherits QWidget
Group widgets

Declared in src/libs/libwidgets/widgets/BreadcrumbBar.hpp.

Detailed description

Each segment holds a text and a key. The bar shows the segments from the top level to the page itself, separated by "›". Each segment but the last is a flat button, and a click on it emits segmentActivated() with its key. The last segment is the page itself: bold text that does not respond to a click. A page answers segmentActivated() by going up to that level.

The line under the segments shows a path, in a PathLabelWidget, and the branch where there is one. The context menu of the path has "Show in the file manager", revealAction(), which calls utility::file::revealInFileManager() or the function that setRevealFunction() gives.

The bar knows no type of an application, so a page of any application can use it.

auto *bar = new BreadcrumbBar(this);
bar->setSegments({{tr("Trove"), QStringLiteral("home")}, {tr("rover (repository)"), projectId}});
bar->setPath(checkoutPath, QStringLiteral("main"));
connect(bar, &BreadcrumbBar::segmentActivated, this, &MyPage::goUpTo);

In this section