1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
4 SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include "partactivateevent.h"
10
11using namespace KParts;
12
13class KParts::PartActivateEventPrivate
14{
15public:
16 PartActivateEventPrivate(bool activated, Part *part, QWidget *widget)
17 : m_bActivated(activated)
18 , m_part(part)
19 , m_widget(widget)
20 {
21 }
22 const bool m_bActivated;
23 Part *const m_part;
24 QWidget *const m_widget;
25};
26
27const QEvent::Type partActivateEvent = (QEvent::Type)11769;
28
29PartActivateEvent::PartActivateEvent(bool activated, Part *part, QWidget *widget)
30 : QEvent(partActivateEvent)
31 , d(new PartActivateEventPrivate(activated, part, widget))
32{
33}
34
35PartActivateEvent::~PartActivateEvent() = default;
36
37bool PartActivateEvent::activated() const
38{
39 return d->m_bActivated;
40}
41
42Part *PartActivateEvent::part() const
43{
44 return d->m_part;
45}
46
47QWidget *PartActivateEvent::widget() const
48{
49 return d->m_widget;
50}
51
52bool PartActivateEvent::test(const QEvent *event)
53{
54 return event->type() == partActivateEvent;
55}
56

source code of kparts/src/partactivateevent.cpp