Perceptual Color

languagechangeeventfilter.h
1// SPDX-FileCopyrightText: Lukas Sommer <sommerluk@gmail.com>
2// SPDX-License-Identifier: BSD-2-Clause OR MIT
3
4#ifndef LANGUAGECHANGEEVENTFILTER_H
5#define LANGUAGECHANGEEVENTFILTER_H
6
7#include <qglobal.h>
8#include <qobject.h>
9class QEvent;
10
11#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
12#include <qtmetamacros.h>
13#else
14#include <qobjectdefs.h>
15#include <qstring.h>
16#endif
17
18namespace PerceptualColor
19{
20/** @internal
21 *
22 * @brief An event filter that discards <tt>QEvent::LanguageChange</tt>
23 * events.
24 *
25 * All other events are kept.
26 *
27 * To use it, create an instance of this class. Then, call
28 * <tt>QObject::installEventFilter()</tt> on the object for which
29 * you want to filter the events. */
30class LanguageChangeEventFilter : public QObject
31{
33
34public:
35 explicit LanguageChangeEventFilter(QObject *parent = nullptr);
36 virtual ~LanguageChangeEventFilter() override;
37 [[nodiscard]] virtual bool eventFilter(QObject *watched, QEvent *event) override;
38
39private:
40 Q_DISABLE_COPY(LanguageChangeEventFilter)
41
42 /** @internal @brief Only for unit tests. */
43 friend class TestLanguageChangeEventFilter;
44};
45
46} // namespace PerceptualColor
47
48#endif // LANGUAGECHANGEEVENTFILTER_H
The namespace of this library.
Q_OBJECTQ_OBJECT
virtual bool event(QEvent *e)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.