Added color pallette item class.

This commit is contained in:
Jim Evins
2014-07-06 15:58:22 -04:00
parent cff463a23a
commit 6c8b49f1e6
5 changed files with 179 additions and 59 deletions
+3 -25
View File
@@ -21,10 +21,7 @@
#ifndef glabels_ColorSwatch_h
#define glabels_ColorSwatch_h
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QColor>
#include <QPixmap>
namespace glabels
@@ -33,33 +30,14 @@ namespace glabels
///
/// Simple Preview Widget
///
class ColorSwatch : public QGraphicsView
class ColorSwatch : public QPixmap
{
/////////////////////////////////
// Life Cycle
/////////////////////////////////
public:
ColorSwatch( int w, int h, QColor& color, QWidget *parent = 0 );
/////////////////////////////////
// Properties
/////////////////////////////////
public:
void setColor( QColor& color );
/////////////////////////////////
// Private Data
/////////////////////////////////
private:
int mW;
int mH;
QColor mColor;
QGraphicsScene* mScene;
QGraphicsRectItem* mSwatchItem;
ColorSwatch( int w, int h, const QColor& color );
};