我假设您已经分叉了代码,在这种情况下,以下修改似乎足以将不同名称的插件安装到plugins/platforminputcontexts
:
- 重命名
qtvirtualkeyboard/src/virtualkeyboard/qtvirtualkeyboard.json
为qtvirtualkeyboard/src/virtualkeyboard/customvirtualkeyboard.json
.
- 在
customvirtualkeyboard.json
中,将qtvirtualkeyboard
密钥重命名为customvirtualkeyboard
。
- 在中,将字符串
qtvirtualkeyboard/src/virtualkeyboard/plugin.cpp
的内容更改为。pluginName
customvirtualkeyboard
- 在
qtvirtualkeyboard/src/virtualkeyboard/plugin.h
中,将FILE
字符串更改为customvirtualkeyboard
。
- 中
src/virtualkeyboard/virtualkeyboard.pro
,更改TARGET = qtvirtualkeyboardplugin
为TARGET = customvirtualkeyboardplugin
。这会影响您在 .dll 中看到的已安装 .dll、.lib 等的名称plugins/platforminputcontexts
。
以下是作为 Git diff 的更改:
diff --git a/src/virtualkeyboard/customvirtualkeyboard.json b/src/virtualkeyboard/customvirtualkeyboard.json
new file mode 100644
index 0000000..9ef7a87
--- /dev/null
+++ b/src/virtualkeyboard/customvirtualkeyboard.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "customvirtualkeyboard" ]
+}
diff --git a/src/virtualkeyboard/plugin.cpp b/src/virtualkeyboard/plugin.cpp
index 73ddeab..4abe9a4 100644
--- a/src/virtualkeyboard/plugin.cpp
+++ b/src/virtualkeyboard/plugin.cpp
@@ -76,7 +76,7 @@ using namespace QtVirtualKeyboard;
Q_LOGGING_CATEGORY(qlcVirtualKeyboard, "qt.virtualkeyboard")
-static const char pluginName[] = "qtvirtualkeyboard";
+static const char pluginName[] = "customvirtualkeyboard";
static const char inputMethodEnvVarName[] = "QT_IM_MODULE";
static const char pluginUri[] = "QtQuick.VirtualKeyboard";
static const char pluginSettingsUri[] = "QtQuick.VirtualKeyboard.Settings";
diff --git a/src/virtualkeyboard/plugin.h b/src/virtualkeyboard/plugin.h
index 08074d1..19593a4 100644
--- a/src/virtualkeyboard/plugin.h
+++ b/src/virtualkeyboard/plugin.h
@@ -38,7 +38,7 @@
class QVirtualKeyboardPlugin : public QPlatformInputContextPlugin
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "qtvirtualkeyboard.json")
+ Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "customvirtualkeyboard.json")
public:
QStringList keys() const;
diff --git a/src/virtualkeyboard/qtvirtualkeyboard.json b/src/virtualkeyboard/qtvirtualkeyboard.json
deleted file mode 100644
index 76d1706..0000000
--- a/src/virtualkeyboard/qtvirtualkeyboard.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "Keys": [ "qtvirtualkeyboard" ]
-}
diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro
index 4f3ca69..e9b0ff9 100644
--- a/src/virtualkeyboard/virtualkeyboard.pro
+++ b/src/virtualkeyboard/virtualkeyboard.pro
@@ -1,4 +1,4 @@
-TARGET = qtvirtualkeyboardplugin
+TARGET = customvirtualkeyboardplugin
DATAPATH = $$[QT_INSTALL_DATA]/qtvirtualkeyboard
QMAKE_DOCS = $$PWD/doc/qtvirtualkeyboard.qdocconf
请记住,如果您使用的是开源许可证,则必须对应用程序用户可用的 Qt 代码进行修改。