ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
DialogPreview.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2012 - 2020 Chris Rizzitello <sithlord48@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QLabel>
7 #include <ff7tkqtwidgets_export.h>
8 
9 class FF7TKQTWIDGETS_EXPORT DialogPreview : public QLabel
10 {
11  Q_OBJECT
12 
13 public:
17  enum CORNER {
18  TOPLEFT=0,
19  TOPRIGHT=1,
20  BOTTOMRIGHT=2,
21  BOTTOMLEFT=3,
22  };
23  Q_ENUM(CORNER)
24 
25  DialogPreview(QWidget *parent = nullptr);
26  ~DialogPreview() = default;
27  const QColor& color(DialogPreview::CORNER);
28  void setColor(DialogPreview::CORNER corner, const QColor &newColor = QColor());
29  void setEnabled(bool enabled);
30 
31 signals:
38  void colorChanged(DialogPreview::CORNER corner, const QColor& color= QColor());
39 
40 private:
41  DialogPreview::CORNER getQuad(const QPoint& point = QPoint());
42  QList<QColor> colors = {"transparent", "transparent", "transparent", "transparent"};
43  int m_cquad=-1;
44 protected:
45  void paintEvent(QPaintEvent *ev) override;
46  bool event(QEvent *ev) override;
47 };
48 
DialogPreview::CORNER
CORNER
Describes a corner the the dialog preview.
Definition: DialogPreview.h:17
DialogPreview
Definition: DialogPreview.h:9