Icon resource not registering
-
I'm trying to set the title bar icon for my program using an ico file registered in a qrc file but I can't get it to show up.
I tried these calls, using the copied file path by right clicking the resource.
In main function,
app.setWindowIcon(QIcon(":/icon.ico"));
or
app.setWindowIcon(QIcon("qrc:/icon.ico"));It doesn't show up. This function works if I supply a direct filepath. Maybe I'm missing something in the makefile? It currently has
qt_add_qml_module(RESOURCES resources.qrc)
How can I set the window title bar icon using a resource file?
-
I'm trying to set the title bar icon for my program using an ico file registered in a qrc file but I can't get it to show up.
I tried these calls, using the copied file path by right clicking the resource.
In main function,
app.setWindowIcon(QIcon(":/icon.ico"));
or
app.setWindowIcon(QIcon("qrc:/icon.ico"));It doesn't show up. This function works if I supply a direct filepath. Maybe I'm missing something in the makefile? It currently has
qt_add_qml_module(RESOURCES resources.qrc)
How can I set the window title bar icon using a resource file?
@EqiupmentConnected said in Icon resource not registering:
qt_add_qml_module(RESOURCES resources.qrc)
Does your qml module really have the name 'RESOURCES' ?
-
@EqiupmentConnected said in Icon resource not registering:
qt_add_qml_module(RESOURCES resources.qrc)
Does your qml module really have the name 'RESOURCES' ?
@Christian-Ehrlicher No, the full function is:
qt_add_qml_module(appTM_QML
URI TM_QML
VERSION 1.0
QML_FILES Main.qml
SOURCES tm.h tm.cpp
SOURCES database.h database.cpp
QML_FILES SpreadGraph.qml
QML_FILES Data_View.qml
SOURCES serialporthandler.h serialporthandler.cpp
QML_FILES
QML_FILES SerialSettings.qml
QML_FILES GlobalObject.qml
RESOURCES resources.qrc
)The resources part was auto added by QT creator when I created the qrc file.