application file-icon and window-icon set on ms-windows

This commit is contained in:
Dushyant Basson
2023-09-02 02:29:52 +05:30
committed by Thomas Krijnen
parent 34f038530f
commit b034b40b09
7 changed files with 61 additions and 4 deletions
+2
View File
@@ -38,6 +38,7 @@ set(CMAKE_AUTORCC ON)
set(RESOURCE_FILES
resources/qt_resources.qrc
resources/qt_res.rc
)
add_executable(${targetName}
@@ -48,6 +49,7 @@ add_executable(${targetName}
MainWindow.h
MainWindow.cpp
main.cpp
${RESOURCE_FILES}
)
set_target_properties(${targetName} PROPERTIES
+5 -2
View File
@@ -6,11 +6,14 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QIcon appIcon(":/resources/ifcopenshell_logo.png");
// Set the icon in the window title-bar
// "icon" alias defined in .qrc file
// (.rc file sets the file icon on mswindows)
QIcon appIcon(":/icon");
app.setWindowIcon(appIcon);
MainWindow window;
window.setWindowIcon(appIcon);
window.show();
return app.exec();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.
+37
View File
@@ -0,0 +1,37 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "ifcopenshell_logo.ico"
+1 -2
View File
@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/">
<file>ifcopenshell_logo.png</file>
<file>ifcopenshell_logo.ico</file>
<file alias="icon">ifcopenshell_logo.png</file>
</qresource>
</RCC>
+16
View File
@@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by qt_res.rc
//
#define IDI_ICON1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif