KParts

partselectevent.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 "partselectevent.h"
10 #include "event_p.h"
11 
12 using namespace KParts;
13 
14 class KParts::PartSelectEventPrivate : public KParts::EventPrivate
15 {
16 public:
17  PartSelectEventPrivate(const char *eventName, bool selected, Part *part, QWidget *widget)
18  : EventPrivate(eventName)
19  , m_bSelected(selected)
20  , m_part(part)
21  , m_widget(widget)
22  {
23  }
24  static const char s_strPartSelectEvent[];
25  const bool m_bSelected;
26  Part *const m_part;
27  QWidget *const m_widget;
28 };
29 
30 const char PartSelectEventPrivate::s_strPartSelectEvent[] = "KParts/PartSelectEvent";
31 
32 PartSelectEvent::PartSelectEvent(bool selected, Part *part, QWidget *widget)
33  : Event(*new PartSelectEventPrivate(PartSelectEventPrivate::s_strPartSelectEvent, selected, part, widget))
34 {
35 }
36 
37 PartSelectEvent::~PartSelectEvent() = default;
38 
39 bool PartSelectEvent::selected() const
40 {
41  Q_D(const PartSelectEvent);
42 
43  return d->m_bSelected;
44 }
45 
46 Part *PartSelectEvent::part() const
47 {
48  Q_D(const PartSelectEvent);
49 
50  return d->m_part;
51 }
52 
53 QWidget *PartSelectEvent::widget() const
54 {
55  Q_D(const PartSelectEvent);
56 
57  return d->m_widget;
58 }
59 
60 bool PartSelectEvent::test(const QEvent *event)
61 {
62  return Event::test(event, PartSelectEventPrivate::s_strPartSelectEvent);
63 }
This event is sent when a part is selected or deselected.
Base class for parts.
Definition: part.h:62
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.