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 | Static Public Member Functions | Protected Member Functions | List of all members
QgsColorDialogV2 Class Reference

A custom QGIS dialog for selecting a color. More...

#include <qgscolordialog.h>

Public Slots

void setColor (const QColor color)
 Sets the current color for the dialog.

Signals

void currentColorChanged (const QColor &color)
 Emitted when the dialog's color changes.

Public Member Functions

 QgsColorDialogV2 (QWidget *parent=0, Qt::WindowFlags fl=QgisGui::ModalDialogFlags, const QColor &color=QColor())
 Create a new color picker dialog.
 ~QgsColorDialogV2 ()
QColor color () const
 Returns the current color for the dialog.
void setTitle (const QString title)
 Sets the title for the color dialog.
void setAllowAlpha (const bool allowAlpha)
 Sets whether alpha modification (transparency) is permitted for the color dialog.

Static Public Member Functions

static QColor getLiveColor (const QColor &initialColor, QObject *updateObject, const char *updateSlot, QWidget *parent=0, const QString &title=QString(), const bool allowAlpha=true)
 Return a color selection from a color dialog, with live updating of interim selections.
static QColor getColor (const QColor &initialColor, QWidget *parent, const QString &title=QString(), const bool allowAlpha=false)
 Return a color selection from a color dialog.

Protected Member Functions

void closeEvent (QCloseEvent *e)
void mousePressEvent (QMouseEvent *e)
void mouseMoveEvent (QMouseEvent *e)
void mouseReleaseEvent (QMouseEvent *e)
void keyPressEvent (QKeyEvent *e)

Detailed Description

A custom QGIS dialog for selecting a color.

Has many improvements over the standard Qt color picker dialog, including hue wheel supports, color swatches, and a color sampler.

Note
Added in version 2.5

Constructor & Destructor Documentation

QgsColorDialogV2::QgsColorDialogV2 ( QWidget *  parent = 0,
Qt::WindowFlags  fl = QgisGui::ModalDialogFlags,
const QColor &  color = QColor() 
)

Create a new color picker dialog.

Parameters
parentparent widget
flwindow flags
colorinitial color for dialog
QgsColorDialogV2::~QgsColorDialogV2 ( )

Member Function Documentation

void QgsColorDialogV2::closeEvent ( QCloseEvent *  e)
protected
QColor QgsColorDialogV2::color ( void  ) const

Returns the current color for the dialog.

Returns
dialog color
void QgsColorDialogV2::currentColorChanged ( const QColor &  color)
signal

Emitted when the dialog's color changes.

Parameters
colorcurrent color
QColor QgsColorDialogV2::getColor ( const QColor &  initialColor,
QWidget *  parent,
const QString &  title = QString(),
const bool  allowAlpha = false 
)
static

Return a color selection from a color dialog.

Parameters
initialColorthe initial color of the selection dialog.
parentparent widget
titlethe title of the dialog.
allowAlphaset to true to allow modification of color alpha value (transparency)
Returns
Selected color on accepted() or initialColor on rejected().
See Also
getLiveColor
QColor QgsColorDialogV2::getLiveColor ( const QColor &  initialColor,
QObject *  updateObject,
const char *  updateSlot,
QWidget *  parent = 0,
const QString &  title = QString(),
const bool  allowAlpha = true 
)
static

Return a color selection from a color dialog, with live updating of interim selections.

Parameters
initialColorthe initial color of the selection dialog.
updateObjectthe receiver object of the live updating.
updateSlotthe receiver object's slot for live updating (e.g. SLOT( setValidColor( const QColor& ) ) ).
parentparent widget
titlethe title of the dialog.
allowAlphaset to true to allow modification of color alpha value (transparency)
Returns
Selected color on accepted() or initialColor on rejected().
See Also
getColor
void QgsColorDialogV2::keyPressEvent ( QKeyEvent *  e)
protected
void QgsColorDialogV2::mouseMoveEvent ( QMouseEvent *  e)
protected
void QgsColorDialogV2::mousePressEvent ( QMouseEvent *  e)
protected
void QgsColorDialogV2::mouseReleaseEvent ( QMouseEvent *  e)
protected
void QgsColorDialogV2::setAllowAlpha ( const bool  allowAlpha)

Sets whether alpha modification (transparency) is permitted for the color dialog.

Defaults to true.

Parameters
allowAlphaset to false to disable alpha modification
void QgsColorDialogV2::setColor ( const QColor  color)
slot

Sets the current color for the dialog.

Parameters
colordesired color
void QgsColorDialogV2::setTitle ( const QString  title)

Sets the title for the color dialog.

Parameters
titletitle for dialog box

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