Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.14.2
-
Documentation
-
-
33b7bf61824b80cf71042c31c505b73e82e11b37 (qt/qtdoc/dev) d089c60dfd513e27b0197f93c66fdaca6ef1e55e (qt/qtdoc/5.15) d48537ed2a585de7f1aba7c17616be7c3d0c503d (qt/qtdoc/dev)
-
Da Vinci sprint 11
Description
The documentation page for Setting the Application Icon( https://doc.qt.io/qt-5/appicon.html) does not include directions for getting application icons working with Qt on Windows with CMAKE. The current directions are for Qmake only. Adding these directions to the documentation would simplify the process for users acclimating to CMAKE.
I found directions via the forums at this link, by the user name AmberShark: https://forum.qt.io/topic/81519/how-to-set-the-application-icon-on-windows-using-cmake/4
The summary is:
- Create a resource file in the app folder.
- this might be something like project.rc
- Open the file, and add the line:
- IDI_ICON1 ICON DISCARDABLE "appicon.ico"
- In the above, the "appicon.ico" should correspond to an icon file in the same folder.
- Add the resource file in the cmake using the following line:
- add_executable(${PROJECT_NAME} ${SRCS} project.rc)
In the above case, on item 2, I chose to add the resource file in the subdir where my main.cpp resides. My specific example looked like:
add_executable(${PROJECT_NAME}
main.cpp
${SOURCES}
qml.qrc
synapse.rc
)