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
4#include "qquickstyleitemdelaybutton.h"
5
6#include <QtQuickTemplates2/private/qquickdelaybutton_p.h>
7
8QT_BEGIN_NAMESPACE
9
10void QQuickStyleItemDelayButton::connectToControl() const
11{
12 QQuickStyleItem::connectToControl();
13 auto button = control<QQuickDelayButton>();
14 connect(sender: button, signal: &QQuickButton::downChanged, context: this, slot: &QQuickStyleItem::markImageDirty);
15 connect(sender: button, signal: &QQuickButton::checkedChanged, context: this, slot: &QQuickStyleItem::markImageDirty);
16}
17
18void QQuickStyleItemDelayButton::initStyleOption(QStyleOptionButton &styleOption) const
19{
20 initStyleOptionBase(styleOption);
21 auto button = control<QQuickDelayButton>();
22
23 styleOption.state |= button->isDown() ? QStyle::State_Sunken : QStyle::State_Raised;
24}
25
26QT_END_NAMESPACE
27
28#include "moc_qquickstyleitemdelaybutton.cpp"
29

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtdeclarative/src/quicknativestyle/items/qquickstyleitemdelaybutton.cpp