game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
EmptyStateWidget Class Reference

A widget showing an empty state with icon, message, and actions. More...

#include <loading_widgets.h>

Inheritance diagram for EmptyStateWidget:
Collaboration diagram for EmptyStateWidget:

Public Member Functions

 EmptyStateWidget (QWidget *parent=nullptr, ThemeManager *themeManager=nullptr)
 ~EmptyStateWidget () override=default
void addAction (const QString &label, const std::function< void()> &callback)
void applyTheme ()
void clearActions ()
void setDescription (const QString &description)
void setIcon (const QString &iconText)
void setTitle (const QString &title)

Protected Member Functions

void showEvent (QShowEvent *event) override

Detailed Description

A widget showing an empty state with icon, message, and actions.

Provides a more engaging empty state than just text.

Usage: auto* emptyState = new EmptyStateWidget(this); emptyState->setIcon("🎮"); emptyState->setTitle("No games found"); emptyState->setDescription("Try adjusting your filters or add some games"); emptyState->addAction("Add Game", [this]() { showAddGameDialog(); }); emptyState->addAction("Clear Filters", [this]() { clearFilters(); });

Definition at line 213 of file loading_widgets.h.

Constructor & Destructor Documentation

◆ EmptyStateWidget()

EmptyStateWidget::EmptyStateWidget ( QWidget * parent = nullptr,
ThemeManager * themeManager = nullptr )
explicit

Definition at line 376 of file loading_widgets.cpp.

References applyTheme().

◆ ~EmptyStateWidget()

EmptyStateWidget::~EmptyStateWidget ( )
overridedefault

Member Function Documentation

◆ addAction()

void EmptyStateWidget::addAction ( const QString & label,
const std::function< void()> & callback )

Definition at line 437 of file loading_widgets.cpp.

◆ applyTheme()

void EmptyStateWidget::applyTheme ( )

Definition at line 478 of file loading_widgets.cpp.

Referenced by EmptyStateWidget(), and showEvent().

◆ clearActions()

void EmptyStateWidget::clearActions ( )

Definition at line 466 of file loading_widgets.cpp.

◆ setDescription()

void EmptyStateWidget::setDescription ( const QString & description)

Definition at line 432 of file loading_widgets.cpp.

◆ setIcon()

void EmptyStateWidget::setIcon ( const QString & iconText)

Definition at line 422 of file loading_widgets.cpp.

◆ setTitle()

void EmptyStateWidget::setTitle ( const QString & title)

Definition at line 427 of file loading_widgets.cpp.

◆ showEvent()

void EmptyStateWidget::showEvent ( QShowEvent * event)
overrideprotected

Definition at line 495 of file loading_widgets.cpp.

References applyTheme().


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