ID「splashscreen」を持つQMLファイルで宣言されたシートがあります
私のアプリが計算集約的なタスクを実行するとき、私は working() シグナルを発します。
QML ファイルのメイン要素にこのコードを添付しています。
onCreationCompleted: {
_encryptedattachment.finished.connect(splashscreen.close);
_encryptedattachment.working.connect(splashscreen.open);
console.log("connected");
}
復号化が必要なファイルを呼び出してアプリを開くと、
_encryptedattachment.working.connect(splashscreen.open);
イベントが発生しているにもかかわらず、スプラッシュスクリーンを開きません(デバッガーでコードを確認しました
emit working()
実行されます。
編集:
onCreated コードを次のように変更しました。
onCreationCompleted: {
splashscreen.open();
_encryptedattachment.working.connect(showSplash);
_encryptedattachment.finished.connect(hideSplash);
console.log("connected");
}
function showSplash() {
console.log("open splashscreen");
splashscreen.open();
}
function hideSplash() {
console.log("close splashscreen");
splashscreen.close();
}
これらのログは両方ともコンソールに表示されます。