Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
colorgrid.h
1 /*
2 
3 Pencil - Traditional Animation Software
4 Copyright (C) 2012-2017 Matthew Chiawen Chang
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; version 2 of the License.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 */
16 #ifndef COLORGRID_H
17 #define COLORGRID_H
18 
19 #include <QScrollArea>
20 
21 class FlowLayout;
22 class ColorGridItem;
23 
24 class ColorGrid : public QScrollArea
25 {
26  Q_OBJECT
27 public:
28  explicit ColorGrid(QWidget *parent = 0);
29  virtual QSize sizeHint () const;
30  virtual QSize minimumSizeHint () const;
31  QByteArray dataExport();
32  bool dataImport(const QByteArray &array);
33 signals:
34  void colorDroped(const int &, const QColor &);
35  void colorDroped(const int &);
36  void colorPicked(const int &, const QColor &);
37 
38 public slots:
39  void setColor(const int &, const QColor &);
40 protected:
41  void initItems();
42  FlowLayout* mLayout;
44  static const int gridCount = 100;
45 };
46 
47 #endif // COLORGRID_H