Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwidgetplatformcolordialog.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6
7#include <QtWidgets/qcolordialog.h>
8
10
20
24
26{
27 return m_dialog->currentColor();
28}
29
34
36{
37 m_dialog->exec();
38}
39
40bool QWidgetPlatformColorDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
41{
42 QSharedPointer<QColorDialogOptions> options = QPlatformColorDialogHelper::options();
43 m_dialog->setWindowTitle(options->windowTitle());
44 m_dialog->setOptions(static_cast<QColorDialog::ColorDialogOptions>(int(options->options())) | QColorDialog::DontUseNativeDialog);
45
46 return QWidgetPlatformDialog::show(m_dialog.data(), flags, modality, parent);
47}
48
50{
51 m_dialog->hide();
52}
53
55
56#include "moc_qwidgetplatformcolordialog_p.cpp"
The QColorDialog class provides a dialog widget for specifying colors.
QColor currentColor
the currently selected color in the dialog
void setCurrentColor(const QColor &color)
void currentColorChanged(const QColor &color)
This signal is emitted whenever the current color changes in the dialog.
void setOptions(ColorDialogOptions options)
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
void rejected()
virtual int exec()
Shows the dialog as a \l{QDialog::Modal Dialogs}{modal dialog}, blocking until the user closes it.
Definition qdialog.cpp:543
void accepted()
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2195
virtual void setCurrentColor(const QColor &)=0
const QSharedPointer< QColorDialogOptions > & options() const
void currentColorChanged(const QColor &color)
virtual QColor currentColor() const =0
virtual void exec()=0
virtual void hide()=0
virtual bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent)=0
T * data() const noexcept
Returns the value of the pointer referenced by this object.
QWidgetPlatformColorDialog(QObject *parent=nullptr)
static bool show(QDialog *dialog, Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
void hide()
Hides the widget.
Definition qwidget.cpp:8135
void setWindowTitle(const QString &)
Definition qwidget.cpp:6105
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
WindowModality
GLuint color
[2]
GLbitfield flags