kdk::KPushButton(3) Library Functions Manual kdk::KPushButton(3)

kdk::KPushButton - 1.提供半透明效果 2.可以设置按钮圆角、背景色、图标是否跟随系统高亮 3.可以设置按钮类型,分为正常类型和圆形(需要设置大小实现正圆),其余同QPushButton

#include <kpushbutton.h>

Inherits QPushButton.


enum ButtonType { NormalType, CircleType, GrayType, ShadowType }
支持两种样式的按钮 enum ArrowDirection { ArrowTop, ArrowBottom, ArrowLeft, ArrowRight }


KPushButton (QWidget *parent=nullptr)
void setBorderRadius (int radius)
设置按钮圆角 通过圆角半径设置按钮圆角(每个圆角相同) void setBorderRadius (int bottomLeft, int topLeft, int topRight, int bottomRight)
设置按钮圆角 通过四个点来设置圆角 int borderRadius ()
获取按钮圆角 void setBackgroundColor (QColor color)
设置按钮背景色 QColor backgroundColor ()
获取按钮背景色 void setButtonType (ButtonType type)
设置KPushButton的类型 ButtonType buttonType ()
获取KPushButton的类型 void setTranslucent (bool flag)
设置KPushButton是否为半透明 bool isTranslucent ()
判断KPushButton是否为半透明 void setIconHighlight (bool flag)
设置图标是否跟随系统高亮色,默认不跟随 bool isIconHighlight ()
判断图标是否跟随系统高亮色 void setIconColor (QColor color)
设置按钮添加图标的颜色 QColor IconColor ()
获取按钮添加图标的颜色 void setBackgroundColorHighlight (bool flag)
设置按钮背景色是否跟随系统高亮色,默认不跟随 bool isBackgroundColorHighlight ()
判断按钮背景色是否跟随系统高亮色 void setArrow (bool flag, ArrowDirection arrowDirection=ArrowBottom)
设置是否显示箭头flag,设置箭头方向arrowDirection bool hasArrow () const
返回是否显示箭头 void setLoaingStatus (bool flag)
设置加载样式 bool isLoading ()
返回加载样式


bool eventFilter (QObject *watched, QEvent *event)
void paintEvent (QPaintEvent *event)

1.提供半透明效果 2.可以设置按钮圆角、背景色、图标是否跟随系统高亮 3.可以设置按钮类型,分为正常类型和圆形(需要设置大小实现正圆),其余同QPushButton

Since

1.2.0

获取按钮背景色

Returns

color

获取按钮圆角

Returns

radius

ButtonType kdk::KPushButton::buttonType ()

获取KPushButton的类型

Returns

返回是否显示箭头

Returns

bool

Since

2.4.1.0

获取按钮添加图标的颜色

Returns

判断按钮背景色是否跟随系统高亮色

Returns

判断图标是否跟随系统高亮色

Returns

返回加载样式

Returns

Since

2.5.2.0

判断KPushButton是否为半透明

Returns

设置是否显示箭头flag,设置箭头方向arrowDirection

Parameters

flag
arrowDirection

Since

2.4.1.0

设置按钮背景色

Parameters

color

设置按钮背景色是否跟随系统高亮色,默认不跟随

Parameters

flag

设置按钮圆角 通过四个点来设置圆角

Parameters

bottomLeft(左下)
topLeft(左上)
topRight(右上)
bottomRight(右下)

设置按钮圆角 通过圆角半径设置按钮圆角(每个圆角相同)

Parameters

radius

设置KPushButton的类型

Parameters

type

设置按钮添加图标的颜色

Parameters

color

设置图标是否跟随系统高亮色,默认不跟随

Parameters

flag

设置加载样式

Parameters

flag

Since

2.5.2.0

设置KPushButton是否为半透明

Parameters

flag

Generated automatically by Doxygen for LIBKYSDK-APPLICATIONS from the source code.

Version version:3.0 LIBKYSDK-APPLICATIONS