Compare commits
2 Commits
16c9e6c632
...
a9a0997714
Author | SHA1 | Date |
---|---|---|
yang.yongquan | a9a0997714 | |
yang.yongquan | 7bdddec934 |
|
@ -2,6 +2,7 @@ import QtQuick 2.15
|
|||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
import "qrc:///AicsKnowledgeBase/qml/global"
|
||||
import SignalFileOperation 1.0
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
@ -163,7 +164,7 @@ Item {
|
|||
if (model.isDir) {
|
||||
listView.headerItem.add(model.title, model.uuid)
|
||||
} else {
|
||||
emit: open(model.uuid)
|
||||
emit: SignalFileOperation.open(model.uuid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
signal open(string file)
|
||||
signal openNote(string note)
|
||||
}
|
|
@ -6,12 +6,14 @@ import QtQuick.Controls.Basic
|
|||
import QtWebEngine 1.2
|
||||
import FluentUI
|
||||
import AicsKB.FileTransferManager
|
||||
import SignalFileOperation 1.0
|
||||
import "qrc:///AicsKnowledgeBase/qml/page"
|
||||
|
||||
FluArea {
|
||||
id: content_area
|
||||
paddings: 0
|
||||
backgroundColor: "#f9f9f9"
|
||||
visible: false
|
||||
property string type: ""
|
||||
property string knowledgeFileId
|
||||
signal download(string knowledgeFileId)
|
||||
|
@ -23,6 +25,13 @@ FluArea {
|
|||
// bottom: 10
|
||||
// left: 10
|
||||
// }
|
||||
Connections {
|
||||
target: SignalFileOperation
|
||||
function onOpen(file) {
|
||||
content_area.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
FluScrollablePage {
|
||||
id: content_page
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -54,6 +54,8 @@ int main(int argc, char *argv[])
|
|||
qmlRegisterSingletonInstance<FileTransferManager>("AicsKB.FileTransferManager", 1, 0, "FileTransferManager",
|
||||
fileTransferManager);
|
||||
|
||||
qmlRegisterSingletonType(QUrl("qrc:/AicsKnowledgeBase/qml/global/SignalFileOperation.qml"), "SignalFileOperation", 1, 0,
|
||||
"SignalFileOperation");
|
||||
|
||||
const QUrl url(u"qrc:/AicsKnowledgeBase/qml/App.qml"_qs);
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
|
|
Loading…
Reference in New Issue