Scroll to navigation

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

NAME

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

SYNOPSIS

#include <kpushbutton.h>

Inherits QPushButton.

Public Types


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

Public Member Functions


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 ()
返回加载样式

Protected Member Functions


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

Detailed Description

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

Since

1.2.0

Member Function Documentation

QColor kdk::KPushButton::backgroundColor ()

获取按钮背景色

Returns

color

int kdk::KPushButton::borderRadius ()

获取按钮圆角

Returns

radius

ButtonType kdk::KPushButton::buttonType ()

获取KPushButton的类型

Returns

bool kdk::KPushButton::hasArrow () const

返回是否显示箭头

Returns

bool

Since

2.4.1.0

QColor kdk::KPushButton::IconColor ()

获取按钮添加图标的颜色

Returns

bool kdk::KPushButton::isBackgroundColorHighlight ()

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

Returns

bool kdk::KPushButton::isIconHighlight ()

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

Returns

bool kdk::KPushButton::isLoading ()

返回加载样式

Returns

Since

2.5.2.0

bool kdk::KPushButton::isTranslucent ()

判断KPushButton是否为半透明

Returns

void kdk::KPushButton::setArrow (bool flag, ArrowDirection arrowDirection = ArrowBottom)

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

Parameters

flag
arrowDirection

Since

2.4.1.0

void kdk::KPushButton::setBackgroundColor (QColor color)

设置按钮背景色

Parameters

color

void kdk::KPushButton::setBackgroundColorHighlight (bool flag)

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

Parameters

flag

void kdk::KPushButton::setBorderRadius (int bottomLeft, int topLeft, int topRight, int bottomRight)

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

Parameters

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

void kdk::KPushButton::setBorderRadius (int radius)

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

Parameters

radius

void kdk::KPushButton::setButtonType (ButtonType type)

设置KPushButton的类型

Parameters

type

void kdk::KPushButton::setIconColor (QColor color)

设置按钮添加图标的颜色

Parameters

color

void kdk::KPushButton::setIconHighlight (bool flag)

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

Parameters

flag

void kdk::KPushButton::setLoaingStatus (bool flag)

设置加载样式

Parameters

flag

Since

2.5.2.0

void kdk::KPushButton::setTranslucent (bool flag)

设置KPushButton是否为半透明

Parameters

flag

Author

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

Version version:3.0 LIBKYSDK-APPLICATIONS