-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathinputeventitem.h
More file actions
35 lines (27 loc) · 895 Bytes
/
inputeventitem.h
File metadata and controls
35 lines (27 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef INPUTEVENTITEM_H
#define INPUTEVENTITEM_H
#include <QObject>
#include <QQmlEngine>
#include <QQuickItem>
class InputEventItem : public QQuickItem
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(QQuickItem* inputMethodSource READ inputMethodSource WRITE setInputMethodSource NOTIFY inputMethodSourceChanged)
public:
InputEventItem();
QQuickItem* inputMethodSource() const;
void setInputMethodSource(QQuickItem* source);
QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
signals:
void inputReceived(const QString &input);
void inputMethodSourceChanged();
private:
QQuickItem* m_inputMethodSource = nullptr;
};
#endif // INPUTEVENTITEM_H