commit 27e71a8d56adc2ec44a93296c68ab2a2d66460a6 Author: Utkarsh Ayachit Date: Thu Jun 3 15:53:00 2010 -0400 Demonstrates how to add a main-window icon. Also demonstrates how to add custom resources to a custom application. diff --git a/Examples/CustomApplications/Spreadsheet/CMakeLists.txt b/Examples/CustomApplications/Spreadsheet/CMakeLists.txt index a01d390..fa36d93 100644 --- a/Examples/CustomApplications/Spreadsheet/CMakeLists.txt +++ b/Examples/CustomApplications/Spreadsheet/CMakeLists.txt @@ -21,6 +21,19 @@ QT4_WRAP_UI(UI_BUILT_SOURCES SpreadSheetMainWindow.ui ) +########################################################################## +## Add resources (icons etc.) +SET (UI_RESOURCES + SpreadSheet.qrc +) + +QT4_ADD_RESOURCES(RCS_BUILT_SOURCES + ${UI_RESOURCES} +) + +SOURCE_GROUP("Resources" FILES + ${UI_RESOURCES}) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) @@ -37,7 +50,7 @@ build_paraview_client(spreadsheet PVMAIN_WINDOW_INCLUDE SpreadSheetMainWindow.h GUI_CONFIGURATION_XMLS ${CMAKE_CURRENT_SOURCE_DIR}/SupportedReader.xml - SOURCES ${SOURCE_FILES} ${MOC_SRCS} ${UI_BUILT_SOURCES} + SOURCES ${SOURCE_FILES} ${MOC_SRCS} ${UI_BUILT_SOURCES} ${RCS_BUILT_SOURCES} ) #------------------------------------------------------------------------ diff --git a/Examples/CustomApplications/Spreadsheet/SpreadSheet.qrc b/Examples/CustomApplications/Spreadsheet/SpreadSheet.qrc new file mode 100644 index 0000000..1841780 --- /dev/null +++ b/Examples/CustomApplications/Spreadsheet/SpreadSheet.qrc @@ -0,0 +1,5 @@ + + + ss_icon.png + + diff --git a/Examples/CustomApplications/Spreadsheet/SpreadSheetMainWindow.ui b/Examples/CustomApplications/Spreadsheet/SpreadSheetMainWindow.ui index fafd024..205dc8b 100644 --- a/Examples/CustomApplications/Spreadsheet/SpreadSheetMainWindow.ui +++ b/Examples/CustomApplications/Spreadsheet/SpreadSheetMainWindow.ui @@ -13,6 +13,10 @@ MainWindow + + + :/SpreadSheet_Icons/ss_icon.png:/SpreadSheet_Icons/ss_icon.png + @@ -20,7 +24,7 @@ 0 0 559 - 27 + 26 @@ -64,6 +68,8 @@ - + + + diff --git a/Examples/CustomApplications/Spreadsheet/ss_icon.png b/Examples/CustomApplications/Spreadsheet/ss_icon.png new file mode 100644 index 0000000..44a446b Binary files /dev/null and b/Examples/CustomApplications/Spreadsheet/ss_icon.png differ