So verwenden Sie CuteKeyboard (kostenlose virtuelle Tastatur) in Qt 6.8Linux

Linux verstehen
Anonymous
 So verwenden Sie CuteKeyboard (kostenlose virtuelle Tastatur) in Qt 6.8

Post by Anonymous »

Ich möchte die folgende virtuelle Tastaturbibliothek in einer Qt-QML-Anwendung verwenden.
https://github.com/amarula/cutekeyboard/
Das Plugin und die Anwendung werden erfolgreich erstellt, aber wenn ich die Anwendung starte, erhalte ich die folgende Fehlermeldung:

Code: Select all

QQmlApplicationEngine failed to load component
qrc:/qt/qml/qml_test/Main.qml:4:1: Module loaded for URI 'QtQuick.CuteKeyboard' does not implement QQmlEngineExtensionInterface
Wie erstelle ich ein Projekt, um die oben genannten Plugins in Qt 6.8 zu verwenden?
Ich bin ein Anfänger mit Qt.
Die Umgebung ist wie folgt.
Betriebssystem: Ubuntu 24.04
Qt: 6.8.3
Qt Creator: 17.0.2
Cmake: 3.28.3
Ich habe Folgendes versucht
cutekeyboard erstellen und installieren

Code: Select all

~$ git clone https://github.com/amarula/cutekeyboard.git
~/cutekeyboard$ cmake -S . -B build -GNinja
~/cutekeyboard$ cmake --build build --target all
~/cutekeyboard/build$ sudo cmake --install .

-- Install configuration: ""
-- Installing: /usr/lib/x86_64-linux-gnu/cmake/Qt6/../../../plugins/platforminputcontexts/libcutekeyboardplugin.so
-- Set non-toolchain portion of runtime path of "/usr/lib/x86_64-linux-gnu/cmake/Qt6/../../../plugins/platforminputcontexts/libcutekeyboardplugin.so" to "$ORIGIN/../../../lib"

Kopieren Sie die Build-Dateien in das Qt-Verzeichnis

Code: Select all

sudo cp -r cutekeyboard/build/src/QtQuick/CuteKeyboard /opt/Qt/6.8.3/gcc_64/qml/QtQuick
qml-Projekt erstellen
Erstellen Sie ein QML-Anwendungsprojekt in Qt Creator.
Fügen Sie Folgendes zur Quelle hinzu.
main.cpp

Code: Select all

qputenv("QT_IM_MODULE", QByteArray("cutekeyboard"));
Main.qml

Code: Select all

import QtQuick.CuteKeyboard 1.0

Code: Select all

Errors while reading typeinfo files: File "/opt/Qt/6.8.3/gcc_64/qml/QtQuick/CuteKeyboard/cutekeyboardplugin.qmltypes" does not exist.
Wenn ich die Anwendung ausführe, tritt der folgende Fehler auf:

Code: Select all

16:29:58: Starting /home/.../qml_test/build/Desktop_Qt_6_8_3-Debug/appqml_test...
QML debugging is enabled. Only use this in a safe environment.
QQmlApplicationEngine failed to load component
qrc:/qt/qml/qml_test/Main.qml:4:1: Module loaded for URI 'QtQuick.CuteKeyboard' does not implement QQmlEngineExtensionInterface
16:29:58: The command "/home/.../qml_test/build/Desktop_Qt_6_8_3-Debug/appqml_test" terminated with exit code 255.
Update Nr. 1
Wenn ich den Befehl cmake mit aktiviertem BUILD_EXAMPLES ausführe, um das Beispiel „cutekeyboard“ zu erstellen, tritt der folgende Fehler auf:

Code: Select all

~/cutekeyboard$ cmake -S . -B build -GNinja -DBUILD_EXAMPLES=ON

...
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:2428 (message):
Unexpected arguments: OUTPUT_SCRIPT;deploy_script
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Qt6Core/Qt6CoreMacros.cmake:2503 (qt6_generate_deploy_app_script)
example/CMakeLists.txt:15 (qt_generate_deploy_app_script)
Update Nr. 2
Nachdem die Optionen wie folgt angegeben wurden, wurde das Beispielprojekt ebenfalls erfolgreich erstellt.

Code: Select all

cmake -S . -B build -GNinja -DBUILD_EXAMPLES=ON -DCMAKE_PREFIX_PATH=/opt/Qt/6.5.3/gcc_64 -DQT_DIR=/opt/Qt/6.5.3/gcc_64/lib/cmake/Qt6
Das Beispielprojekt wurde erfolgreich erstellt, aber beim Start wird Folgendes an das Terminal ausgegeben und die GUI wird nicht angezeigt.

Code: Select all

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QQmlApplicationEngine failed to load component
qrc:/main.qml:5:1: module "QtQuick.Window" is not installed
qrc:/main.qml:4:1: module "QtQuick.Layouts" is not installed
qrc:/main.qml:3:1: module "QtQuick.CuteKeyboard" is not installed
qrc:/main.qml:2:1: module "QtQuick.Controls" is not installed
Als ich mein eigenes Projekt startete, ist der folgende Fehler aufgetreten.

Code: Select all

QQmlApplicationEngine failed to load component
qrc:/qt/qml/ck_test_65/Main.qml:3:1: Namespace 'QtQuick.CuteKeyboard' has already been used for type registration

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post