add appliction icon

This commit is contained in:
Carl Philipp Klemm 2026-03-06 00:04:55 +01:00
parent b719d8cf96
commit 10769eef09
5 changed files with 16 additions and 5 deletions

View file

@ -11,6 +11,7 @@ find_package(Qt6 COMPONENTS Core Gui Widgets Multimedia REQUIRED)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# Add executable # Add executable
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
@ -34,6 +35,7 @@ add_executable(${PROJECT_NAME}
src/clickableslider.h src/clickableslider.h
src/clickableslider.cpp src/clickableslider.cpp
${MusicGeneratorGUI_H} ${MusicGeneratorGUI_H}
res/resources.qrc
) )
# UI file # UI file

5
res/resources.qrc Normal file
View file

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/icons">
<file>xyz.uvos.aceradio.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before After
Before After

View file

@ -13,6 +13,10 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Aceradio</string> <string>Aceradio</string>
</property> </property>
<property name="windowIcon">
<iconset resource="../res/resources.qrc">
<normaloff>:/icons/xyz.uvos.aceradio.png</normaloff>:/icons/xyz.uvos.aceradio.png</iconset>
</property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
@ -345,9 +349,11 @@
<customwidget> <customwidget>
<class>ClickableSlider</class> <class>ClickableSlider</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>clickableslider.h</header> <header>src/clickableslider.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources>
<include location="../res/resources.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

View file

@ -1,14 +1,12 @@
#include "MainWindow.h" #include "MainWindow.h"
#include <QApplication> #include <QApplication>
#include <QStyleFactory> #include <QStyleFactory>
#include <QIcon>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
// Set a modern style
app.setStyle(QStyleFactory::create("Fusion"));
MainWindow window; MainWindow window;
window.show(); window.show();