wedesoft / anymeal

AnyMeal is a free and open source recipe management software developed using SQLite3 and Qt5. It can manage a cookbook with more than 250,000 MealMaster recipes, thereby allowing to import, export, search, display, edit, and print them. AnyMeal is available for GNU/Linux and Microsoft Windows.
https://wedesoft.github.io/anymeal
GNU General Public License v3.0
57 stars 5 forks source link

Update to Qt6 #67

Closed bkmgit closed 1 month ago

bkmgit commented 1 month ago

Addresses https://github.com/wedesoft/anymeal/issues/66 Initial review would be helpful

bkmgit commented 1 month ago

There is a bug that prevents builds on Ubuntu 22.04 without unusual modifications https://bugs.launchpad.net/ubuntu/+source/qtchooser/+bug/1964763

wedesoft commented 1 month ago

Looks good. Please add the link to Fedora instead of replacing the link to Arch. It is failing the GitHub Workflow builds. Maybe there is an image for ubuntu-24.04? Will have a look when I get the time.

bkmgit commented 1 month ago

There are two links for Arch

bkmgit commented 1 month ago

Fedora build works. Ubuntu and Windows need updating. Build on Ubuntu 24.04 also needs an update.

wedesoft commented 1 month ago

Ah ok, if the Arch link was duplicate then it is fine to remove. Sorry

wedesoft commented 1 month ago

Maybe you can use pkgconfig (PKG_CHECK_MODULES) to find the Qt6 libraries. I haven't checked whether the Windows MinGW packages have pkgconfig files though. I haven't figured out yet how uic, rcc, and qtchooser works.

bkmgit commented 1 month ago

Ubuntu build now works, Will need to re-enable caching. It may be better to switch to CMake rather than using pkgconfig, but this is probably best done after the update to Qt6.

wedesoft commented 1 month ago

It fails on my machine because /usr/bin/moc generates code for Qt5. Not sure how this works. /usr/bin/moc is a symlink to qtchooser on my machine.

bkmgit commented 1 month ago

If both Qt5 and Qt6 are installed, may need to ensure moc-qt6 is picked up. There is an example configuration for gpgme at https://github.com/msys2/MINGW-packages/blob/e858872a3b4d7ee9bfdc40f41aaead2bfc519186/mingw-w64-gpgme/0001-fix-find-moc-qt6.patch#L6

wedesoft commented 1 month ago

Ah, I saw your workflow changes. I got it to work now using PATH=/usr/lib/qt6/bin:/usr/lib/qt6/libexec:$PATH ./configure --prefix=/usr.

wedesoft commented 1 month ago

Ok, it compiled successfully. However the SVG icons are not showing at the moment.

wedesoft commented 1 month ago

Ok, I had to install libqt6svg6

bkmgit commented 1 month ago

Thanks. Still looking for QT_MOC and QT_UIC on Windows.

bkmgit commented 1 month ago

@wedesoft Are you able to test on Windows?

wedesoft commented 1 month ago

@wedesoft Are you able to test on Windows?

Hi. Yes, I have Windows 11 and Debian 12 here.

bkmgit commented 1 month ago
wedesoft commented 1 month ago

Hi, can you merge https://github.com/bkmgit/anymeal/pull/2 into your branch? It contains several fixes.

wedesoft commented 1 month ago

I couldn't find windowsprintersupport.dll for Qt6 on my system. Maybe that DLL is not needed any more?

bkmgit commented 1 month ago

I couldn't find windowsprintersupport.dll for Qt6 on my system. Maybe that DLL is not needed any more?

qwindowsvista.dll and windowsprintersupport.dll seem not to be in the core packages. qwindowsvista.dll is mentioned in the documentation https://doc.qt.io/qt-6/windows-deployment.html#qt-plugins but not sure if it is still needed. Maybe check if Windows build runs ok?

wedesoft commented 1 month ago

Looks like it built. Congrats!

bkmgit commented 1 month ago

Will address further feedback in the next day or so. Once ok, can clean up commit history.

wedesoft commented 1 month ago

According to https://packages.msys2.org/packages/mingw-w64-x86_64-qt6-base qmodernwindowsstyle.dll should exist. Strange.

wedesoft commented 1 month ago

Will try pacman -Fy and pacman -Fx filename when I find the time (also see here).

bkmgit commented 1 month ago

According to https://packages.msys2.org/packages/mingw-w64-x86_64-qt6-base qmodernwindowsstyle.dll should exist. Strange.

qmodernwindowsstyle.dll does exist. I have not been able to find qwindowsvistastyle.dll and windowsprintersupport.dll but do not know if they are still needed for correct functioning of the Anymeal on Windows.

wedesoft commented 1 month ago

Ok, windowsprintersupport.dll is not in any qt6 package according to pacman.

wedesoft commented 1 month ago

Tried the installer and libb2-1.dll was missing.

wedesoft commented 1 month ago

Printing works!

wedesoft commented 1 month ago

Hi, can you pull in https://github.com/bkmgit/anymeal/pull/3 ?

wedesoft commented 1 month ago

Hi, can you merge https://github.com/bkmgit/anymeal/pull/4 ? I think then it is ready to merge.

wedesoft commented 1 month ago

Thanks! Great work!

bkmgit commented 1 month ago

Welcome, thanks for the fast feedback.