kdk::KColorComboBox(3)

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

💖 kdk::KColorComboBox — Library Functions Manual, section 3 🎀

okay bestie, sit down, hydrate, because we're about to talk about the cutest little color picker in the whole kdk namespace. this is kdk::KColorComboBox, and fr fr she's a whole vibe.


✨ NAME ✨

kdk::KColorComboBox — 颜色选择框, aka the color selection box. she picks colors. that's the job. iconic behavior.


🌈 SYNOPSIS 🌈

#include <kcolorcombobox.h>

Inherits QComboBox. yes ma'am, she's a combo box at heart — a combo box that woke up and chose color theory. 💅

🦋 Public Types

  • enum ComboType { Circle, RoundedRect } — 指定显示样式,圆形或者圆角矩形. this is literally just "what shape is the lil swatch bestie", and your options are a circle or a rounded rectangle. that's it, that's the whole menu. Circle or RoundedRect. no cap. ⭐

🎀 Signals

  • void activated (const QColor &color) — fires off when it gets activated, carrying a QColor with it.
  • void currentColorChanged (const QColor &color) — the moment the current color switches up, she lets you know with a QColor.
  • void highlighted (const QColor &color) — a highlight happened, and here comes a QColor to prove it.

👑 Public Member Functions

  • KColorComboBox (QWidget *parent=nullptr) — the constructor. she takes a parent widget, defaulting to nullptr (she can be a whole independent main character if you want, no shame).
  • void setColorList (const QList< QColor > &list) — 以列表形式添加颜色选项, i.e. drop in a whole QList of colors at once instead of one at a time. bulk slay.
  • QList< QColor > colorList () — 获取颜色列表, hand over the color list bestie.
  • void addColor (const QColor &color) — 添加颜色选项, add one single color option. one at a time, slow and steady. 🍓
  • void setComboType (const ComboType &type) — 设置显示样式, set the display style, so Circle or RoundedRect.
  • ComboType comboType () — 获取显示样式, tell me what display style we're on right now.
  • void setPopupItemSize (const QSize &size) — 设置item尺寸, set the item size. (yes the getter below is spelled differently, we'll get there, stay calm 😭)
  • QSize popupItemSzie () — 返回item尺寸, returns the item size. 🫶

🧚 Protected Member Functions

  • void paintEvent (QPaintEvent *event) override — overridden paint event, this is where the drawing magic happens.
  • void resizeEvent (QResizeEvent *event) override — overridden resize event, so she stays cute at every size.

💜 Detailed Description 💜

颜色选择框 — a color selection box.

  • Since — 2.0.2.1 🌸

⭐ Member Function Documentation ⭐

💅 void kdk::KColorComboBox::addColor (const QColor & color)

添加颜色选项 — adds a color option.

Parameters

  • color — the color you're adding, bestie.

💅 QList< QColor > kdk::KColorComboBox::colorList ()

获取颜色列表 — gets the color list.

Returns

  • the QList< QColor >, aka your color list. (the docs don't spell out more than that, so we're not making stuff up in here 💀)

💅 ComboType kdk::KColorComboBox::comboType ()

获取显示样式 — gets the display style.

Returns

  • the ComboType, so Circle or RoundedRect.

💅 QSize kdk::KColorComboBox::popupItemSzie ()

返回item尺寸 — returns the item size.

Returns

  • the QSize of the item.
ngl the name popupItemSzie is a typo for "Size" and it lives in the actual API forever now, so type it exactly like that. yes really. do not "fix" it, the compiler does not care about your spelling feelings. 🙈

💅 void kdk::KColorComboBox::setColorList (const QList< QColor > & list)

以列表形式添加颜色选项 — adds color options in list form.

Parameters

  • list — the QList of colors going in.

💅 void kdk::KColorComboBox::setComboType (const ComboType & type)

设置显示样式 — sets the display style.

Parameters

  • type — the ComboType you want, Circle or RoundedRect.

💅 void kdk::KColorComboBox::setPopupItemSize (const QSize & size)

设置item尺寸 — sets the item size.

Parameters

  • size — the QSize you're setting it to.

🫶 Author 🫶

Generated automatically by Doxygen for LIBKYSDK-APPLICATIONS from the source code. not a human author, just a very diligent robot. respect the robot. 🤖✨


and that's the whole page bestie, no notes. this was LIBKYSDK-APPLICATIONS, Version version:3.0, from the kdk::KColorComboBox(3) manual — and if you scrolled all the way down here, you're genuinely the realest. mwah. 💖🌈👑

📦 where this page comes from