-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
TEMPLATE = subdirs | ||
SUBDIRS = \ | ||
examples \ | ||
src | ||
src \ | ||
src/plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "InputContext.h" | ||
#include <QRectF> | ||
|
||
#include <QDebug> | ||
|
||
InputContext::InputContext(): | ||
m_visible(false) | ||
{ | ||
} | ||
|
||
InputContext::~InputContext() | ||
{ | ||
} | ||
|
||
bool InputContext::isValid() const | ||
{ | ||
return true; | ||
} | ||
|
||
QRectF InputContext::keyboardRect() const | ||
{ | ||
return QRectF(); | ||
} | ||
|
||
void InputContext::showInputPanel() | ||
{ | ||
qDebug() << "show"; | ||
m_visible = true; | ||
QPlatformInputContext::showInputPanel(); | ||
} | ||
|
||
void InputContext::hideInputPanel() | ||
{ | ||
qDebug() << "hide"; | ||
m_visible = false; | ||
QPlatformInputContext::hideInputPanel(); | ||
} | ||
|
||
bool InputContext::isInputPanelVisible() const | ||
{ | ||
return m_visible; | ||
} | ||
|
||
void InputContext::setFocusObject(QObject *object) | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef INPUTCONTEXT_CPP_Q5U7KLYO | ||
#define INPUTCONTEXT_CPP_Q5U7KLYO | ||
|
||
#include <qpa/qplatforminputcontext.h> | ||
|
||
class InputContext: public QPlatformInputContext | ||
{ | ||
Q_OBJECT | ||
public: | ||
InputContext(); | ||
~InputContext(); | ||
|
||
bool isValid() const; | ||
QRectF keyboardRect() const; | ||
|
||
void showInputPanel(); | ||
void hideInputPanel(); | ||
bool isInputPanelVisible() const; | ||
void setFocusObject(QObject *object); | ||
|
||
private: | ||
bool m_visible; | ||
}; /* ----- end of class InputContext ----- */ | ||
|
||
#endif /* end of include guard: INPUTCONTEXT_CPP_Q5U7KLYO */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "InputContextPlugin.h" | ||
#include "InputContext.h" | ||
|
||
#include <QDebug> | ||
|
||
QPlatformInputContext *InputContextPlugin::create(const QString &system, const QStringList ¶mList) | ||
{ | ||
Q_UNUSED(paramList); | ||
|
||
qDebug() << "AAAAAA" << system; | ||
|
||
if (system.compare(system, QStringLiteral("quickkeyboard"), Qt::CaseInsensitive) == 0) { | ||
return new InputContext; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef INPUTCONTEXTPLUGIN_H_NWSQGKER | ||
#define INPUTCONTEXTPLUGIN_H_NWSQGKER | ||
|
||
#include <qpa/qplatforminputcontextplugin_p.h> | ||
#include "global.h" | ||
|
||
class QUICKKEYBOARD_EXPORT InputContextPlugin: public QPlatformInputContextPlugin | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "kbd.json") | ||
public: | ||
QPlatformInputContext *create(const QString &system, const QStringList ¶mList); | ||
}; /* ----- end of class InputContextPlugin ----- */ | ||
|
||
#endif /* end of include guard: INPUTCONTEXTPLUGIN_H_NWSQGKER */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef GLOBAL_H_CTI1IPAP | ||
#define GLOBAL_H_CTI1IPAP | ||
|
||
#include <QtCore/QtGlobal> | ||
|
||
#if defined(QUICKKEYBOARD_LIBRARY) | ||
# define QUICKKEYBOARD_EXPORT Q_DECL_EXPORT | ||
#else | ||
# define QUICKKEYBOARD_EXPORT Q_DECL_IMPORT | ||
#endif | ||
|
||
#endif /* end of include guard: GLOBAL_H_CTI1IPAP */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"Keys": ["quickkeyboard"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
QT += qml quick gui-private | ||
CONFIG += plugin | ||
|
||
TARGET = quickkeyboard | ||
TEMPLATE = lib | ||
DESTDIR = ../../platforminputcontexts | ||
|
||
DEFINES += QUICKKEYBOARD_LIBRARY | ||
|
||
include($$PWD/../components.pri) | ||
|
||
HEADERS += global.h \ | ||
InputContextPlugin.h \ | ||
InputContext.h | ||
SOURCES += InputContextPlugin.cpp \ | ||
InputContext.cpp | ||
|
||
target.path = $$[QT_INSTALL_PLUGINS]/platforminputcontexts | ||
INSTALLS += target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
CONFIG += plugin | ||
QT += gui quick | ||
DESTDIR = ../generic | ||
TARGET = quickkeyboard | ||
TEMPLATE = lib | ||
include($$PWD/components.pri) | ||
TEMPLATE = subdirs | ||
SUBDIRS = \ | ||
plugin |