6#include <QtCore/qloggingcategory.h>
7#include <QtGui/qwindow.h>
8#include <QtQml/qqmlcontext.h>
9#include <QtQml/qqmlinfo.h>
10#include <QtQuick/qquickwindow.h>
11#include <QtQuickTemplates2/private/qquickdialog_p.h>
12#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
13#include <QtQuickTemplates2/private/qquickpopupanchors_p.h>
19Q_LOGGING_CATEGORY(lcQuickPlatformColorDialog,
"qt.quick.dialogs.quickplatformcolordialog")
23 qCDebug(lcQuickPlatformColorDialog)
24 <<
"creating non-native Qt Quick ColorDialog with parent" <<
parent;
32 qmlWarning(
parent) <<
"No QQmlContext for QQuickPlatformColorDialog; can't create "
33 "non-native ColorDialog implementation";
38 "qrc:/qt-project.org/imports/QtQuick/Dialogs/quickimpl/qml/ColorDialog.qml"));
40 if (!colorDialogComponent.
isReady()) {
41 qmlWarning(
parent) <<
"Failed to load non-native ColorDialog implementation:\n"
46 m_dialog = qobject_cast<QQuickColorDialogImpl *>(colorDialogComponent.
create());
48 qmlWarning(
parent) <<
"Failed to create an instance of the non-native ColorDialog:\n"
53 m_dialog->setParent(
this);
81 <<
"exec() is not supported for the Qt Quick ColorDialog fallback";
87 qCDebug(lcQuickPlatformColorDialog)
88 <<
"show called with flags" <<
flags <<
"modality" << modality <<
"parent" <<
parent;
93 auto quickWindow = qobject_cast<QQuickWindow *>(
parent);
97 <<
") of non-native dialog is not a QQuickWindow";
102 m_dialog->resetParentItem();
105 popupPrivate->getAnchors()->setCenterIn(m_dialog->parentItem());
The QColor class provides colors based on RGB, HSV or CMYK values.
QColor toRgb() const noexcept
Create and returns an RGB QColor based on this color.
QObject * parent() const
Returns a pointer to the parent object.
void setParent(QObject *parent)
Makes the object a child of parent.
The QQmlComponent class encapsulates a QML component definition.
bool isReady() const
Returns true if status() == QQmlComponent::Ready.
Q_INVOKABLE QString errorString() const
\qmlmethod string Component::errorString()
virtual QObject * create(QQmlContext *context=nullptr)
Create an object instance from this component, within the specified context.
QQmlEngine * engine() const
Return the context's QQmlEngine, or \nullptr if the context has no QQmlEngine or the QQmlEngine was d...
void setOptions(const QSharedPointer< QColorDialogOptions > &options)
void colorChanged(const QColor &color)
void setColor(const QColor &c)
void setTitle(const QString &title)
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
QQmlContext * qmlContext(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define QStringLiteral(str)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
file setParent(multiPart)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent