Scroll to navigation

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

NAME

kdk::KLabel - 继承qlabel

SYNOPSIS

#include <klabel.h>

Inherits QLabel.

Signals


void enterWidget ()
鼠标进入信号 void leaveWidget ()
鼠标离开信号 void clicked (bool clicked)
鼠标点击信号 void doubleClicked ()
鼠标双击信号

Public Member Functions


KLabel (QWidget *parent=nullptr)
void setLabelType (KLabelType type=KLabelType::DataType)
设置label类型,NormalType和IconAndTextType void setDataHightColor (bool flag)
设置是否启用文本/图标高亮色 void setPixmap (const QPixmap &pixmap)
设置图标pixmap void setPixmap (QIcon icon, int width, int height)
设置图标icon const QPixmap * pixmap () const
获取图标 void setText (const QString &str)
设置文本 QString text ()
获取文本 void setBackgroundColor (bool flag, QColor color=Qt::white)
设置背景颜色 void setHighlightBackground (bool flag)
设置是否启用背景高亮色 void setBorderRadius (int bottomLeft, int topLeft, int topRight, int bottomRight)
设置圆角 void setBorderRadius (int radius)
设置圆角 void setWordWrap (bool flag)
设置是否启用换行 bool wordWrap ()
获取是否启用换行 void setFontColor (QColor color)
设置字体颜色 void setFontColorRole (QPalette::ColorRole role)
设置字体颜色colorRole void setTristate (bool flag)
设置三态是否开启 bool isTristate ()
获取三态是否开启

Protected Member Functions


void paintEvent (QPaintEvent *event)
QSize sizeHint () const
void resizeEvent (QResizeEvent *event)
virtual void enterEvent (QEvent *event)
virtual void leaveEvent (QEvent *event)
void mousePressEvent (QMouseEvent *event)
void mouseReleaseEvent (QMouseEvent *event)
void mouseDoubleClickEvent (QMouseEvent *event)

Detailed Description

继承qlabel

Since

2.4.1.0

Member Function Documentation

void kdk::KLabel::clicked (bool clicked) [signal]

鼠标点击信号

Parameters

clicked

Since

3.0.1.0

void kdk::KLabel::doubleClicked () [signal]

鼠标双击信号

Since

3.0.1.0

void kdk::KLabel::enterWidget () [signal]

鼠标进入信号

Since

3.0.1.0

bool kdk::KLabel::isTristate ()

获取三态是否开启

Returns

Since

3.0.1.0

void kdk::KLabel::leaveWidget () [signal]

鼠标离开信号

Since

3.0.1.0

const QPixmap * kdk::KLabel::pixmap () const

获取图标

Returns

void kdk::KLabel::setBackgroundColor (bool flag, QColor color = Qt::white)

设置背景颜色

Parameters

flag

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

设置圆角

Parameters

bottomLeft
topLeft
topRight
bottomRight

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

设置圆角

Parameters

radius

void kdk::KLabel::setDataHightColor (bool flag)

设置是否启用文本/图标高亮色

Parameters

flag

void kdk::KLabel::setFontColor (QColor color)

设置字体颜色

Parameters

color

Since

2.5.2.0

void kdk::KLabel::setFontColorRole (QPalette::ColorRole role)

设置字体颜色colorRole

Parameters

role

Since

3.0.1.0

void kdk::KLabel::setHighlightBackground (bool flag)

设置是否启用背景高亮色

Since

2.5.2.0

Parameters

flag

void kdk::KLabel::setLabelType (KLabelType type = KLabelType::DataType)

设置label类型,NormalType和IconAndTextType

Parameters

type

void kdk::KLabel::setPixmap (const QPixmap & pixmap)

设置图标pixmap

Parameters

pixmap

void kdk::KLabel::setPixmap (QIcon icon, int width, int height)

设置图标icon

Parameters

icon

Since

2.5.2.0-0k0.3

void kdk::KLabel::setText (const QString & str)

设置文本

Since

2.5.2.0

Parameters

str

void kdk::KLabel::setTristate (bool flag)

设置三态是否开启

Parameters

flag

Since

3.0.1.0

void kdk::KLabel::setWordWrap (bool flag)

设置是否启用换行

Since

2.5.2.0

Parameters

flag

QString kdk::KLabel::text ()

获取文本

Since

2.5.2.0

Returns

bool kdk::KLabel::wordWrap ()

获取是否启用换行

Since

2.5.2.0

Returns

Author

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

Version version:3.0 LIBKYSDK-APPLICATIONS