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

Integrates a DesktopWidgetPluginServer with a HomeCardManager to display loaded plugin widgets as cards. More...

#include <DesktopCardHook.h>

Inheritance diagram for DesktopCardHook:
DesktopServerHookBase

Public Member Functions

 DesktopCardHook (HomeCardManager *manager, DesktopWidgetPluginServer *parent=nullptr)
 Constructs a DesktopCardHook instance.
 
void process_unloaded_widget (const QString &what_plugin_widget)
 Processes an unloaded widget, removing it from the HomeCardManager.
 

Detailed Description

Integrates a DesktopWidgetPluginServer with a HomeCardManager to display loaded plugin widgets as cards.

This class acts as a bridge, listening for signals from a DesktopWidgetPluginServer when plugins (which expose QWidgets) are loaded. Upon a successful plugin load, it takes the widget and installs it into the HomeCardManager, effectively displaying it as a "card" in the UI. It also handles the removal of widgets when plugins are unloaded.

Constructor & Destructor Documentation

◆ DesktopCardHook()

DesktopCardHook::DesktopCardHook ( HomeCardManager manager,
DesktopWidgetPluginServer parent = nullptr 
)
explicit

Constructs a DesktopCardHook instance.

Parameters
managerA pointer to the HomeCardManager that will display the plugin widgets. The hook does not take ownership of the manager.
parentA pointer to the DesktopWidgetPluginServer that this hook will monitor. This is also the QObject parent for this hook, which means it manages its lifetime. Defaults to nullptr.

Member Function Documentation

◆ process_unloaded_widget()

void DesktopCardHook::process_unloaded_widget ( const QString &  what_plugin_widget)

Processes an unloaded widget, removing it from the HomeCardManager.

  • This method is called when a plugin widget is unloaded. It removes the corresponding QWidget from the HomeCardManager, effectively taking the "card" off the display.
    Parameters
    what_plugin_widgetThe name of the plugin whose widget is being unloaded.

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