tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
Color_Preview Class Reference

#include <color_preview.hpp>

Inheritance diagram for Color_Preview:
Color_Selector Bound_Color_Selector

Classes

class  Private
 

Public Types

enum  Display_Mode { NoAlpha, AllAlpha, SplitAlpha, SplitColor }
 

Public Slots

void setColor (const QColor &c)
 Set current color. More...
 
void setComparisonColor (const QColor &c)
 Set the comparison color. More...
 

Signals

void clicked ()
 Emitted when the user clicks on the widget. More...
 
void colorChanged (QColor)
 Emitted on setColor. More...
 

Public Member Functions

 Color_Preview (QWidget *parent=0)
 
 ~Color_Preview ()
 
QBrush background () const
 Get the background visible under transparent colors. More...
 
void setBackground (const QBrush &bk)
 Change the background visible under transparent colors. More...
 
Display_Mode displayMode () const
 Get color display mode. More...
 
void setDisplayMode (Display_Mode dm)
 Set how transparent colors are handled. More...
 
QColor color () const
 Get current color. More...
 
QColor comparisonColor () const
 Get the comparison color. More...
 
QSize sizeHint () const
 
void paint (QPainter &painter, QRect rect) const
 

Protected Member Functions

void paintEvent (QPaintEvent *)
 
void resizeEvent (QResizeEvent *)
 
void mouseReleaseEvent (QMouseEvent *ev)
 
void mouseMoveEvent (QMouseEvent *ev)
 

Properties

QColor color
 
QColor comparisonColor
 
Display_Mode display_mode
 
QBrush background
 

Detailed Description

Author
Mattia Basaglia

License

Copyright (C) 2013-2015 Mattia Basaglia
Copyright (C) 2014 Calle Laakkonen

This software is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Color Widgets.  If not, see <http://www.gnu.org/licenses/>.

Simple widget that shows a preview of a color

Member Enumeration Documentation

Enumerator
NoAlpha 

Show current color with no transparency.

AllAlpha 

show current color with transparency

SplitAlpha 

Show both solid and transparent side by side.

SplitColor 

Show current and comparison colors side by side.

Constructor & Destructor Documentation

Color_Preview::Color_Preview ( QWidget *  parent = 0)
explicit
Color_Preview::~Color_Preview ( )

Member Function Documentation

QBrush Color_Preview::background ( ) const

Get the background visible under transparent colors.

void Color_Preview::clicked ( )
signal

Emitted when the user clicks on the widget.

QColor Color_Preview::color ( ) const

Get current color.

void Color_Preview::colorChanged ( QColor  )
signal

Emitted on setColor.

QColor Color_Preview::comparisonColor ( ) const

Get the comparison color.

Color_Preview::Display_Mode Color_Preview::displayMode ( ) const

Get color display mode.

void Color_Preview::mouseMoveEvent ( QMouseEvent *  ev)
protected
void Color_Preview::mouseReleaseEvent ( QMouseEvent *  ev)
protected
void Color_Preview::paint ( QPainter &  painter,
QRect  rect 
) const
void Color_Preview::paintEvent ( QPaintEvent *  )
protected
void Color_Preview::resizeEvent ( QResizeEvent *  )
protected
void Color_Preview::setBackground ( const QBrush &  bk)

Change the background visible under transparent colors.

void Color_Preview::setColor ( const QColor &  c)
slot

Set current color.

void Color_Preview::setComparisonColor ( const QColor &  c)
slot

Set the comparison color.

void Color_Preview::setDisplayMode ( Display_Mode  dm)

Set how transparent colors are handled.

QSize Color_Preview::sizeHint ( ) const

Property Documentation

QBrush Color_Preview::background
readwrite
QColor Color_Preview::color
readwrite
QColor Color_Preview::comparisonColor
readwrite
Display_Mode Color_Preview::display_mode
readwrite

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