kdk::KLabel(3)
💖 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, withparentdefaulting tonullptr. no cap.void setLabelType(KLabelType type=KLabelType::DataType)— 设置label类型,NormalType和IconAndTextType— sets the label type, and the options areNormalTypeandIconAndTextType. pick your fighter. 🎀void setDataHightColor(bool flag)— 设置是否启用文本/图标高亮色 — turns the text/icon highlight colour on or off. (yes, it's spelledHight, 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 aQIcon, with awidthand aheight.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, withcolordefaulting toQt::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 aQPalette::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() constvoid 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 thatcolordefaults toQt::white, and the docs only listflagunder 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
bottomLefttopLefttopRightbottomRight
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
- arch rolling: libkysdk-applications 3.0.1.2-1 · BSD-3-Clause AND GPL-3.0-or-later AND LGPL-2.1-or-later AND LGPL-3.0-or-later AND MIT AND MulanPSL-2.0
- ubuntu resolute: libkysdk-applications-dev 3.0.1.1-1 · LGPL-3.0-or-later
- ubuntu stonking: libkysdk-applications-dev 3.0.1.2-1build2 · LGPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms