KParts

partactivateevent.cpp
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
4  SPDX-FileCopyrightText: 1999 David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "partactivateevent.h"
10 #include "event_p.h"
11 
12 using namespace KParts;
13 
14 class KParts::PartActivateEventPrivate : public KParts::EventPrivate
15 {
16 public:
17  PartActivateEventPrivate(const char *eventName, bool activated, Part *part, QWidget *widget)
18  : EventPrivate(eventName)
19  , m_bActivated(activated)
20  , m_part(part)
21  , m_widget(widget)
22  {
23  }
24  static const char s_strPartActivateEvent[];
25  const bool m_bActivated;
26  Part *const m_part;
27  QWidget *const m_widget;
28 };
29 
30 const char PartActivateEventPrivate::s_strPartActivateEvent[] = "KParts/PartActivateEvent";
31 
32 PartActivateEvent::PartActivateEvent(bool activated, Part *part, QWidget *widget)
33  : Event(*new PartActivateEventPrivate(PartActivateEventPrivate::s_strPartActivateEvent, activated, part, widget))
34 {
35 }
36 
37 PartActivateEvent::~PartActivateEvent() = default;
38 
39 bool PartActivateEvent::activated() const
40 {
41  Q_D(const PartActivateEvent);
42 
43  return d->m_bActivated;
44 }
45 
46 Part *PartActivateEvent::part() const
47 {
48  Q_D(const PartActivateEvent);
49 
50  return d->m_part;
51 }
52 
53 QWidget *PartActivateEvent::widget() const
54 {
55  Q_D(const PartActivateEvent);
56 
57  return d->m_widget;
58 }
59 
60 bool PartActivateEvent::test(const QEvent *event)
61 {
62  return Event::test(event, PartActivateEventPrivate::s_strPartActivateEvent);
63 }
Base class for parts.
Definition: part.h:62
This event is sent by the part manager when the active part changes. Each time the active part change...
The KParts namespace,.
Q_D(Todo)
Base class for all KParts events.
Definition: event.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 9 2022 03:51:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.