adding qt resources

This commit is contained in:
dushyant basson
2023-09-01 14:58:18 +05:30
committed by Thomas Krijnen
parent ef87f0fe74
commit 07eecad433
7 changed files with 39 additions and 1 deletions
+9 -1
View File
@@ -33,6 +33,13 @@ endif()
set(targetName "QtViewer")
# Scan for .qrc files and add to build process
set(CMAKE_AUTORCC ON)
set(RESOURCE_FILES
resources/qt_resources.qrc
)
add_executable(${targetName}
IfcViewerWidget.h
IfcViewerWidget.cpp
@@ -47,6 +54,7 @@ set_target_properties(${targetName} PROPERTIES
AUTOMOC On
WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON
RESOURCE "${RESOURCE_FILES}"
)
target_link_libraries(${targetName}
@@ -64,4 +72,4 @@ target_include_directories(${targetName} PUBLIC
)
get_target_property(targetIncludeDirs ${targetName} INCLUDE_DIRECTORIES)
message(STATUS "target_include_directories: ${targetIncludeDirs}")
message(STATUS "target_include_directories: ${targetIncludeDirs}")
+4
View File
@@ -6,7 +6,11 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QIcon appIcon(":/resources/ifcopenshell_logo.png");
MainWindow window;
window.setWindowIcon(appIcon);
window.show();
return app.exec();
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+6
View File
@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/">
<file>ifcopenshell_logo.png</file>
<file>ifcopenshell_logo.ico</file>
</qresource>
</RCC>