kdk::KLabel(3)

📦 version 3.0.1.2, in arch rolling, ubuntu resolute, ubuntu stonking

💖 kdk::KLabel 💖

okay bestie, gather round, because we're talking about kdk::KLabel — that's the kdk namespaced class that 继承 qlabel (it inherits from QLabel, if the Chinese wasn't already giving that away 💅). It lives in Library Functions Manual, so you already know it's a certified library-girl moment. 👑


✨ SYNOPSIS ✨

#include <klabel.h>

Inherits QLabel. that's it, that's the lineage. family tree stays winning. 🌸

📣 Signals

  • void enterWidget() — 鼠标进入信号, aka the "mouse entered the widget" signal. the mouse is here, she's arrived, announce her. 🦋
  • void leaveWidget() — 鼠标离开信号, the "mouse left the widget" signal. she said bye and meant it. 😭
  • void clicked(bool clicked) — 鼠标点击信号, the "mouse clicked" signal. classic. iconic. a click.
  • void doubleClicked() — 鼠标双击信号, the "mouse double-clicked" signal. two taps, double the drama. ✨

🫶 Public Member Functions

  • KLabel(QWidget *parent=nullptr) — the constructor, with parent defaulting to nullptr. no cap.
  • void setLabelType(KLabelType type=KLabelType::DataType) — 设置label类型,NormalType和IconAndTextType — sets the label type, and the options are NormalType and IconAndTextType. pick your fighter. 🎀
  • void setDataHightColor(bool flag) — 设置是否启用文本/图标高亮色 — turns the text/icon highlight colour on or off. (yes, it's spelled Hight, we don't fix it, we respect it. 🙈)
  • void setPixmap(const QPixmap &pixmap) — 设置图标 pixmap — sets the icon from a pixmap.
  • void setPixmap(QIcon icon, int width, int height) — 设置图标 icon — sets the icon from a QIcon, with a width and a height.
  • const QPixmap *pixmap() const — 获取图标 — grabs the icon. 📸
  • void setText(const QString &str) — 设置文本 — sets the text.
  • QString text() — 获取文本 — gets the text.
  • void setBackgroundColor(bool flag, QColor color=Qt::white) — 设置背景颜色 — sets the background colour, with color defaulting to Qt::white. 🤍
  • void setHighlightBackground(bool flag) — 设置是否启用背景高亮色 — turns the background highlight colour on or off.
  • void setBorderRadius(int bottomLeft, int topLeft, int topRight, int bottomRight) — 设置圆角 — sets the corner rounding, one value per corner.
  • void setBorderRadius(int radius) — 设置圆角 — sets the corner rounding, one value for all of them. slay.
  • void setWordWrap(bool flag) — 设置是否启用换行 — turns word wrap on or off.
  • bool wordWrap() — 获取是否启用换行 — gets whether word wrap is on.
  • void setFontColor(QColor color) — 设置字体颜色 — sets the font colour.
  • void setFontColorRole(QPalette::ColorRole role) — 设置字体颜色 colorRole — sets the font colour via a QPalette::ColorRole.
  • void setTristate(bool flag) — 设置三态是否开启 — turns tristate on or off. three states, three moods. 💀
  • bool isTristate() — 获取三态是否开启 — gets whether tristate is on.

🧚 Protected Member Functions

these are the internals, the backstage pass, the iykyk tier:

  • 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 — it inherits QLabel. that's the whole vibe.

Since: 2.4.1.0 ⭐


👑 Member Function Documentation

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

鼠标点击信号 — the mouse click signal. 🖱️

Parameters

  • clicked

Since: 3.0.1.0


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

鼠标双击信号 — the mouse double-click signal. two clicks, no notes. ✌️

Since: 3.0.1.0


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

鼠标进入信号 — the mouse entered signal. the mouse is in the building. 🏠

Since: 3.0.1.0


bool kdk::KLabel::isTristate()

获取三态是否开启 — gets whether tristate is enabled.

Returns — (nothing listed, bestie, the docs left it blank 😭)

Since: 3.0.1.0


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

鼠标离开信号 — the mouse left signal. she's gone, she's gone. 💔

Since: 3.0.1.0


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

获取图标 — gets the icon.

Returns — (also left blank in the docs, we're just vibing 🙈)


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

设置背景颜色 — sets the background colour.

Parameters

  • flag
note that color defaults to Qt::white, and the docs only list flag under Parameters. that's what the page says, so that's what we're saying. 💅

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

设置圆角 — sets the border radius.

Parameters

  • bottomLeft
  • topLeft
  • topRight
  • bottomRight

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

设置圆角 — sets the border radius (the one-value edition).

Parameters

  • radius

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

设置是否启用文本/图标高亮色 — sets whether the text/icon highlight colour is enabled.

Parameters

  • flag

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

设置字体颜色 — sets the font colour.

Parameters

  • color

Since: 2.5.2.0


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

设置字体颜色 colorRole — sets the font colour colorRole.

Parameters

  • role

Since: 3.0.1.0


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

设置是否启用背景高亮色 — sets whether the background highlight colour is enabled.

Since: 2.5.2.0

Parameters

  • flag

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

设置label类型,NormalType和IconAndTextType — sets the label type, NormalType and IconAndTextType. type defaults to KLabelType::DataType. 🌟

Parameters

  • type

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

设置图标 pixmap — sets the icon pixmap.

Parameters

  • pixmap

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

设置图标 icon — sets the icon from a QIcon.

Parameters

  • icon

Since: 2.5.2.0-0k0.3 (yes, that's the version string, character for character, don't @ me 💀)


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

设置文本 — sets the text.

Since: 2.5.2.0

Parameters

  • str

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

设置三态是否开启 — sets whether tristate is enabled.

Parameters

  • flag

Since: 3.0.1.0


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

设置是否启用换行 — sets whether word wrap is enabled.

Since: 2.5.2.0

Parameters

  • flag

QString kdk::KLabel::text()

获取文本 — gets the text.

Since: 2.5.2.0

Returns — (blank in the source, we move on 🫶)


bool kdk::KLabel::wordWrap()

获取是否启用换行 — gets whether word wrap is enabled.

Since: 2.5.2.0

Returns — (also blank, also moving on 🌸)


🎀 Author

Generated automatically by Doxygen for LIBKYSDK-APPLICATIONS from the source code. the robot wrote the docs, the robot gets the credit, periodt. 🤖✨


and that's the whole page, bestie!! 💜 this icon of a manual page is brought to you by LIBKYSDK-APPLICATIONS, Version version:3.0, filing itself under kdk::KLabel(3). no cap, go build something cute with it. 🦋💖

📦 where this page comes from