![]() If you still require this function, use the QColorDialog::DontUseNativeDialog option. Note: This function does not apply to the Native Color Dialog on the macOS platform. Returns the color that the user selected by clicking the OK or equivalent button. QColor QColorDialog:: selectedColor() const The signal will be disconnected from the slot when the dialog is closed. Opens the dialog and connects its colorSelected() signal to the slot specified by receiver and member. void QColorDialog:: open( QObject * receiver, const char * member) The options argument allows you to customize the dialog. It returns an invalid (see QColor::isValid()) color if the user cancels the dialog. Pops up a modal color dialog with the given window title (or "Select Color" if none is specified), lets the user choose a color, and returns that color. QColor QColorDialog:: getColor(const QColor & initial = Qt::white, QWidget * parent = nullptr, const QString & title = QString(), QColorDialog::ColorDialogOptions options = ColorDialogOptions()) ![]() If this dialog is shown with exec(), done() causes the local event loop to finish, and exec() to return result. void QColorDialog:: done( int result)Ĭloses the dialog and sets its result code to result. All color dialogs share the same custom colors. Returns the number of custom colors supported by QColorDialog. Returns the custom color at the given index as a QColor value. QColor QColorDialog:: customColor( int index) Reimplements: QWidget::changeEvent(QEvent *event). void QColorDialog:: changeEvent( QEvent * e) QColorDialog:: ~QColorDialog()ĭestroys the color dialog. Note: Notifier signal for property currentColor. This signal is emitted whenever the current color changes in the dialog. void QColorDialog:: currentColorChanged(const QColor & color) See also color and currentColorChanged(). This signal is emitted just after the user has clicked OK to select a color to use. void QColorDialog:: colorSelected(const QColor & color) QColorDialog:: QColorDialog( QWidget * parent = nullptr)Ĭonstructs a color dialog with the given parent. Member Function Documentation QColorDialog:: QColorDialog(const QColor & initial, QWidget * parent = nullptr)Ĭonstructs a color dialog with the given parent and specified initial color. See also QColor, QFileDialog, QFontDialog, and Standard Dialogs Example. The Standard Dialogs example shows how to use QColorDialog as well as other built-in Qt dialogs. Pressing Escape restores the last color selected before entering this mode. The user can pick up one by clicking the mouse or the Enter button. When pressing the "Pick Screen Color" button, the cursor changes to a haircross and the colors on the screen are scanned. Use setCustomColor() to set the custom colors, and use customColor() to get them. The custom colors are shared by all color dialogs, and remembered during the execution of the program. The user can store customCount() different custom colors. This function can also be used to let users choose a color with a level of transparency: pass the ShowAlphaChannel option as an additional argument. The static getColor() function shows the dialog, and allows the user to specify a color. ![]() The static functions provide modal color dialogs. ![]() For example, you might use this in a drawing program to allow the user to set the brush color. The color dialog's function is to allow users to choose colors.
0 Comments
Leave a Reply. |