A Simple Question About Icons Of Window
-
I got a simple question about icons of window. I have asked for AI for several times, but however it didn't give me a proper answer.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.12 import QtQuick.Window import Qt.labs.platform 1.1 as Platform ApplicationWindow { id: mainWindow width: Screen.width height: Screen.height visible: true visibility: "FullScreen" icon: "qrc:/images/msRain.png" title: qsTr("NaciroManchurianMsRain") flags: Qt.FramelessWindowHint color: "transparent" Component.onCompleted: { PetHelper.setWindow(mainWindow); } Image { id: msRain0_1 source: "qrc:/images/msRain.png" Component.onCompleted: { var id = PetHelper.autoCreateNewRegion(msRain0_1.source); PetHelper.updatePosition(msRain0_1.x, msRain0_1.y, id); PetHelper.updateMask(); } } Platform.SystemTrayIcon { id: trayIcon visible: true icon.source: "qrc:/images/msRain.png" tooltip: "我的透明窗口应用" menu: Platform.Menu { Platform.MenuItem { text: qsTr("关闭") onTriggered: Qt.quit() } } } }It says that "Cannot assign to non-existent property 'icon'". But I think ApplicationWindow does have the property "icon" right?
If you need more files about cpp files or cmake files et cetera, I will instantly offer it.
There's a few Chinese words, but it won't make a influence on your conprehension. And my English is really bad, hope all of you can forgive me, pardon me.
-
I got a simple question about icons of window. I have asked for AI for several times, but however it didn't give me a proper answer.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.12 import QtQuick.Window import Qt.labs.platform 1.1 as Platform ApplicationWindow { id: mainWindow width: Screen.width height: Screen.height visible: true visibility: "FullScreen" icon: "qrc:/images/msRain.png" title: qsTr("NaciroManchurianMsRain") flags: Qt.FramelessWindowHint color: "transparent" Component.onCompleted: { PetHelper.setWindow(mainWindow); } Image { id: msRain0_1 source: "qrc:/images/msRain.png" Component.onCompleted: { var id = PetHelper.autoCreateNewRegion(msRain0_1.source); PetHelper.updatePosition(msRain0_1.x, msRain0_1.y, id); PetHelper.updateMask(); } } Platform.SystemTrayIcon { id: trayIcon visible: true icon.source: "qrc:/images/msRain.png" tooltip: "我的透明窗口应用" menu: Platform.Menu { Platform.MenuItem { text: qsTr("关闭") onTriggered: Qt.quit() } } } }It says that "Cannot assign to non-existent property 'icon'". But I think ApplicationWindow does have the property "icon" right?
If you need more files about cpp files or cmake files et cetera, I will instantly offer it.
There's a few Chinese words, but it won't make a influence on your conprehension. And my English is really bad, hope all of you can forgive me, pardon me.
@Kansas said in A Simple Question About Icons Of Window:
But I think ApplicationWindow does have the property "icon" right?
Wrong. See https://doc.qt.io/qt-6/qml-qtquick-controls-applicationwindow.html
What icons do you mean? The icons in the title bar of the window (close/minimize/maximize)? -
@Kansas said in A Simple Question About Icons Of Window:
But I think ApplicationWindow does have the property "icon" right?
Wrong. See https://doc.qt.io/qt-6/qml-qtquick-controls-applicationwindow.html
What icons do you mean? The icons in the title bar of the window (close/minimize/maximize)?@jsulm said in A Simple Question About Icons Of Window:
@Kansas said in A Simple Question About Icons Of Window:
But I think ApplicationWindow does have the property "icon" right?
Wrong. See https://doc.qt.io/qt-6/qml-qtquick-controls-applicationwindow.html
What icons do you mean? The icons in the title bar of the window (close/minimize/maximize)?Oh, I see. Thanks a lot. I specifically mean the icons in the title bar of the window, but I also want to set the icon of the exe.
I'll search it again carefully. Thank you again. -
K Kansas has marked this topic as solved