Code Documentation 3.6
Social Network Visualizer
Loading...
Searching...
No Matches
FilterBarWidget Class Reference

Thin strip between toolbar and canvas showing one chip per active filter. More...

#include <widgets/filterbarwidget.h>

Inheritance diagram for FilterBarWidget:
Collaboration diagram for FilterBarWidget:

Classes

struct  ChipData

Public Slots

void clearAllChips ()

Signals

void chipCloseRequested (int barIndex, FilterCondition::Scope scope)
void clearAllRequested ()

Public Member Functions

 FilterBarWidget (QWidget *parent=nullptr)
void addChip (const QString &label, FilterCondition::Scope scope)
void removeLatestChipForScope (FilterCondition::Scope scope)
void removeAllChipsForScope (FilterCondition::Scope scope)
void removeChipAt (int barIndex)
FilterCondition::Scope chipScopeAt (int barIndex) const

Private Member Functions

void removeChip (QFrame *chip)
void updateVisibility ()
void updateCloseButtons ()

Private Attributes

QHBoxLayout * m_chipsLayout
QPushButton * m_clearAllBtn
QList< ChipDatam_chips

Detailed Description

Thin strip between toolbar and canvas showing one chip per active filter.

Hidden when no filters are active. Each chip carries a label and a × button. Clicking × emits chipCloseRequested(barIndex, scope) BEFORE any chip is removed. The receiver (MainWindow) orchestrates graph state restoration, then calls removeChipAt() or rebuilds the bar via clearAllChips() + addChip(). "Clear all" emits clearAllRequested(); MainWindow drains the stack, then calls clearAllChips().

Menu-driven restores (Restore All Nodes / Restore All Edges) must call removeLatestChipForScope() / removeAllChipsForScope() so the bar stays in sync.

Constructor & Destructor Documentation

◆ FilterBarWidget()

FilterBarWidget::FilterBarWidget ( QWidget * parent = nullptr)
explicit

Member Function Documentation

◆ addChip()

void FilterBarWidget::addChip ( const QString & label,
FilterCondition::Scope scope )

◆ chipCloseRequested

void FilterBarWidget::chipCloseRequested ( int barIndex,
FilterCondition::Scope scope )
signal

Emitted when the user clicks × on a chip, BEFORE the chip is removed. barIndex is the chip's position (0 = leftmost) at the time of the click. The bar does NOT remove the chip automatically; the receiver must call removeChipAt(), clearAllChips(), or rebuild the bar as appropriate.

◆ chipScopeAt()

FilterCondition::Scope FilterBarWidget::chipScopeAt ( int barIndex) const

◆ clearAllChips

void FilterBarWidget::clearAllChips ( )
slot

◆ clearAllRequested

void FilterBarWidget::clearAllRequested ( )
signal

Emitted when the user clicks "Clear all".

◆ removeAllChipsForScope()

void FilterBarWidget::removeAllChipsForScope ( FilterCondition::Scope scope)

◆ removeChip()

void FilterBarWidget::removeChip ( QFrame * chip)
private

◆ removeChipAt()

void FilterBarWidget::removeChipAt ( int barIndex)

◆ removeLatestChipForScope()

void FilterBarWidget::removeLatestChipForScope ( FilterCondition::Scope scope)

◆ updateCloseButtons()

void FilterBarWidget::updateCloseButtons ( )
private

◆ updateVisibility()

void FilterBarWidget::updateVisibility ( )
private

Member Data Documentation

◆ m_chips

QList<ChipData> FilterBarWidget::m_chips
private

◆ m_chipsLayout

QHBoxLayout* FilterBarWidget::m_chipsLayout
private

◆ m_clearAllBtn

QPushButton* FilterBarWidget::m_clearAllBtn
private

The documentation for this class was generated from the following files: