5#ifndef DARROWRECTANGLE_H
6#define DARROWRECTANGLE_H
8#include <QDesktopWidget>
19#include <dtkwidget_global.h>
20#include <DThemeManager>
21#include <dgraphicsgloweffect.h>
22#include <DBlurEffectWidget>
24DWIDGET_BEGIN_NAMESPACE
26class DPlatformWindowHandle;
27class DArrowRectanglePrivate;
28class LIBDTKWIDGETSHARED_EXPORT
DArrowRectangle :
public QWidget,
public DTK_CORE_NAMESPACE::DObject
48 explicit DArrowRectangle(ArrowDirection direction, QWidget *parent =
nullptr);
49 explicit DArrowRectangle(ArrowDirection direction, FloatMode floatMode, QWidget *parent =
nullptr);
52 Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
53 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
54 Q_PROPERTY(
int borderWidth READ borderWidth WRITE setBorderWidth)
55 Q_PROPERTY(
int radius READ radius WRITE setRadius)
56 Q_PROPERTY(
int arrowWidth READ arrowWidth WRITE setArrowWidth)
57 Q_PROPERTY(
int arrowHeight READ arrowHeight WRITE setArrowHeight)
58 Q_PROPERTY(
int arrowX READ arrowX WRITE setArrowX)
59 Q_PROPERTY(
int arrowY READ arrowY WRITE setArrowY)
60 Q_PROPERTY(
int margin READ margin WRITE setMargin)
61 Q_PROPERTY(ArrowDirection arrowDirection READ arrowDirection WRITE setArrowDirection)
62 Q_PROPERTY(qreal shadowXOffset READ shadowXOffset WRITE setShadowXOffset)
63 Q_PROPERTY(qreal shadowYOffset READ shadowYOffset WRITE setShadowYOffset)
64 Q_PROPERTY(qreal shadowBlurRadius READ shadowBlurRadius WRITE setShadowBlurRadius)
67 bool radiusForceEnabled()
const;
68 int arrowHeight()
const;
69 int arrowWidth()
const;
73 int borderWidth()
const;
74 QColor borderColor()
const;
75 QColor backgroundColor()
const;
76 ArrowDirection arrowDirection()
const;
78 void setRadius(
int value);
79 void setRadiusForceEnable(
bool enable);
80 void setArrowHeight(
int value);
81 void setArrowWidth(
int value);
82 void setArrowX(
int value);
83 void setArrowY(
int value);
84 void setMargin(
int value);
85 void setBorderWidth(
int borderWidth);
86 void setBorderColor(
const QColor &borderColor);
87 void setBackgroundColor(
const QColor &backgroundColor);
88 void setBackgroundColor(DBlurEffectWidget::MaskColorType type);
89 void setArrowDirection(ArrowDirection value);
90 void setWidth(
int value);
91 void setHeight(
int value);
93 virtual void show(
int x,
int y);
95 void setContent(QWidget *content);
96 QWidget *getContent()
const;
97 void resizeWithContent();
98 void move(
int x,
int y);
101 qreal shadowXOffset()
const;
102 qreal shadowYOffset()
const;
103 qreal shadowBlurRadius()
const;
105 void setShadowBlurRadius(
const qreal &shadowBlurRadius);
106 void setShadowXOffset(
const qreal &shadowXOffset);
107 void setShadowYOffset(
const qreal &shadowYOffset);
109 void setLeftRightRadius(
bool enable);
110 void setRadiusArrowStyleEnable(
bool enable);
113 void windowDeactivate()
const;
116 void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
117 void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
118 bool event(
QEvent *e) Q_DECL_OVERRIDE;