A grid of color swatches, which allows for user selection.  
 More...
#include <qgscolorswatchgrid.h>
|  | 
| void | colorChanged (const QColor &color) | 
|  | Emitted when a color has been selected from the widget.  More... 
 | 
|  | 
| void | hovered () | 
|  | Emitted when mouse hovers over widget.  More... 
 | 
|  | 
A grid of color swatches, which allows for user selection. 
Colors are taken from an associated QgsColorScheme. 
- See also
- QgsColorGridAction 
- Since
- QGIS 2.5 
Definition at line 32 of file qgscolorswatchgrid.h.
◆ QgsColorSwatchGrid()
      
        
          | QgsColorSwatchGrid::QgsColorSwatchGrid | ( | QgsColorScheme * | scheme, | 
        
          |  |  | const QString & | context = QString(), | 
        
          |  |  | QWidget * | parent = nullptr | 
        
          |  | ) |  |  | 
      
 
Construct a new color swatch grid. 
- Parameters
- 
  
    | scheme | QgsColorScheme for colors to show in grid |  | context | context string provided to color scheme |  | parent | parent widget |  
 
Definition at line 27 of file qgscolorswatchgrid.cpp.
 
 
◆ baseColor()
  
  | 
        
          | QColor QgsColorSwatchGrid::baseColor | ( |  | ) | const |  | inline | 
 
Gets the base color for the widget. 
- Returns
- base color which is passed to scheme for color generation 
- See also
- setBaseColor 
Definition at line 71 of file qgscolorswatchgrid.h.
 
 
◆ colorChanged
  
  | 
        
          | void QgsColorSwatchGrid::colorChanged | ( | const QColor & | color | ) |  |  | signal | 
 
Emitted when a color has been selected from the widget. 
- Parameters
- 
  
  
 
 
◆ colors()
Gets the list of colors shown in the grid. 
- Returns
- list of colors currently shown in the grid 
Definition at line 84 of file qgscolorswatchgrid.h.
 
 
◆ context()
  
  | 
        
          | QString QgsColorSwatchGrid::context | ( |  | ) | const |  | inline | 
 
Gets the current context for the grid. 
- Returns
- context string which is passed to scheme for color generation 
- See also
- setContext 
Definition at line 57 of file qgscolorswatchgrid.h.
 
 
◆ focusInEvent()
  
  | 
        
          | void QgsColorSwatchGrid::focusInEvent | ( | QFocusEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ focusOutEvent()
  
  | 
        
          | void QgsColorSwatchGrid::focusOutEvent | ( | QFocusEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ hovered
  
  | 
        
          | void QgsColorSwatchGrid::hovered | ( |  | ) |  |  | signal | 
 
Emitted when mouse hovers over widget. 
 
 
◆ keyPressEvent()
  
  | 
        
          | void QgsColorSwatchGrid::keyPressEvent | ( | QKeyEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ minimumSizeHint()
  
  | 
        
          | QSize QgsColorSwatchGrid::minimumSizeHint | ( |  | ) | const |  | override | 
 
 
◆ mouseMoveEvent()
  
  | 
        
          | void QgsColorSwatchGrid::mouseMoveEvent | ( | QMouseEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ mousePressEvent()
  
  | 
        
          | void QgsColorSwatchGrid::mousePressEvent | ( | QMouseEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ mouseReleaseEvent()
  
  | 
        
          | void QgsColorSwatchGrid::mouseReleaseEvent | ( | QMouseEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ paintEvent()
  
  | 
        
          | void QgsColorSwatchGrid::paintEvent | ( | QPaintEvent * | event | ) |  |  | overrideprotected | 
 
 
◆ refreshColors
  
  | 
        
          | void QgsColorSwatchGrid::refreshColors | ( |  | ) |  |  | slot | 
 
 
◆ setBaseColor()
      
        
          | void QgsColorSwatchGrid::setBaseColor | ( | const QColor & | baseColor | ) |  | 
      
 
Sets the base color for the widget. 
- Parameters
- 
  
    | baseColor | base color to pass to scheme for color generation |  
 
- See also
- baseColor 
Definition at line 73 of file qgscolorswatchgrid.cpp.
 
 
◆ setContext()
      
        
          | void QgsColorSwatchGrid::setContext | ( | const QString & | context | ) |  | 
      
 
Sets the current context for the grid. 
- Parameters
- 
  
    | context | string which is passed to scheme for color generation |  
 
- See also
- context 
Definition at line 67 of file qgscolorswatchgrid.cpp.
 
 
◆ sizeHint()
  
  | 
        
          | QSize QgsColorSwatchGrid::sizeHint | ( |  | ) | const |  | override | 
 
 
The documentation for this class was generated from the following files: