Horizontally scrollable container for toolbar-like widgets. More...
| Header: | #include <ScrollableToolbar> |
| Since: | 1.0 |
| Inherits: | QWidget |
ScrollableToolbar hosts a horizontal row of child widgets (buttons, separators, combo boxes, labels, etc.) inside a QScrollArea. The scrollbar appears only when the content exceeds the available width — so on wide windows the toolbar looks like a conventional QHBoxLayout-backed toolbar, and on narrow windows (e.g. a phone in portrait orientation) the user can swipe horizontally to reach off-screen items rather than seeing them truncated or clipped.
This encapsulates the pattern originally implemented in Banter's BanterBusWidget; it's used there as well as in ConstructShell's top toolbar.
\sectionusage Basic Usage
auto *bar = new ScrollableToolbar(this); bar->addWidget(openBtn); bar->addWidget(saveBtn); bar->addSeparator(); bar->addWidget(shadingCombo); bar->addStretch(); bar->addWidget(fpsLabel);