Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

The dialog has no icon



  • QML Application: the dialog and message dialog has different window icon:

    7719aaf5-3f23-4fa1-8970-7e88c6f72d90-image.png

    As it shows, in the left side, the dialog which is constructed from import QtQuick.Dialogs 1.3 has not window Icon, while the message dialog in the right side got the icon that Application has. And I want to get the right icon in dialog, so what can achieve that?

    Codes are here:

        Dialog {
            title: "This is a dialog"
            Text { text: "This is a dialog" }
            modality: Qt.NonModal
            Component.onCompleted: visible = true
        }
        MessageDialog {
            title: "This is a message dialog"
            modality: Qt.NonModal
            visible: true
            text: "It's so cool that you are using Qt Quick."
            onAccepted: {
                console.log("And of course you could only agree.")
                Qt.quit()
            }
            Component.onCompleted: visible = true
        }
    


  • Your question is possibly a duplicate of;

    https://forum.qt.io/topic/54440/icon-dialog



  • I think it maybe similar situation that the post described.
    I did set application window by

    app.setWindowIcon("qrc:/icon.ico")
    

    but in the .pro file the RC_ICON is set as well.
    The icon did not show on Dialog component but MessageDialog did.


Log in to reply