QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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>

Public Slots

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

Signals

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

Public Member Functions

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

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

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
QgsColorSchemeList::~QgsColorSchemeList ( )
virtual

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
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
bool QgsColorSchemeList::exportColorsToGpl ( QFile &  file)

Export colors to a GPL palette file from the list.

Parameters
filedestination file
See Also
importColorsFromGpl
bool QgsColorSchemeList::importColorsFromGpl ( QFile &  file)

Import colors from a GPL palette file to the list.

Parameters
filefile to import
See Also
exportColorsToGpl
bool QgsColorSchemeList::isDirty ( ) const

Returns whether the color scheme list has been modified.

Returns
true if colors have been modified
void QgsColorSchemeList::keyPressEvent ( QKeyEvent *  event)
protected
void QgsColorSchemeList::mousePressEvent ( QMouseEvent *  event)
protected
void QgsColorSchemeList::mouseReleaseEvent ( QMouseEvent *  event)
protected
void QgsColorSchemeList::pasteColors ( )
slot

Pastes colors from clipboard to the list.

See Also
copyColors
void QgsColorSchemeList::removeSelection ( )
slot

Removes any selected colors from the list.

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
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

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