Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickstyleitemradiodelegate.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 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// Qt-Security score:significant reason:default
4
6
7#include <QtQuickTemplates2/private/qquickradiodelegate_p.h>
8
10
11void QQuickStyleItemRadioDelegate::connectToControl() const
12{
13 QQuickStyleItem::connectToControl();
14 auto radioDelegate = control<QQuickRadioDelegate>();
15 connect(radioDelegate, &QQuickRadioDelegate::downChanged, this, &QQuickStyleItem::markImageDirty);
16 connect(radioDelegate, &QQuickRadioDelegate::checkedChanged, this, &QQuickStyleItem::markImageDirty);
17}
18
19void QQuickStyleItemRadioDelegate::initStyleOption(QStyleOptionButton &styleOption) const
20{
21 initStyleOptionBase(styleOption);
22 auto radioDelegate = control<QQuickRadioDelegate>();
23
24 styleOption.state |= radioDelegate->isDown() ? QStyle::State_Sunken : QStyle::State_Raised;
25 styleOption.state |= radioDelegate->isChecked() ? QStyle::State_On : QStyle::State_Off;
26}
27
28QT_END_NAMESPACE
29
30#include "moc_qquickstyleitemradiodelegate.cpp"
void initStyleOption(QStyleOptionButton &styleOption) const override