Advertisement
Guest User

Header File

a guest
Dec 7th, 2020
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #pragma once
  2. #include <QWidget>
  3. #include <QVector>
  4. #include <QtGui>
  5. #include <QtCore>
  6.  
  7. class Gradient : public QWidget
  8. {
  9.     struct StopColor
  10.     {
  11.         double stop;
  12.         QString color;
  13.     };
  14.  
  15. public:
  16.     QVector<StopColor> m_gradient;
  17.     int m_handle_w;
  18.     int m_handle_h;
  19.     int m_drag_position;
  20.  
  21. // Constructor
  22. public:
  23.     Gradient(QVector<StopColor> gradient);
  24.  
  25. // Public Functions
  26. public:
  27.     void _sort_gradient();
  28.     void _constrain_gradient();
  29.     void setGradient(QVector<StopColor> gradient);
  30.  
  31. signals:
  32.     void gradientChanged();
  33.  
  34. protected:
  35.     void paintEvent(QPaintEvent *e);
  36. };
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement