feat:为应用程序添加图标
This commit is contained in:
parent
89253452fd
commit
1580de3687
|
|
@ -92,13 +92,17 @@ set(UI_FILES
|
||||||
ui/groupSelectionDialog.ui
|
ui/groupSelectionDialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(APP_ICON "${CMAKE_CURRENT_SOURCE_DIR}/app_Logo.rc")
|
||||||
|
set(RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/resource/PowerModeler.qrc")
|
||||||
|
|
||||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||||
qt_add_executable(PowerModeler
|
qt_add_executable(PowerModeler
|
||||||
MANUAL_FINALIZATION
|
MANUAL_FINALIZATION
|
||||||
${H_HEADER_FILES}
|
${H_HEADER_FILES}
|
||||||
${CPP_SOURCE_FILES}
|
${CPP_SOURCE_FILES}
|
||||||
${UI_FILES}
|
${UI_FILES}
|
||||||
resource/PowerModeler.qrc
|
${APP_ICON}
|
||||||
|
${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
# Define target properties for Android with Qt 6 as:
|
# Define target properties for Android with Qt 6 as:
|
||||||
# set_property(TARGET PowerModeler APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
# set_property(TARGET PowerModeler APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||||
|
|
@ -110,7 +114,7 @@ else()
|
||||||
${H_HEADER_FILES}
|
${H_HEADER_FILES}
|
||||||
${CPP_SOURCE_FILES}
|
${CPP_SOURCE_FILES}
|
||||||
${UI_FILES}
|
${UI_FILES}
|
||||||
resource/PowerModeler.qrc
|
${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
# Define properties for Android with Qt 5 after find_package() calls as:
|
# Define properties for Android with Qt 5 after find_package() calls as:
|
||||||
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
||||||
|
|
@ -119,7 +123,7 @@ else()
|
||||||
${H_HEADER_FILES}
|
${H_HEADER_FILES}
|
||||||
${CPP_SOURCE_FILES}
|
${CPP_SOURCE_FILES}
|
||||||
${UI_FILES}
|
${UI_FILES}
|
||||||
resource/PowerModeler.qrc
|
${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
IDI_ICON1 ICON "logo.ico"
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="img">
|
<qresource prefix="img">
|
||||||
|
<file>images/appIcon.png</file>
|
||||||
<file>images/icon_ellipsis.png</file>
|
<file>images/icon_ellipsis.png</file>
|
||||||
<file>images/icon_file.png</file>
|
<file>images/icon_file.png</file>
|
||||||
<file>images/icon_multiple-choice.png</file>
|
<file>images/icon_multiple-choice.png</file>
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -8,10 +8,12 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
qputenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "0"); // Wayland 下启用装饰
|
qputenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "0"); // Wayland 下启用装饰
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
//a.setWindowIcon(QIcon(":/img/images/appIcon.ico"));
|
||||||
//a.setStyle(QStyleFactory::create("Fusion"));
|
//a.setStyle(QStyleFactory::create("Fusion"));
|
||||||
LOG_INFO("Application", "------------------------------------------------Application start------------------------------------------------");
|
LOG_INFO("Application", "------------------------------------------------Application start------------------------------------------------");
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
w.setWindowIcon(QIcon(":/img/images/appIcon.ico"));
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../resource/PowerModeler.qrc">
|
<iconset resource="../resource/PowerModeler.qrc">
|
||||||
<normaloff>:/img/images/icon_database.png</normaloff>:/img/images/icon_database.png</iconset>
|
<normaloff>:/img/images/appIcon.png</normaloff>:/img/images/appIcon.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QWidget
|
<string notr="true">QWidget
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue