#ifndef COLORPICKERSCENE_HPP #define COLORPICKERSCENE_HPP #include #include #include #include #include #include #include #include class ColorPickerScene : public QGraphicsScene, public QGraphicsView { public: ColorPickerScene(QPixmap *pixmap, QWidget *parentWidget); void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override; static void showPicker() { ColorPickerScene *s = new ColorPickerScene(screenshotutil::fullscreen(), 0); QTimer::singleShot(0, [s] { s->showFullScreen(); QScopedPointer(s); // Before anyone asks I have 0 clue about how does this not segfault }); } private: QColor color; QGraphicsEllipseItem *ellipse = 0; QGraphicsPixmapItem *pItem = 0; QGraphicsTextItem *text; QGraphicsRectItem *textBackground; }; #endif // COLORPICKERSCENE_HPP