CCIMXDesktop
 
Loading...
Searching...
No Matches
AppWidget Class Reference

The AppWidget class represents an application widget placed on the desktop. More...

#include <appwidget.h>

Inheritance diagram for AppWidget:
AppLauncherApp SettingsApp

Public Types

enum class  AppStatus { AppOk , AppNonExsits }
 Enum representing the application status. More...
 

Signals

void postAppStatus (AppWidget::AppStatus status)
 Signal emitted to notify about the application status.
 

Public Member Functions

 AppWidget (const QPixmap &icon, const QString &name, QWidget *parent=nullptr)
 Constructs an AppWidget with the given icon and app name.
 
void bindApp (ApplicationWrapper *wrapper)
 Bind an ApplicationWrapper instance to this widget.
 
ApplicationWrapperget_app () const
 Get the bound ApplicationWrapper.
 
void setIcon (const QPixmap &icon) noexcept
 Set the icon displayed by this widget.
 
void setAppName (const QString &name) noexcept
 Set the application name displayed by this widget.
 
void setDummy (bool dummy)
 Set this widget as dummy mode.
 
QPixmap icon () const
 Get the current icon pixmap.
 
void setIconSize (int iconSize)
 Set the Icon size.
 
int iconSize () const
 iconSize
 
void showIconOnly (bool st)
 Show or hide only the icon (hides other UI elements).
 
QString app_name () const
 Get the application name.
 
void set_displayed_font (const QFont &f)
 set_displayed_font setFonts of displayed label
 
QFont currentFont () const
 currentFont get the current displaying font
 
void setFontColor (const QColor &color)
 setFontColor set the font color
 
 ~AppWidget ()
 Destructor.
 

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override
 Event filter to handle user interaction events.
 
virtual void do_daptch ()
 Dispatch the application via the ApplicationWrapper.
 

Detailed Description

The AppWidget class represents an application widget placed on the desktop.

It displays an icon and app name, manages the underlying ApplicationWrapper, and handles launching and status updates.

Member Enumeration Documentation

◆ AppStatus

enum class AppWidget::AppStatus
strong

Enum representing the application status.

Enumerator
AppOk 

Application is running or available.

AppNonExsits 

Application does not exist.

Constructor & Destructor Documentation

◆ AppWidget()

AppWidget::AppWidget ( const QPixmap &  icon,
const QString &  name,
QWidget *  parent = nullptr 
)
explicit

Constructs an AppWidget with the given icon and app name.

Parameters
iconThe icon to display.
nameThe application name.
parentOptional parent widget.

Member Function Documentation

◆ app_name()

QString AppWidget::app_name ( ) const

Get the application name.

Returns
The app name string.

◆ bindApp()

void AppWidget::bindApp ( ApplicationWrapper wrapper)

Bind an ApplicationWrapper instance to this widget.

Parameters
wrapperPointer to the ApplicationWrapper.

◆ currentFont()

QFont AppWidget::currentFont ( ) const

currentFont get the current displaying font

Returns
displaying font

◆ do_daptch()

void AppWidget::do_daptch ( )
protectedvirtual

Dispatch the application via the ApplicationWrapper.

Reimplemented in AppLauncherApp, and SettingsApp.

◆ eventFilter()

bool AppWidget::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotected

Event filter to handle user interaction events.

Parameters
watchedThe object being watched.
eventThe event being filtered.
Returns
true if the event was handled, false otherwise.

◆ get_app()

ApplicationWrapper * AppWidget::get_app ( ) const

Get the bound ApplicationWrapper.

Returns
Pointer to the ApplicationWrapper.

◆ icon()

QPixmap AppWidget::icon ( ) const

Get the current icon pixmap.

Returns
The icon pixmap.

◆ iconSize()

int AppWidget::iconSize ( ) const

iconSize

Returns
icon size

◆ postAppStatus

void AppWidget::postAppStatus ( AppWidget::AppStatus  status)
signal

Signal emitted to notify about the application status.

Parameters
statusThe current status of the app.

◆ set_displayed_font()

void AppWidget::set_displayed_font ( const QFont &  f)

set_displayed_font setFonts of displayed label

Parameters
f

◆ setAppName()

void AppWidget::setAppName ( const QString &  name)
noexcept

Set the application name displayed by this widget.

Parameters
nameThe name string.

◆ setDummy()

void AppWidget::setDummy ( bool  dummy)

Set this widget as dummy mode.

When set to dummy, the widget is visible but does not respond to any real interaction or launch requests.

Parameters
dummyTrue to enable dummy mode; false to disable.

◆ setFontColor()

void AppWidget::setFontColor ( const QColor &  color)

setFontColor set the font color

Parameters
color

◆ setIcon()

void AppWidget::setIcon ( const QPixmap &  icon)
noexcept

Set the icon displayed by this widget.

Parameters
iconThe pixmap to set as icon.

◆ setIconSize()

void AppWidget::setIconSize ( int  iconSize)

Set the Icon size.

Parameters
iconSize

◆ showIconOnly()

void AppWidget::showIconOnly ( bool  st)

Show or hide only the icon (hides other UI elements).

Parameters
stTrue to show icon only; false to show full widget.

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