table of contents
| 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
Member Function Documentation¶
QColor kdk::KPushButton::backgroundColor ()¶
获取按钮背景色
Returns
int kdk::KPushButton::borderRadius ()¶
获取按钮圆角
Returns
ButtonType kdk::KPushButton::buttonType ()¶
获取KPushButton的类型
Returns
bool kdk::KPushButton::hasArrow () const¶
返回是否显示箭头
Returns
Since
QColor kdk::KPushButton::IconColor ()¶
获取按钮添加图标的颜色
Returns
bool kdk::KPushButton::isBackgroundColorHighlight ()¶
判断按钮背景色是否跟随系统高亮色
Returns
bool kdk::KPushButton::isIconHighlight ()¶
判断图标是否跟随系统高亮色
Returns
bool kdk::KPushButton::isLoading ()¶
返回加载样式
Returns
Since
bool kdk::KPushButton::isTranslucent ()¶
判断KPushButton是否为半透明
Returns
void kdk::KPushButton::setArrow (bool flag, ArrowDirection arrowDirection = ArrowBottom)¶
设置是否显示箭头flag,设置箭头方向arrowDirection
Parameters
arrowDirection
Since
void kdk::KPushButton::setBackgroundColor (QColor color)¶
设置按钮背景色
Parameters
void kdk::KPushButton::setBackgroundColorHighlight (bool flag)¶
设置按钮背景色是否跟随系统高亮色,默认不跟随
Parameters
void kdk::KPushButton::setBorderRadius (int bottomLeft, int topLeft, int topRight, int bottomRight)¶
设置按钮圆角 通过四个点来设置圆角
Parameters
topLeft(左上)
topRight(右上)
bottomRight(右下)
void kdk::KPushButton::setBorderRadius (int radius)¶
设置按钮圆角 通过圆角半径设置按钮圆角(每个圆角相同)
Parameters
void kdk::KPushButton::setButtonType (ButtonType type)¶
设置KPushButton的类型
Parameters
void kdk::KPushButton::setIconColor (QColor color)¶
设置按钮添加图标的颜色
Parameters
void kdk::KPushButton::setIconHighlight (bool flag)¶
设置图标是否跟随系统高亮色,默认不跟随
Parameters
void kdk::KPushButton::setLoaingStatus (bool flag)¶
设置加载样式
Parameters
Since
void kdk::KPushButton::setTranslucent (bool flag)¶
设置KPushButton是否为半透明
Parameters
Author¶
Generated automatically by Doxygen for LIBKYSDK-APPLICATIONS from the source code.
| Version version:3.0 | LIBKYSDK-APPLICATIONS |