QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsColorSchemeList Class Reference

An editable list of color swatches, taken from an associated QgsColorScheme. More...

#include <qgscolorschemelist.h>

Inheritance diagram for QgsColorSchemeList:
Inheritance graph
[legend]

Public Slots

void addColor (const QColor &color, const QString &label=QString())
 Adds a color to the list. More...
 
void copyColors ()
 Copies colors from the list to the clipboard. More...
 
void pasteColors ()
 Pastes colors from clipboard to the list. More...
 
void removeSelection ()
 Removes any selected colors from the list. More...
 
void setScheme (QgsColorScheme *scheme, const QString &context=QString(), const QColor &baseColor=QColor())
 Sets the color scheme to show in the list. More...
 

Signals

void colorSelected (const QColor &color)
 Emitted when a color is selected from the list. More...
 

Public Member Functions

 QgsColorSchemeList (QWidget *parent=0, QgsColorScheme *scheme=0, const QString &context=QString(), const QColor &baseColor=QColor())
 Construct a new color swatch grid. More...
 
virtual ~QgsColorSchemeList ()
 
bool exportColorsToGpl (QFile &file)
 Export colors to a GPL palette file from the list. More...
 
bool importColorsFromGpl (QFile &file)
 Import colors from a GPL palette file to the list. More...
 
bool isDirty () const
 Returns whether the color scheme list has been modified. More...
 
bool saveColorsToScheme ()
 Saves the current colors shown in the list back to a color scheme, if supported by the color scheme. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 

Detailed Description

An editable list of color swatches, taken from an associated QgsColorScheme.

See also
QgsColorSchemeList
Note
introduced in QGIS 2.5

Definition at line 146 of file qgscolorschemelist.h.

Constructor & Destructor Documentation

QgsColorSchemeList::QgsColorSchemeList ( QWidget *  parent = 0,
QgsColorScheme scheme = 0,
const QString &  context = QString(),
const QColor &  baseColor = QColor() 
)

Construct a new color swatch grid.

Parameters
parentparent widget
schemeQgsColorScheme for colors to show in the list
contextcontext string provided to color scheme
baseColorbase color for color scheme

Definition at line 30 of file qgscolorschemelist.cpp.

QgsColorSchemeList::~QgsColorSchemeList ( )
virtual

Definition at line 52 of file qgscolorschemelist.cpp.

Member Function Documentation

void QgsColorSchemeList::addColor ( const QColor &  color,
const QString &  label = QString() 
)
slot

Adds a color to the list.

Parameters
colorcolor to add
labeloptional label for color

Definition at line 92 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::colorSelected ( const QColor &  color)
signal

Emitted when a color is selected from the list.

Parameters
colorcolor selected
void QgsColorSchemeList::copyColors ( )
slot

Copies colors from the list to the clipboard.

See also
pasteColors

Definition at line 115 of file qgscolorschemelist.cpp.

bool QgsColorSchemeList::exportColorsToGpl ( QFile &  file)

Export colors to a GPL palette file from the list.

Parameters
filedestination file
See also
importColorsFromGpl

Definition at line 217 of file qgscolorschemelist.cpp.

bool QgsColorSchemeList::importColorsFromGpl ( QFile &  file)

Import colors from a GPL palette file to the list.

Parameters
filefile to import
See also
exportColorsToGpl

Definition at line 190 of file qgscolorschemelist.cpp.

bool QgsColorSchemeList::isDirty ( ) const

Returns whether the color scheme list has been modified.

Returns
true if colors have been modified

Definition at line 222 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::keyPressEvent ( QKeyEvent *  event)
protected

Definition at line 136 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 161 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::mouseReleaseEvent ( QMouseEvent *  event)
protected

Definition at line 171 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::pasteColors ( )
slot

Pastes colors from clipboard to the list.

See also
copyColors

Definition at line 97 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::removeSelection ( )
slot

Removes any selected colors from the list.

Definition at line 74 of file qgscolorschemelist.cpp.

bool QgsColorSchemeList::saveColorsToScheme ( )

Saves the current colors shown in the list back to a color scheme, if supported by the color scheme.

Note
this method is only effective if the color scheme is editable

Definition at line 63 of file qgscolorschemelist.cpp.

void QgsColorSchemeList::setScheme ( QgsColorScheme scheme,
const QString &  context = QString(),
const QColor &  baseColor = QColor() 
)
slot

Sets the color scheme to show in the list.

Parameters
schemeQgsColorScheme for colors to show in the list
contextcontext string provided to color scheme
baseColorbase color for color scheme

Definition at line 57 of file qgscolorschemelist.cpp.


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