-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to Qt 6 and C++17 #6516
Switch to Qt 6 and C++17 #6516
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
1edb151
to
ef6f556
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked through all changes yet.
How did you manage the C++17 dependency though?
@@ -195,7 +195,7 @@ bool Group::appliesToUser(const Channel ¤tChannel, const Channel &aclChann | |||
channel = channel->cParent; | |||
} | |||
|
|||
int requiredChannelIndex = currentChannelHierarchy.indexOf(contextChannel); | |||
auto requiredChannelIndex = currentChannelHierarchy.indexOf(contextChannel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
@@ -211,10 +211,10 @@ bool Group::appliesToUser(const Channel ¤tChannel, const Channel &aclChann | |||
return RET_FALSE; | |||
} | |||
|
|||
const int minDepth = requiredChannelIndex + minDescendantLevel; | |||
const int maxDepth = requiredChannelIndex + maxDescendantLevel; | |||
const auto minDepth = requiredChannelIndex + minDescendantLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
const int minDepth = requiredChannelIndex + minDescendantLevel; | ||
const int maxDepth = requiredChannelIndex + maxDescendantLevel; | ||
const auto minDepth = requiredChannelIndex + minDescendantLevel; | ||
const auto maxDepth = requiredChannelIndex + maxDescendantLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
|
||
const int totalDepth = homeChannelHierarchy.count() - 1; | ||
const auto totalDepth = homeChannelHierarchy.count() - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
@@ -154,15 +154,15 @@ void ProcessResolver::doResolve() { | |||
QByteArray cmdline = f.readAll(); | |||
f.close(); | |||
|
|||
int nul = cmdline.indexOf('\0'); | |||
const auto nul = cmdline.indexOf('\0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
@@ -580,7 +583,11 @@ QString ShortcutDelegate::displayText(const QVariant &item, const QLocale &loc) | |||
} | |||
} | |||
default: | |||
#if QT_VERSION >= 0x060000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep only Qt6
@@ -849,7 +856,11 @@ QTreeWidgetItem *GlobalShortcutConfig::itemForShortcut(const Shortcut &sc) const | |||
::GlobalShortcut *gs = GlobalShortcutEngine::engine->qmShortcuts.value(sc.iIndex); | |||
|
|||
item->setData(0, Qt::DisplayRole, static_cast< unsigned int >(sc.iIndex)); | |||
#if QT_VERSION >= 0x060000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep only Qt6
@@ -953,7 +964,7 @@ void GlobalShortcutEngine::remap() { | |||
sk->gs = gs; | |||
|
|||
foreach (const QVariant &button, sc.qlButtons) { | |||
int idx = qlButtonList.indexOf(button); | |||
auto idx = qlButtonList.indexOf(button); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
@@ -1026,7 +1037,7 @@ bool GlobalShortcutEngine::handleButton(const QVariant &button, bool down) { | |||
} | |||
} | |||
|
|||
int idx = qlButtonList.indexOf(button); | |||
const auto idx = qlButtonList.indexOf(button); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid use of auto
@@ -193,25 +193,33 @@ void GlobalShortcutWin::registerMetaTypes() { | |||
registered = true; | |||
|
|||
qRegisterMetaType< InputHid >(); | |||
#if QT_VERSION < 0x060000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed if we fully switch
I would like to keep support for Qt 5 at least until the next stable release, but don't want to write a preprocessor block for every I followed Qt's recommendation:
|
Why do you want to keep Qt5 support? It is EOL already and Qt6 has been around for so long as to be available on all platforms that we want to support (afaik) 🤔 |
Right: https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders In that case we have to prepare a Qt 6 vcpkg environment. |
Yep Coming back to the C++17 requirement though: how did you manage it so that nothing breaks? 🤔 |
Well, there is one thing "broken": we use the Unfortunately there is no standard replacement, we'll have to rely on something like https://github.com/nemtrif/utfcpp. As for ZeroC Ice: the headers that make use of mumble-voip/ice@bc7eb3e Upstream seems to have fixed the issue in v3.7.7: zeroc-ice/ice@bc2762e In conclusion: before merging this PR we should build with Qt 6 to make sure that there are no issues on any platforms. |
The name was |
UpdateEntry() = default; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this change by mistake, it's supposed to fix a separate issue:
src/mumble/PluginUpdater.cpp:49:18: error: no matching constructor for initialization of 'UpdateEntry'
49 | UpdateEntry entry = { plugin->getID(), updateURL, updateURL.fileName(), 0 };
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mumble/PluginUpdater.h:30:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 4 were provided
30 | struct UpdateEntry {
| ^~~~~~~~~~~
src/mumble/PluginUpdater.h:30:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 4 were provided
30 | struct UpdateEntry {
| ^~~~~~~~~~~
src/mumble/PluginUpdater.h:31:2: note: candidate constructor not viable: requires 0 arguments, but 4 were provided
31 | UpdateEntry() = default;
| ^
09ed65d
to
00bf616
Compare
Despite The package seemingly contains the required files, which leads me to think something is broken. Unfortunately we cannot switch to Ubuntu 24.04 in Azure Pipelines because not publicly available yet: actions/runner-images#9848 (comment) |
00bf616
to
bfcebdb
Compare
I ended up adding 24.04's repository and installing the Qt packages from there. |
We can't exclusively use 24.04 though. At least we have to also have a CI for 22.04 |
The base system is still 22.04, but I can see why we should test the Qt packages that are normally provided with it. Unfortunately we have no choice other than reporting the bug upstream and hoping for a quick fix. |
Yeah, we should report it. However, until this is fixed I think we should just wait with merging this PR. At least for a couple of weeks to see what the maintainers will do with the reported issue. 👀 |
I created a VM with a minimal Ubuntu 22.04 installation and quickly found out what the issue was: missing Our build log actually gave us a hint, but I missed it as I focused on the specific component (
A minimal CMake project with the standard
Please note that |
bfcebdb
to
cc11c79
Compare
cc11c79
to
d51aa2e
Compare
Formatted with clang-format 10, in order for CI to succeed. |
a1084c4
to
f5f46d2
Compare
f5f46d2
to
de91daa
Compare
Try it on archlinux from aur Seems like it laggy on first time Settings window was opened |
It feels sluggish when you open the Settings window, but only the first time? |
Found it (Mumble (1.6.0) from 5782f61 with Qt 6.7.2)
~1.5s total :) |
Will recheck on latest release with qt5 (not on master) |
Its OK with Mumble (1.5.634) with Qt 5.15.15 only 1 line in console log
|
Yea, I think this will be a very hard to track race condition kind of bug. Depending on exact version and system configuration and stuff... |
Fonts scan triggered by mumble/src/mumble/ConfigDialog.cpp Line 103 in c043779
for UPD: yep, look like a race |
To me this kinda looks like a Qt issue because afaict we are not doing any explicit font manipulation kn our end 👀 |
From what I have read so far, this is a combination of our stylesheet usage and the inability of Qt to properly maintain their stylesheet support. Trying to fix this will likely mean wrestling with Qt for like two weeks again. Additionally, one needs to reliably recreate this bug, which I have not managed to do so far |
Hi, are there any plans for updating the documentation for macOS and Windows?
mumble/docs/dev/build-instructions/build_static.md Lines 45 to 49 in dfa59b1
|
Sure, should've been done in #6572. |
It's (kinda) done via #6588 |
Requires thorough testing, especially the regex changes.