Skip to content

Embed window icon into executable using Qt resources#1682

Merged
phkahler merged 3 commits intosolvespace:masterfrom
wolfpackmars2:embed-window-icon
Mar 14, 2026
Merged

Embed window icon into executable using Qt resources#1682
phkahler merged 3 commits intosolvespace:masterfrom
wolfpackmars2:embed-window-icon

Conversation

@wolfpackmars2
Copy link
Contributor

This PR embeds the window icon directly into the executable using Qt resources, making the application more portable.

Changes:

  • Added src/solvespace.qrc to embed the 48x48 icon PNG
  • Updated CMakeLists.txt to compile Qt resources
  • Modified guiqt.cpp to load icon from embedded resource instead of external file
  • Works cross-platform (Windows, macOS, Linux)

Benefits:

  • More self-contained and portable application
  • No dependency on system-installed icon files
  • Icon always available regardless of installation method

- Add solvespace.qrc to embed the 48x48 icon PNG
- Update CMakeLists.txt to compile Qt resources
- Modify guiqt.cpp to load icon from embedded resource instead of external file
- Makes the application more portable by not requiring external icon files
- Adds Application icon for all platforms when building QT interface
@wolfpackmars2
Copy link
Contributor Author

This resolves #1681. The QT build will treat the window icon the same as the current GTK build, which embeds the pixmap data into the executable.

@phkahler
Copy link
Member

@WickedSmoke Are you OK with this? He says it's a prerequisite to building an AppImage, but I'm guessing it may change your Linux packages for qt version (make them simpler?).

@phkahler phkahler linked an issue Mar 13, 2026 that may be closed by this pull request
@WickedSmoke
Copy link
Contributor

@phkahler That's fine, but it only sets the window manager icon (used in the task bar). Unfortunately packaging does not change since launch menus use the /usr/share/icons files.

I would put the .qrc file in the src/platform or res directory.

@phkahler
Copy link
Member

I would put the .qrc file in the src/platform or res directory.

@wolfpackmars2 Looks like the 'res' folder is a good place for the .qrc Probably don't need to go deeper than that.

@wolfpackmars2
Copy link
Contributor Author

I would put the .qrc file in the src/platform or res directory.

@wolfpackmars2 Looks like the 'res' folder is a good place for the .qrc Probably don't need to go deeper than that.

I made the change, and I agree.

I also renamed the file to 'qt-resources.qrc' to make it more obvious that this is a file that only affects the qt features. For devs who aren't familiar with QT.

@phkahler phkahler merged commit e82eb14 into solvespace:master Mar 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solvespace application window icon (QT)

3 participants