Update: minor adjustments to CMakeLists.txt, ComposePage.qml, emailmanager.cpp, main.cpp

This commit is contained in:
Padrino
2026-06-04 18:29:16 +02:00
parent acaf741eb9
commit c5704b78a4
4 changed files with 159 additions and 45 deletions
+44 -8
View File
@@ -1,11 +1,16 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtWebEngine 1.15
import QtQml 2.15
Item {
id: composePage
anchors.fill: parent
// Expose a bridge to C++ for sending email and getting Quill content
property var emailBridge: emailComposerBridge
// Back button
Rectangle {
anchors {
@@ -69,17 +74,47 @@ Item {
Layout.fillWidth: true
}
// Body
// Body - WebEngineView loading editor.html with Quill
Text {
text: qsTr("Body:")
font.pointSize: 14
Layout.alignment: Qt.AlignLeft
}
TextArea {
id: bodyArea
placeholderText: qsTr("Write your message...")
WebEngineView {
id: bodyWebView
Layout.fillWidth: true
Layout.fillHeight: true
url: "qrc:/resources/web/editor.html"
// Settings to enable webchannel
settings.javascriptEnabled: true
settings.localContentCanAccessRemoteUrls: true
settings.localContentCanAccessFileUrls: true
}
// Attachments area (simple list placeholder)
RowLayout {
id: attachmentsRow
Layout.fillWidth: true
spacing: 5
// Will be populated dynamically via C++ model or JS array
// For now, placeholder
Text {
text: qsTr("Attachments: ")
font.pointSize: 12
}
Text {
id: attachmentsText
text: qsTr("None")
font.pointSize: 12
color: "#666"
}
Button {
text: qsTr("Attach")
onClicked: {
// Call C++ to open file dialog and get selected files
emailBridge.openAttachmentDialog()
}
}
}
// Send button
@@ -93,10 +128,11 @@ Item {
MouseArea {
anchors.fill: parent
onClicked: {
// TODO: Implement sending email
console.log("Sending email to:", toField.text, "subject:", subjectField.text)
// For now, just go back
StackView.view.pop()
// Trigger sending via bridge
emailBridge.sendComposedEmail(
toField.text,
subjectField.text
)
}
}
Text {