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 | |
11 | using namespace KParts; |
12 | |
13 | class KParts::PartActivateEventPrivate |
14 | { |
15 | public: |
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 | |
27 | const QEvent::Type partActivateEvent = (QEvent::Type)11769; |
28 | |
29 | PartActivateEvent::PartActivateEvent(bool activated, Part *part, QWidget *widget) |
30 | : QEvent(partActivateEvent) |
31 | , d(new PartActivateEventPrivate(activated, part, widget)) |
32 | { |
33 | } |
34 | |
35 | PartActivateEvent::~PartActivateEvent() = default; |
36 | |
37 | bool PartActivateEvent::activated() const |
38 | { |
39 | return d->m_bActivated; |
40 | } |
41 | |
42 | Part *PartActivateEvent::part() const |
43 | { |
44 | return d->m_part; |
45 | } |
46 | |
47 | QWidget *PartActivateEvent::widget() const |
48 | { |
49 | return d->m_widget; |
50 | } |
51 | |
52 | bool PartActivateEvent::test(const QEvent *event) |
53 | { |
54 | return event->type() == partActivateEvent; |
55 | } |
56 |