Skip to content

Add Qt GUI for Linux#1641

Merged
phkahler merged 6 commits intosolvespace:masterfrom
WickedSmoke:qt
Dec 5, 2025
Merged

Add Qt GUI for Linux#1641
phkahler merged 6 commits intosolvespace:masterfrom
WickedSmoke:qt

Conversation

@WickedSmoke
Copy link
Contributor

This replaces the #1451 request and limits the scope to support Linux only.

shingen75 and others added 6 commits December 1, 2025 11:37
…indow.h

rendergl1.cpp ->selectTexture changed id from 1 to 2. It seems that Qt reserves 1 for its own purposes.. not confirmed
 - Rename qglmainwindow.h as guiqt.h.

    Move some code from header to source.  The header has not been removed
    entirely so that Qt MOC files can use it.

 - Rename GLWidget as SSView and QtGLMainWindow as SSMainWindow.
 - Make TOOL window a QDockWidget (SSTextWindow).
 - Fix mouse moving the application window.
 - Replace deprectated QWheelEvent::delta() method.
 - Replace tinyxml2 settings with QSettings.
 - Remove unnecessary QOpenGLFunctions object.
 - Remove personal app stylesheet.  Fix QApplication::exec() crash.

    Passing a local argc variable to QApplication causes the crash and this
    was exposed by removing the stylesheet code.

    Provide main() for Qt to avoid the constraints with the
    InitGui/RunGui/ClearGui interface and ensure that the argc passed to the
    QApplication constructor exists for the life of the object.

 - Simplify SetAccelerator() by using Qt::Key codes.
 - Only create QActionGroup for RADIO_MARK when necessary.
@ruevs ruevs mentioned this pull request Dec 2, 2025
@phkahler
Copy link
Member

phkahler commented Dec 2, 2025

@WickedSmoke Why so much code in a header file? qglwindow.h

@phkahler
Copy link
Member

phkahler commented Dec 2, 2025

@WickedSmoke you made an RPM package. Is there any hope of getting that into copr or even Fedora repository? Fedora is my OS of choice and while I obviously build this from source, it feels strange that there is no proper package.

@WickedSmoke
Copy link
Contributor Author

@WickedSmoke Why so much code in a header file? qglwindow.h

Not sure what you're referring to. Raed's header was qglmainwindow.h and that was converted to guiqt.h.

@WickedSmoke you made an RPM package. Is there any hope of getting that into copr or even Fedora repository?

My copr is wickedsmoke/SolveSpace but there are some hacks to get that working. The Source URLs need to pull from Github archives (including submodules). I would prefer to build with the system mimalloc to avoid that submodule.

@WickedSmoke
Copy link
Contributor Author

Another hack in the .spec file is a hardcoded Git version. Not sure how to obtain that via the archives.

@WickedSmoke
Copy link
Contributor Author

In order to expedite this pull request it would be best to deal with the RPM stuff afterwards.

@phkahler
Copy link
Member

phkahler commented Dec 2, 2025

@WickedSmoke Why so much code in a header file? qglwindow.h

Not sure what you're referring to. Raed's header was qglmainwindow.h and that was converted to guiqt.h.

Just a lot of function implementation in the header. Not much compared to the .cpp file though.

@WickedSmoke you made an RPM package. Is there any hope of getting that into copr or even Fedora repository?

My copr is wickedsmoke/SolveSpace but there are some hacks to get that working. The Source URLs need to pull from Github archives (including submodules). I would prefer to build with the system mimalloc to avoid that submodule.

I would prefer you build with system mimalloc as well. IIRC the original problem causing us to point at a specific version were MacOS issues with some mimalloc versions. I thought @rpavlik already had linux version using system mimalloc if it's available. If not, go for it with all Linux builds not just qt.

@phkahler
Copy link
Member

phkahler commented Dec 3, 2025

@WickedSmoke I pulled this branch. How do I tell it to build with qt?

@WickedSmoke
Copy link
Contributor Author

@phkahler Do cmake -DUSE_QT_GUI=ON .. from your build directory.

Master still uses the extlib/mimalloc, but after looking at how you release the tarball that includes all the extlib directories that seems fine. As the Git hash is hardcoded in the tarball, making the RPM from that will be a simple affair.

@phkahler
Copy link
Member

phkahler commented Dec 4, 2025

@WickedSmoke Sorry, one more question. What packages need to be installed to build it on Fedora? We will want to add a few to these lists once this is merged.

@WickedSmoke
Copy link
Contributor Author

Here's the BuildRequires line from my .spec file:

BuildRequires: g++, cmake, qt6-qtbase-devel, eigen3-devel, fontconfig-devel, freetype-devel, libpng-devel, zlib-devel, mesa-libGL-devel mesa-libGLU-devel

My Releases page links to a Fedora 43 package built last night on Copr.

@phkahler
Copy link
Member

phkahler commented Dec 5, 2025

Looks good! The text window became unmovable for me when undocked on gnome (Fedora 42). I could double-click it back into the main window. But it generally works and that kind of stuff can be fixed post-merge.

@vthriller
Copy link
Contributor

The text window became unmovable for me when undocked on gnome

This problem is somewhere between Qt and Wayland compositors actually. It is reproducible in sway with or without QT_QPA_PLATFORM=xcb, but not in proper X11 (e.g. Xephyr), and is relevant not just to SolveSpace but to other software like LibreCAD as well.

@WickedSmoke
Copy link
Contributor Author

The KWin/Wayland dock widget behavior is better, but still incomplete. There is no problem moving the window, but the depth changes based on when it's created. When undocked by the user the window stays above the main window and is minimized with it. If the program starts in an undocked state then the window stays below the main window and does not get minimized.

@phkahler
Copy link
Member

phkahler commented Dec 5, 2025

The code said it can be docked left or right. I prefer it on the right. Is there a way to disallow making it separate? Until they fix the issues we could just not let it do that.

@WickedSmoke
Copy link
Contributor Author

Qt only officially supports Linux/X11. The QDockWidget bugs are a Wayland issue and it will be good for programs to be out in the wild that exhibit them so that they get attention.

I prefer giving users options so I was pleased to introduce the use of a docking widget.

@phkahler
Copy link
Member

phkahler commented Dec 5, 2025

@WickedSmoke and @shingen75 Thank you for this excellent contribution to Solvespace.

@phkahler phkahler merged commit ab8c7b7 into solvespace:master Dec 5, 2025
3 of 4 checks passed
@phkahler phkahler mentioned this pull request Dec 5, 2025
@ruevs ruevs added the UI label Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants