DtkWidget 5.6.0.2
DTK Widget module
Public 类型 | 信号 | Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
Dtk::Widget::DArrowRectangle类 参考

DArrowRectangle 提供了可以在四个边中的任意一个边显示箭头的矩形控件. 更多...

类 Dtk::Widget::DArrowRectangle 继承关系图:
Inheritance graph
[图例]
Dtk::Widget::DArrowRectangle 的协作图:
Collaboration graph
[图例]

Public 类型

enum  ArrowDirection { ArrowLeft , ArrowRight , ArrowTop , ArrowBottom }
 
enum  FloatMode { FloatWindow , FloatWidget }
 

信号

void windowDeactivate () const
 

Public 成员函数

 DArrowRectangle (ArrowDirection direction, QWidget *parent=nullptr)
 DArrowRectangle::DArrowRectangle constructs an instance of DArrowRectangle. 更多...
 
 DArrowRectangle (ArrowDirection direction, FloatMode floatMode, QWidget *parent=nullptr)
 获取 DArrowRectangle 实例,并指定浮动模式. 更多...
 
int radius () const
 
bool radiusForceEnabled () const
 是否强制(忽略特效)开启圆角 更多...
 
int arrowHeight () const
 
int arrowWidth () const
 
int arrowX () const
 
int arrowY () const
 
int margin () const
 
int borderWidth () const
 
QColor borderColor () const
 
QColor backgroundColor () const
 
ArrowDirection arrowDirection () const
 
void setRadius (int value)
 该函数用于设置圆角大小. 更多...
 
void setRadiusForceEnable (bool enable)
 DArrowRectangle::setRadiusForceEnable 设置圆角样式. 更多...
 
void setArrowHeight (int value)
 设置箭头高度. 更多...
 
void setArrowWidth (int value)
 设置箭头宽度. 更多...
 
void setArrowX (int value)
 设置箭头 x 坐标的值. 更多...
 
void setArrowY (int value)
 设置箭头 y 坐标的值. 更多...
 
void setMargin (int value)
 设置边距大小. 更多...
 
void setBorderWidth (int borderWidth)
 
void setBorderColor (const QColor &borderColor)
 
void setBackgroundColor (const QColor &backgroundColor)
 
void setBackgroundColor (DBlurEffectWidget::MaskColorType type)
 DArrowRectangle::setBackgroundColor is an overloaded function. 更多...
 
void setArrowDirection (ArrowDirection value)
 该函数用于设置箭头方向. 更多...
 
void setWidth (int value)
 该函数用于设置整个控件固定的宽度 更多...
 
void setHeight (int value)
 设置整个控件固定的高度 更多...
 
virtual void show (int x, int y)
 在指定的坐标位置显示本控件; 更多...
 
void setContent (QWidget *content)
 DArrowRectangle::setContent sets the content of the arrow rectangle. 更多...
 
QWidget * getContent () const
 获取内容控件. 更多...
 
void resizeWithContent ()
 根据内容控件的大小自动设置矩形控件的大小. 更多...
 
void move (int x, int y)
 移动到指定的坐标位置. 更多...
 
QSize getFixedSize ()
 获取整个矩形控件的大小. 更多...
 
qreal shadowXOffset () const
 
qreal shadowYOffset () const
 
qreal shadowBlurRadius () const
 
void setShadowBlurRadius (const qreal &shadowBlurRadius)
 
void setShadowXOffset (const qreal &shadowXOffset)
 
void setShadowYOffset (const qreal &shadowYOffset)
 
void setLeftRightRadius (bool enable)
 DArrowRectangle::setLeftRightRadius 设置左右箭头时的圆角. 更多...
 
void setRadiusArrowStyleEnable (bool enable)
 DArrowRectangle::setArrowStyleEnable 设置圆角箭头样式. 更多...
 

Protected 成员函数

void paintEvent (QPaintEvent *) Q_DECL_OVERRIDE
 
void resizeEvent (QResizeEvent *e) Q_DECL_OVERRIDE
 
bool event (QEvent *e) Q_DECL_OVERRIDE
 

属性

QColor backgroundColor
 这个属性表示矩形控件的背景颜色 更多...
 
QColor borderColor
 这个属性表示控件边框的颜色 更多...
 
int borderWidth
 这个属性表示控件边框的宽度 更多...
 
int radius
 这个属性表示矩形的圆角 更多...
 
int arrowWidth
 这个属性表示箭头的宽度 更多...
 
int arrowHeight
 height of rectangle's arrow 更多...
 
int arrowX
 the x coordinate of the rectangle's arrow 更多...
 
int arrowY
 这个属性表示箭头的y轴坐标 更多...
 
int margin
 这个属性表示边距大小 更多...
 
ArrowDirection arrowDirection
 This property holds the direction of the rectangle's arrow points to. 更多...
 
qreal shadowXOffset
 这属性表示小部件及其阴影在x轴上的偏移量 更多...
 
qreal shadowYOffset
 这属性表示小部件及其阴影在y轴上的偏移量. 更多...
 
qreal shadowBlurRadius
 这个属性保存小部件阴影的模糊半径 更多...
 

详细描述

DArrowRectangle 提供了可以在四个边中的任意一个边显示箭头的矩形控件.

\inmodule dtkwidget

The DArrowRectangle class provides a widget that has an arrow on one of its four borders.

通常用于作为其他控件的容器,将其显示在矩形内作为内容控件 It's usually used as a container of some other widgets, see DArrowRectangle::setContent()

参见
DArrowRectangle::setContent()

构造及析构函数说明

◆ DArrowRectangle() [1/2]

Dtk::Widget::DArrowRectangle::DArrowRectangle ( ArrowDirection  direction,
QWidget *  parent = nullptr 
)
explicit

DArrowRectangle::DArrowRectangle constructs an instance of DArrowRectangle.

获取 DArrowRectangle 实例

direction is used to initialize the direction of which the arrow points to. parent is the parent widget the arrow rectangle will be attached to. direction 用于初始化箭头的方向 parent 作为其父控件

◆ DArrowRectangle() [2/2]

Dtk::Widget::DArrowRectangle::DArrowRectangle ( ArrowDirection  direction,
FloatMode  floatMode,
QWidget *  parent = nullptr 
)
explicit

获取 DArrowRectangle 实例,并指定浮动模式.

DArrowRectangle::DArrowRectangle can set DArrowRectangle show as a window or a widget in parentWidget by floatMode

direction 用于初始化箭头的方向 floatMode parent 作为其父控件

参见
DArrowRectangle::FloatMode

成员函数说明

◆ getContent()

QWidget * Dtk::Widget::DArrowRectangle::getContent ( ) const

获取内容控件.

返回
正在显示的内容控件

◆ getFixedSize()

QSize Dtk::Widget::DArrowRectangle::getFixedSize ( )

获取整个矩形控件的大小.

DArrowRectangle::getFixedSize.

返回
矩形控件的大小
the size of the whole widget.

◆ move()

void Dtk::Widget::DArrowRectangle::move ( int  x,
int  y 
)

移动到指定的坐标位置.

DArrowRectangle::move moves the widget to the coordinate that provided,

参数的作用类似于 DArrowRectangle::show , 移动整个控件直到箭头出现在参数中指定的坐标 Like the rules in DArrowRectangle::show(int x, int y), it moves the widget so that the arrow head's coordinate matches the one that provided.

x 控件箭头的x轴坐标 y 控件箭头的y轴坐标 x is the x coordinate of the arrow head. y is the y coordinate of the arrow head.

参见
DArrowRectangle::show(int x, int y)
DArrowRectangle::show

◆ radiusForceEnabled()

bool Dtk::Widget::DArrowRectangle::radiusForceEnabled ( ) const

是否强制(忽略特效)开启圆角

Getter: DArrowRectangle::radiusForceEnabled , Setter: DArrowRectangle::setRadiusForceEnable

◆ resizeWithContent()

void Dtk::Widget::DArrowRectangle::resizeWithContent ( )

根据内容控件的大小自动设置矩形控件的大小.

DArrowRectangle::resizeWithContent automatically adjust the rectangle's size to fit the its content.

◆ setArrowDirection()

void Dtk::Widget::DArrowRectangle::setArrowDirection ( ArrowDirection  value)

该函数用于设置箭头方向.

value 箭头方向.

参见
DArrowRectangle::arrowDirection

◆ setArrowHeight()

void Dtk::Widget::DArrowRectangle::setArrowHeight ( int  value)

设置箭头高度.

value 箭头高度.

参见
DArrowRectangle::arrowHeight

◆ setArrowWidth()

void Dtk::Widget::DArrowRectangle::setArrowWidth ( int  value)

设置箭头宽度.

value 箭头宽度.

参见
DArrowRectangle::arrowWidth

◆ setArrowX()

void Dtk::Widget::DArrowRectangle::setArrowX ( int  value)

设置箭头 x 坐标的值.

value x 坐标的值.

参见
DArrowRectangle::arrowX

◆ setArrowY()

void Dtk::Widget::DArrowRectangle::setArrowY ( int  value)

设置箭头 y 坐标的值.

value y 坐标的值.

参见
DArrowRectangle::arrowY

◆ setBackgroundColor()

void Dtk::Widget::DArrowRectangle::setBackgroundColor ( DBlurEffectWidget::MaskColorType  type)

DArrowRectangle::setBackgroundColor is an overloaded function.

DArrowRectangle::setBackgroundColor 是一个重载方法

通过改变 DBlurEffectWidget::MaskColorType 来修改控件矩形的背景 It sets the background color by modifing the mask color of the Dtk::Widget::DBlurEffectWidget.

type is the mask color to set.

参见
DArrowRectangle::backgroundColor DBlurEffectWidget::MaskColorType

◆ setContent()

void Dtk::Widget::DArrowRectangle::setContent ( QWidget *  content)

DArrowRectangle::setContent sets the content of the arrow rectangle.

设置要显示在矩形内的内容控件.

content 要显示内容控件

◆ setHeight()

void Dtk::Widget::DArrowRectangle::setHeight ( int  value)

设置整个控件固定的高度

value 高度大小

◆ setLeftRightRadius()

void Dtk::Widget::DArrowRectangle::setLeftRightRadius ( bool  enable)

DArrowRectangle::setLeftRightRadius 设置左右箭头时的圆角.

enable 是否开启.

◆ setMargin()

void Dtk::Widget::DArrowRectangle::setMargin ( int  value)

设置边距大小.

value 边距大小.

参见
DArrowRectangle::margin

◆ setRadius()

void Dtk::Widget::DArrowRectangle::setRadius ( int  value)

该函数用于设置圆角大小.

value 圆角大小.

参见
DArrowRectangle::radius

◆ setRadiusArrowStyleEnable()

void Dtk::Widget::DArrowRectangle::setRadiusArrowStyleEnable ( bool  enable)

DArrowRectangle::setArrowStyleEnable 设置圆角箭头样式.

enable 是否开启.

◆ setRadiusForceEnable()

void Dtk::Widget::DArrowRectangle::setRadiusForceEnable ( bool  enable)

DArrowRectangle::setRadiusForceEnable 设置圆角样式.

默认窗管支持特效混成时有圆角,没有特效时没有圆角,如果启用一直都有圆角 enable 是否开启.

◆ setWidth()

void Dtk::Widget::DArrowRectangle::setWidth ( int  value)

该函数用于设置整个控件固定的宽度

value 宽度大小

◆ show()

void Dtk::Widget::DArrowRectangle::show ( int  x,
int  y 
)
virtual

在指定的坐标位置显示本控件;

DArrowRectangle::show shows the widget at the given coordinate.

注解
坐标被计算为箭头的位置,所以你不需要自己计算箭头位置
The coordiate is calculated to be the arrow head's position, so you don't need to calculate the position yourself.

x 控件箭头的x轴坐标 y 控件箭头的y轴坐标 x is the x coordinate of the arrow head. y is the y coordinate of the arrow head.

属性说明

◆ arrowDirection

Dtk::Widget::DArrowRectangle::arrowDirection
readwrite

This property holds the direction of the rectangle's arrow points to.

这个属性表示箭头的方向

Getter: DArrowRectangle::arrowDirection , Setter: DArrowRectangle::setArrowDirection

◆ arrowHeight

Dtk::Widget::DArrowRectangle::arrowHeight
readwrite

height of rectangle's arrow

这个属性表示箭头的高度

Getter: DArrowRectangle::arrowHeight , Setter: DArrowRectangle::setArrowHeight

参见
DArrowRectangle::arrowWidth

◆ arrowWidth

Dtk::Widget::DArrowRectangle::arrowWidth
readwrite

这个属性表示箭头的宽度

width of the rectangle's arrow

Getter: DArrowRectangle::arrowWidth , Setter: DArrowRectangle::setArrowWidth

参见
DArrowRectangle::arrowHeight

◆ arrowX

Dtk::Widget::DArrowRectangle::arrowX
readwrite

the x coordinate of the rectangle's arrow

这个属性表示箭头的x轴坐标

Getter: DArrowRectangle::arrowX , Setter: DArrowRectangle::setArrowX

参见
DArrowRectangle::arrowY

◆ arrowY

Dtk::Widget::DArrowRectangle::arrowY
readwrite

这个属性表示箭头的y轴坐标

the y coordinate of the rectangle's arrow

Getter: DArrowRectangle::arrowY , Setter: DArrowRectangle::setArrowY

参见
DArrowRectangle::arrowX

◆ backgroundColor

Dtk::Widget::DArrowRectangle::backgroundColor
readwrite

这个属性表示矩形控件的背景颜色

the background color of this rectangle.

Getter: DArrowRectangle::backgroundColor , Setter: DArrowRectangle::setBackgroundColor

◆ borderColor

Dtk::Widget::DArrowRectangle::borderColor
readwrite

这个属性表示控件边框的颜色

This property holds the border color of this widget.

Getter: DArrowRectangle::borderColor , Setter: DArrowRectangle::setBorderColor

◆ borderWidth

Dtk::Widget::DArrowRectangle::borderWidth
readwrite

这个属性表示控件边框的宽度

This property holds the border width of this widget.

Getter: DArrowRectangle::borderWidth , Setter: DArrowRectangle::setBorderWidth

◆ margin

Dtk::Widget::DArrowRectangle::margin
readwrite

这个属性表示边距大小

This property holds the width of the margin

The margin is the distance between the innermost pixel of the rectangle and the outermost pixel of its contents. The default margin is 0. 边距是指矩形最里面的像素与其内容最外面的像素之间的距离 Getter: DArrowRectangle::margin , Setter: DArrowRectangle::setMargin

参见
DArrowRectangle::setMargin

◆ radius

Dtk::Widget::DArrowRectangle::radius
readwrite

这个属性表示矩形的圆角

radius of the rectangle

Getter: DArrowRectangle::radius , Setter: DArrowRectangle::setRadius

◆ shadowBlurRadius

Dtk::Widget::DArrowRectangle::shadowBlurRadius
readwrite

这个属性保存小部件阴影的模糊半径

This property holds the blur radius of the widget's shadow.

Getter: DArrowRectangle::shadowBlurRadius Setter: DArrowRectangle::setShadowBlurRadius

◆ shadowXOffset

Dtk::Widget::DArrowRectangle::shadowXOffset
readwrite

这属性表示小部件及其阴影在x轴上的偏移量

the offset of the widget and its shadow on x axis.

Getter: DArrowRectangle::shadowXOffset Setter: DArrowRectangle::setShadowXOffset

参见
DArrowRectangle::shadowYOffset

◆ shadowYOffset

Dtk::Widget::DArrowRectangle::shadowYOffset
readwrite

这属性表示小部件及其阴影在y轴上的偏移量.

the offset of the widget and its shadow on y axis.

Getter: DArrowRectangle::shadowYOffset Setter: DArrowRectangle::setShadowYOffset

参见
DArrowRectangle::shadowXOffset

该类的文档由以下文件生成: