Filer
Public Member Functions | List of all members
CombinedIconCreator Class Reference

The CombinedIconCreator class is responsible for creating combined icons by overlaying a document icon and an application icon. More...

#include <CombinedIconCreator.h>

Public Member Functions

QIcon createCombinedIcon (const QIcon &applicationIcon) const
 

Detailed Description

The CombinedIconCreator class is responsible for creating combined icons by overlaying a document icon and an application icon.

This class provides two main functionalities:

  1. Finding the dominant color in the application icon using a given QPixmap.
  2. Creating a new QIcon by combining the document icon and application icon with a color overlay.

The dominant color of the application icon is calculated by analyzing the pixel colors of the given QPixmap. The findDominantColor() function scans through the image, identifies vibrant colors, and determines the color that appears most frequently as the dominant color. If the dominant color is either very dark (lightness < 10) or very light (lightness > 220), a neutral gray color is returned instead.

The createCombinedIcon() function takes two QIcons, representing the document and application icons, and creates a new QIcon by combining them, using the dominant color to make it more distinct.

Example usage:

CombinedIconCreator iconCreator; QIcon combinedIcon = iconCreator.createCombinedIcon(documentIcon, applicationIcon);


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