4

Kde Plasma 5 プラズモイドを開発する方法を学んでおり、わずか 2 つの qml からなる小さなウィジェットでテストしています。https://techbase.kde.orghttps://api.kde.org/frameworks/などの情報ソースを読み、次のようなテスト プラズモイドのパッケージ構造とソースを作成しました。

$ ls -lR test
test:
total 8
drwxr-xr-x 3 alberto alberto 4096 nov 26 14:28 contents
-rw-r--r-- 1 alberto alberto  459 nov 26 14:28 metadata.desktop

test/contents:
total 4
drwxr-xr-x 2 alberto alberto 4096 nov 26 14:33 ui

test/contents/ui:
total 8
-rw-r--r-- 1 alberto alberto 275 nov 26 14:28 main.qml
-rw-r--r-- 1 alberto alberto 465 nov 26 14:33 RootContainer.qml

RootContainer はウィジェットの完全な表現であり、テキスト「prueba1」のラベルのみが含まれます。したがって、ドキュメントを読んだとき、次のようにコマンドPlasmapkg2を使用してウィジェットをインストールしました。

$ plasmapkg2 --install test
pluginname:  "org.matrixland.test"
Generated  "/home/xxx/.local/share/plasma/plasmoids//kpluginindex.json"  ( 3  plugins)
/home/xxx/Programación/proyectos/plasmoides/test instalado con éxito

その後、kdeデスクトップで使用でき、すべて問題ありません。デスクトップに表示され、テキスト ラベルが表示されます。

しかし、ラベルのテキスト「prueba2」を変更すると、次のようにプラグインを削除して再インストールします

$ plasmapkg2 --remove test 
Constructing a KPluginInfo object from old style JSON. Please use kcoreaddons_desktop_to_json() for "" instead of kservice_desktop_to_json() in your CMake code.
Calling KPluginInfo::property("X-KDE-PluginInfo-Name") is deprecated, use KPluginInfo::pluginName() in "/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/packagestructure/plasma_packagestructure_share.so" instead.
Constructing a KPluginInfo object from old style JSON. Please use kcoreaddons_desktop_to_json() for "" instead of kservice_desktop_to_json() in your CMake code.
Calling KPluginInfo::property("X-KDE-PluginInfo-Name") is deprecated, use KPluginInfo::pluginName() in "/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/packagestructure/plasma_packagestructure_share.so" instead.
Generated  "/home/xxx/.local/share/plasma/plasmoids//kpluginindex.json"  ( 2  plugins)
/home/xxx/Programación/proyectos/plasmoides/test desinstalado con éxito

>xxx@eleanor:~/Programación/proyectos/plasmoides$ plasmapkg2 --install test
pluginname:  "org.matrixland.test"
Generated  "/home/alberto/.local/share/plasma/plasmoids//kpluginindex.json"  ( 3  plugins)
/home/alberto/Programación/proyectos/plasmoides/test instalado con éxito

今なら、デスクトップにもう一度追加すると、新しいテキストではなく古いテキストが表示されます。/home/xxx/.local/share/plasma/plasmoids/org.matrixland.testディレクトリをチェックインして、ソースが最新で更新されていることを確認しました。新しいもの。

明らかに私の問題は、テキストの変更だけでなく、qml で行った変更がウィジェットに反映されないことです。何か間違ったことをしているのか、ウィジェットを更新するために何か他のことをしなければならないのかわかりません。誰でもそれを手伝ってもらえますか?

KDE と Qt のバージョン情報

4

1 に答える 1

5

これは、古い QML がまだ「キャッシュ」されているためです。変更を確認するには、プラズマシェルを再起動する必要があります。

killall plasmashell; kstart5 plasmashell

ライブでテストしたいときに、このスクリプトを使用してアプレットを再インストールしました。ただし、すばやくテストしたい場合は、次のように使用plasmoidviewerします。

plasmoidviewer -a package -l bottomedge -f horizontal

このスクリプトのように。

于 2016-12-01T02:01:57.980 に答える