randrew/phantomstyle

should be able to compile with Qt6

Opened this issue · 6 comments

When trying to build with Qt6, there are several deprecation related errors.

Do you have a list?

msvc compiler gives me these:
image
the first error means: invalid Preprocessor command "warning", it only works in gcc?
gcc gives me these:
image
image
perhaps don't need a lot of changes to port to Qt6

I think that's not too bad. Replace .background() with .window() to fix most of them.

Another one is that tabWidth in QStyleOptionMenuItem has changed in reservedShortcutWidth:

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
   int tabWidth = menuItem->tabWidth;
#else
   int tabWidth = menuItem->reservedShortcutWidth;
#endif

I have it working in Qt6 (at least haven't noticed any remaining issue) in my fork, I can make a PR if you want @randrew

hmm since 6.3 / 6.4 some UI glitches have appeared though, which seem to be due to the QPalette hash. Replacing fastfragile_hash_qpalette with accurate_hash_qpalette fixes it.

Thanks for letting me know. I'll take a look when I get around to updating this for Qt6. It relies on the internals of the QPalette data to do a fast 'hash'. It only saves a little bit of work, which I think is nice for frequent small drawing operations, but using the fallback 'accurate' hash is not that big of a deal for now.