LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::TabBadgeManager Class Reference

Manages activity badges on QTabWidget tabs. More...

#include <TabBadgeManager.hpp>

Inheritance diagram for ui::qt::TabBadgeManager:
Inheritance graph
Collaboration diagram for ui::qt::TabBadgeManager:
Collaboration graph

Public Member Functions

 TabBadgeManager (QTabWidget *tabWidget)
 
 ~TabBadgeManager ()=default
 
void SetBadge (int tabIndex)
 Show a badge on a tab indicating new/updated data.
 
void ClearBadge (int tabIndex)
 Hide the badge on a tab.
 
bool HasBadge (int tabIndex) const
 Check if a tab has an active badge.
 

Private Slots

void OnTabChanged (int index)
 

Private Member Functions

void UpdateTabText (int index)
 

Private Attributes

QTabWidget * m_tabWidget
 
std::map< int, QString > m_originalTabText
 
std::map< int, bool > m_badges
 

Detailed Description

Manages activity badges on QTabWidget tabs.

Shows a red dot (●) on tabs when they contain updated data. Auto-clears when user switches to that tab.

Usage: auto badgeManager = std::make_unique<TabBadgeManager>(tabWidget); badgeManager->SetBadge(0, "new"); // Show badge on tab 0 badgeManager->ClearBadge(0); // Hide badge on tab 0

Constructor & Destructor Documentation

◆ TabBadgeManager()

ui::qt::TabBadgeManager::TabBadgeManager ( QTabWidget *  tabWidget)
explicit
Here is the call graph for this function:

◆ ~TabBadgeManager()

ui::qt::TabBadgeManager::~TabBadgeManager ( )
default

Member Function Documentation

◆ ClearBadge()

void ui::qt::TabBadgeManager::ClearBadge ( int  tabIndex)

Hide the badge on a tab.

Parameters
tabIndexIndex of the tab
Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasBadge()

bool ui::qt::TabBadgeManager::HasBadge ( int  tabIndex) const

Check if a tab has an active badge.

Parameters
tabIndexIndex of the tab
Returns
true if badge is visible
Here is the caller graph for this function:

◆ OnTabChanged

void ui::qt::TabBadgeManager::OnTabChanged ( int  index)
privateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBadge()

void ui::qt::TabBadgeManager::SetBadge ( int  tabIndex)

Show a badge on a tab indicating new/updated data.

Parameters
tabIndexIndex of the tab to badge
Here is the call graph for this function:

◆ UpdateTabText()

void ui::qt::TabBadgeManager::UpdateTabText ( int  index)
private
Here is the caller graph for this function:

Member Data Documentation

◆ m_badges

std::map<int, bool> ui::qt::TabBadgeManager::m_badges
private

◆ m_originalTabText

std::map<int, QString> ui::qt::TabBadgeManager::m_originalTabText
private

◆ m_tabWidget

QTabWidget* ui::qt::TabBadgeManager::m_tabWidget
private

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