MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
MAKLogger::DtWidgetIconStyleManager Class Reference
+ Inheritance diagram for MAKLogger::DtWidgetIconStyleManager:
+ Collaboration diagram for MAKLogger::DtWidgetIconStyleManager:

Public Types

typedef std::vector< std::pair
< int, DtQIconConfigurations > > 
DtIndexableQIconConfigurations
 Vector of mappings between a DtQIconConfigurations and the index to apply the configuration to. More...
 

Public Member Functions

 DtWidgetIconStyleManager (QMainWindow *mainWindow)
 CTOR. More...
 
virtual ~DtWidgetIconStyleManager ()
 DTOR. More...
 
virtual void manageWidget (QObject *widgetToManage, const std::string &iconFileNameOrPath)
 Add a new widget to the manager. More...
 
virtual void manageWidget (QObject *widgetToManage, const DtQIconConfigurations &iconConfigurations)
 Add a new widget to the manager. More...
 
virtual void manageIndexableWidget (QObject *indexedWidgetToManage, int index, const DtQIconConfigurations &iconConfigurations)
 Add a new indexable widget to the manager. More...
 
virtual void unmanageWidget (QObject *widgetToManage)
 Remove a new widget the manager. More...
 
virtual void clearCache (bool refreshIcons=true)
 Clear the cache of QPixmap objects that are used to set the icons. More...
 
virtual void rotateIcon (QTabWidget *myTabs, int deg, QIcon &icon)
 Takes an icon's pixmap and rotates it by the specified amount. More...
 
virtual QPixmap generateThemedPixmapFromSVGAndIconMode (const std::string &iconFileNameOrPath, QIcon::Mode iconModeOfGeneratedPixmap=QIcon::Normal) const
 Helper function for generating a pixmap from an SVG and the desired mode for the pixmap The generated SVG is a modified version of the SVG pointed to by the provided icon file name/path with a different set of colors. More...
 
virtual QIcon createQIconBasedOnConfigurations (const DtQIconConfigurations &configurations)
 Helper function for creating a QIcon based on a DtQIconConfigurations. More...
 
virtual void generateAndAppendAdditionalIconConfigurationsIfNeeded (QIcon &iconToAppendToIfNeeded, const DtQIconConfigurations &iconConfigurations) const
 Helper function to generate additional icon configurations, if needed Additional icon configurations need to be generated if the flags maintained by the collection of configurations indicate they should be generated. More...
 
virtual void updateAllManagedIcons (bool lightDarkModeIconsEnabled)
 Update all managed icons based on application settings. More...
 

Protected Member Functions

virtual void updateIcon (QObject *widget, const DtQIconConfigurations &iconConfigurations, bool lightDarkModeIconsEnabled)
 Helper function to update a single widget that uses the provided icon file name. More...
 
virtual void updateIndexedIcon (QObject *indexedWidget, const DtIndexableQIconConfigurations &iconConfigurations, bool lightDarkModeIconsEnabled)
 Helper function to update a single widget that uses the provided icon file name. More...
 
virtual QPixmap findOrCreatePixmapInCache (const std::string &filePath)
 Helper function for getting the QPixmap for the associated asset pointed to by the provided filePath from the manager's QPixmap cache. More...
 
virtual std::string iconsDirectory (const std::string &iconFileNameOrPath) const
 Helper function to get the base icons directory associated with the provided icon file name or path. More...
 
virtual bool iconExistsOnDiskOrInCache (const std::string &iconFilePath) const
 Helper function that returns whether or not provided iconFilePath exists on disk or is present in the icon cache. More...
 
virtual bool getPixmapFromSVGAndColorMappings (const std::string &iconFileNameOrPath, const std::vector< std::pair< QColor, QColor >> colorMappings, QPixmap &resultIcon) const
 Helper function that creates a modified version of an icon asset. More...
 

Protected Attributes

std::map< QPointer< QObject >
, DtQIconConfigurations
myWidgetsToManage
 Mapping a QObject (UI element with the icon) and its configuration. More...
 
std::map< QPointer< QObject >
, DtIndexableQIconConfigurations
myIndexedWidgetsToManage
 Mapping an indexed QObject (UI element with indices where each index can have an icon) and its configuration. More...
 
std::map< std::string, QPixmap > myFilepathsToPixmapCache
 Mapping a filepath to the cached QPixmap for the asset pointed to by the filepath. More...
 
DtWidgetIconStyleManagerEventFiltermyEventFilter
 Event filter to detect changes to enable state of some widget types. More...
 
QMainWindowmyMainWindow
 Store a pointer to the main window. More...
 

Friends

class DtWidgetIconStyleManagerEventFilter
 

Member Typedef Documentation

Vector of mappings between a DtQIconConfigurations and the index to apply the configuration to.

Constructor & Destructor Documentation

MAKLogger::DtWidgetIconStyleManager::DtWidgetIconStyleManager ( QMainWindow mainWindow)

CTOR.

virtual MAKLogger::DtWidgetIconStyleManager::~DtWidgetIconStyleManager ( )
virtual

DTOR.

Member Function Documentation

virtual void MAKLogger::DtWidgetIconStyleManager::clearCache ( bool  refreshIcons = true)
virtual

Clear the cache of QPixmap objects that are used to set the icons.

Parameters
refreshIconsIf true, update all managed widgets after clearing the cache.
virtual QIcon MAKLogger::DtWidgetIconStyleManager::createQIconBasedOnConfigurations ( const DtQIconConfigurations configurations)
virtual

Helper function for creating a QIcon based on a DtQIconConfigurations.

Parameters
configurationsThe VRV-specific configurations to convert to a QIcon
virtual QPixmap MAKLogger::DtWidgetIconStyleManager::findOrCreatePixmapInCache ( const std::string &  filePath)
protectedvirtual

Helper function for getting the QPixmap for the associated asset pointed to by the provided filePath from the manager's QPixmap cache.

This function will create a QPixmap and cache it if one does not exist in the cache already.

virtual void MAKLogger::DtWidgetIconStyleManager::generateAndAppendAdditionalIconConfigurationsIfNeeded ( QIcon &  iconToAppendToIfNeeded,
const DtQIconConfigurations iconConfigurations 
) const
virtual

Helper function to generate additional icon configurations, if needed Additional icon configurations need to be generated if the flags maintained by the collection of configurations indicate they should be generated.

The behavior of the generation depends on the QIcon::Mode.

o If Qicon::Mode::Disabled configurations are being generated, the behavior is as follows:

  • If the user defines icon configurations for QIcon::Mode::Disabled, then use those to generate the new disabled versions of the icon.
  • If the user defines icon configurations for QIcon::Mode::Normal, then use those to generate the new disabled versions of the icon.
  • Otherwise, do nothing and output an INFO-level warning to the console.

o If Qicon::Mode::Normal configurations are being generated, the behavior is as follows:

  • If the user defines icon configurations for QIcon::Mode::Normal, then use those to generate the new normal versions of the icon.
  • Otherwise, do nothing and output an INFO-level warning to the console.

Generation in this context means we create a modified version of a provided icon configuration. The modified version is the same as the provided icon configuration and only differs in the colors it uses. The colors to use for generated icons come from mappings present in the stylesheet of the application and that are maintained by the main window of the application.

See Also
DtLgrMainWindow
virtual QPixmap MAKLogger::DtWidgetIconStyleManager::generateThemedPixmapFromSVGAndIconMode ( const std::string &  iconFileNameOrPath,
QIcon::Mode  iconModeOfGeneratedPixmap = QIcon::Normal 
) const
virtual

Helper function for generating a pixmap from an SVG and the desired mode for the pixmap The generated SVG is a modified version of the SVG pointed to by the provided icon file name/path with a different set of colors.

The colors of the SVG are swapped out with other colors based on mappings maintained by the main window.

See Also
DtLgrMainWindow::iconColorMappingsByMode

Reimplemented in MAKLogger::DtRemoteWidgetIconStyleManager.

virtual bool MAKLogger::DtWidgetIconStyleManager::getPixmapFromSVGAndColorMappings ( const std::string &  iconFileNameOrPath,
const std::vector< std::pair< QColor, QColor >>  colorMappings,
QPixmap &  resultIcon 
) const
protectedvirtual

Helper function that creates a modified version of an icon asset.

This function assumes the icon asset is an SVG. The modified version of the SVG swaps out colors with other colors defined in the provided color mappings. If the icon asset is not a SVG, then just return a QPixmap with the icon asset loaded.

virtual bool MAKLogger::DtWidgetIconStyleManager::iconExistsOnDiskOrInCache ( const std::string &  iconFilePath) const
protectedvirtual

Helper function that returns whether or not provided iconFilePath exists on disk or is present in the icon cache.

virtual std::string MAKLogger::DtWidgetIconStyleManager::iconsDirectory ( const std::string &  iconFileNameOrPath) const
protectedvirtual

Helper function to get the base icons directory associated with the provided icon file name or path.

virtual void MAKLogger::DtWidgetIconStyleManager::manageIndexableWidget ( QObject indexedWidgetToManage,
int  index,
const DtQIconConfigurations iconConfigurations 
)
virtual

Add a new indexable widget to the manager.

The manager will now manage the icon style for the widget.

Parameters
widgetToManageThe indexable widget to manage the icon for.
indexThe index of the widget the icon configurations will be applied to.
iconConfigurationsThe configurations for the widget's icon.
virtual void MAKLogger::DtWidgetIconStyleManager::manageWidget ( QObject widgetToManage,
const std::string &  iconFileNameOrPath 
)
virtual

Add a new widget to the manager.

The manager will now manage the icon style for the widget.

Parameters
widgetToManageThe widget to manage the icon for.
iconFileNameOrFilePathThe file name of the icon asset OR the file path to the icon asset.
virtual void MAKLogger::DtWidgetIconStyleManager::manageWidget ( QObject widgetToManage,
const DtQIconConfigurations iconConfigurations 
)
virtual

Add a new widget to the manager.

The manager will now manage the icon style for the widget.

Parameters
widgetToManageThe widget to manage the icon for.
iconConfigurationsThe configurations for the widget's icon.
virtual void MAKLogger::DtWidgetIconStyleManager::rotateIcon ( QTabWidget *  myTabs,
int  deg,
QIcon &  icon 
)
virtual

Takes an icon's pixmap and rotates it by the specified amount.

These newly rotated pixmaps are then added to the icon.

virtual void MAKLogger::DtWidgetIconStyleManager::unmanageWidget ( QObject widgetToManage)
virtual

Remove a new widget the manager.

The manager will not manage the icon style.

Parameters
widgetToManageThe (non)indexable widget to no longer manage.
virtual void MAKLogger::DtWidgetIconStyleManager::updateAllManagedIcons ( bool  lightDarkModeIconsEnabled)
virtual

Update all managed icons based on application settings.

virtual void MAKLogger::DtWidgetIconStyleManager::updateIcon ( QObject widget,
const DtQIconConfigurations iconConfigurations,
bool  lightDarkModeIconsEnabled 
)
protectedvirtual

Helper function to update a single widget that uses the provided icon file name.

virtual void MAKLogger::DtWidgetIconStyleManager::updateIndexedIcon ( QObject indexedWidget,
const DtIndexableQIconConfigurations iconConfigurations,
bool  lightDarkModeIconsEnabled 
)
protectedvirtual

Helper function to update a single widget that uses the provided icon file name.

Friends And Related Function Documentation

Member Data Documentation

DtWidgetIconStyleManagerEventFilter* MAKLogger::DtWidgetIconStyleManager::myEventFilter
protected

Event filter to detect changes to enable state of some widget types.

std::map<std::string, QPixmap> MAKLogger::DtWidgetIconStyleManager::myFilepathsToPixmapCache
protected

Mapping a filepath to the cached QPixmap for the asset pointed to by the filepath.

std::map<QPointer<QObject>, DtIndexableQIconConfigurations > MAKLogger::DtWidgetIconStyleManager::myIndexedWidgetsToManage
protected

Mapping an indexed QObject (UI element with indices where each index can have an icon) and its configuration.

QMainWindow* MAKLogger::DtWidgetIconStyleManager::myMainWindow
protected

Store a pointer to the main window.

std::map<QPointer<QObject>, DtQIconConfigurations> MAKLogger::DtWidgetIconStyleManager::myWidgetsToManage
protected

Mapping a QObject (UI element with the icon) and its configuration.


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

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)