QColorDialog(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QColorDialog πŸ’–

okay bestie, so this page is called QColorDialog(3qt) and it's literally the glow-up manual for the dialog widget that lets you pick colors. no cap. let's get into it ✨


🌈 NAME 🌈

QColorDialog β€” the dialog widget for specifying colors πŸŽ¨πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qcolordialog.h>

She inherits QDialog. iconic behavior, honestly.

✨ Static Public Members ✨

  • QColor getColor ( const QColor & initial = white, QWidget * parent = 0, const char * name = 0 )
  • QRgb getRgba ( QRgb initial, bool * ok = 0, QWidget * parent = 0, const char * name = 0 )
  • int customCount ()
  • QRgb customColor ( int i )
  • void setCustomColor ( int i, QRgb c )
  • void setStandardColor ( int i, QRgb c )

πŸŽ€ DESCRIPTION πŸŽ€

So QColorDialog is the class that gives you a whole dialog widget just for specifying colors. it's giving palette queen πŸ‘‘

Her whole job? letting users choose colors. like, say you're building a drawing program and you want your user to set the brush color β€” yeah, that. that's the vibe.

The static functions give you modal color dialogs. modal. so you're locked in until you pick, periodt.

The static getColor() function shows the dialog and lets the user specify a color. The getRgba() function does the same thing BUT it also lets the user specify a color with an alpha channel (transparency) value. transparency?? we love an inclusive queen 🫢

The user can store customCount() different custom colors. These custom colors are shared by all color dialogs, and they're remembered during the execution of the program. Use setCustomColor() to set the custom colors, and use customColor() to get them. sharing is caring fr fr πŸ’–

<center> [Image Omitted]

</center>

ngl there was an image here and it did NOT make it into this man page. rip to her πŸͺ¦πŸ’€

See also Dialog Classes and Graphics Classes.


πŸ’… MEMBER FUNCTION DOCUMENTATION πŸ’…

⭐ QRgb QColorDialog::customColor ( int i ) [static]

Returns custom color number i as a QRgb. simple. clean. slay.

⭐ int QColorDialog::customCount () [static]

Returns the number of custom colors supported by QColorDialog. And listen β€” all color dialogs share the same custom colors. every single one. they're all in the same group chat πŸ—£οΈ

⭐ QColor QColorDialog::getColor ( const QColor & initial = white, QWidget * parent = 0, const char * name = 0 ) [static]

Pops up a modal color dialog, lets the user choose a color, and returns that color. The color is initially set to initial. The dialog is a child of parent and is called name. It returns an invalid color (see QColor::isValid()) if the user cancels the dialog. And bestie, important: all colors allocated by the dialog will be deallocated before this function returns. no leaks, we're responsible πŸ‘‘

Examples:

okay so the original man page literally just says "Examples:" and then shows nothing. an empty examples section. she said trust the process πŸ’€βœ¨ (keeping it exactly as-is, no cap)

⭐ QRgb QColorDialog::getRgba ( QRgb initial, bool * ok = 0, QWidget * parent = 0, const char * name = 0 ) [static]

Pops up a modal color dialog to allow the user to choose a color and an alpha channel (transparency) value. The color+alpha is initially set to initial. The dialog is a child of parent and called name.

If ok is non-null, *ok is set to TRUE if the user clicked OK, and to FALSE if the user clicked Cancel. (so you always know what they picked, no mystery πŸ•΅οΈβ™€οΈ)

If the user clicks Cancel, the initial value is returned. she said "we're keeping it as it was" πŸ’…

⭐ void QColorDialog::setCustomColor ( int i, QRgb c ) [static]

Sets custom color number i to the QRgb value c. boom. done. ✨

⭐ void QColorDialog::setStandardColor ( int i, QRgb c ) [static]

Sets standard color number i to the QRgb value c. also boom. also done. 🌸


πŸ‘€ SEE ALSO πŸ‘€


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


πŸ–ŠοΈ AUTHOR πŸ–ŠοΈ

Generated automatically from the source code. (yes, she was born from a script. main character origin story fr 🧚)


πŸ› BUGS πŸ›

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. 🫢

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (she's a lil unofficial side quest, and that's okay 🌈)

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcolordialog.3qt) and the Qt version (3.3.8). pls pls include both, bestie, they literally need them πŸ™


okay that's the whole thing and that's the tea, bestie β€” this page is from <b>Trolltech AS</b>, dated <b>2 February 2007</b>, it's QColorDialog(3qt), and it documents Qt version 3.3.8. mwah πŸ’‹ thanks for reading, go pick a cute color πŸŽ¨πŸ’–βœ¨

πŸ“¦ where this page comes from