Skip to content

Enable building libcommuni with QT6 - #545

Merged
vitalyster merged 4 commits into
SpectrumIM:masterfrom
dekeonus:communi-qt6
Jul 27, 2026
Merged

Enable building libcommuni with QT6#545
vitalyster merged 4 commits into
SpectrumIM:masterfrom
dekeonus:communi-qt6

Conversation

@dekeonus

@dekeonus dekeonus commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

rebase to master for Remove Swiften dependency from backend plugins

adds a CMAKE option to find and build with QT6 libraries with libcommuni

Closes #537

dekeonus added 2 commits July 27, 2026 04:15
adds a CMAKE option to find QT6 libraries with libcommuni
adds a #define to conditionally #include QtCore5Compat

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
Use QT_VERSION & QT_VERSION_CHECK macros from <QtGlobal> (included via
<QtCore>).
This also enables being more selective about the version for the
QString::SkipEmptyParts to Qt::SkipEmptyParts deprecation fixup

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>

@vitalyster vitalyster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Google says Qt::SkipEmptyParts is available since Qt 5.14, is it the only change? We can safely drop version check and use it, minimal Qt version is 5.15 for us.
Also it is not clear why Qt5Compat needed?

@dekeonus

dekeonus commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Qt5Compat is needed as QT6 removed <QTextCodec> and <QRegExp> (and others) which are used by libcommuni

@vitalyster

Copy link
Copy Markdown
Collaborator

We using it or libcommuni used? If we not using then it is private libcommuni dependency and it should be linked in their build script, not in ours

@dekeonus

Copy link
Copy Markdown
Contributor Author
/var/tmp/portage/net-im/spectrum2-2.2.1_p20260726-r3/work/spectrum2-902a6e49fcfa8d3ef800f690d3cc0f3cd6fcf99c/backends/libcommuni/backports.h:16:5: error: ‘QRegExp’ was not declared in this scope
   16 |     QRegExp rx(QLatin1String("(\\d{1,2})(?:,(\\d{1,2}))?"));
      |     ^~~~~~~

so yes we are using at least one of the Qt5Compat modules

@vitalyster

Copy link
Copy Markdown
Collaborator

We can remove backports and use parseColors from libcommuni, is seems backports were required for some old libcommuni version, now we did not support these versions.

dekeonus added 2 commits July 27, 2026 07:26
- Removed libcommuni/backports.h and so no need for Core5Compat
- as minimum supported QT version is 5.15 no need to test for greater
  than QT-5.14 in backends/libcommuni/session.cpp

Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
Signed-off-by: Bill Prendergast <dek.devel@baisenvar.info>
@dekeonus
dekeonus requested a review from vitalyster July 26, 2026 21:44
@vitalyster
vitalyster merged commit 147fbbc into SpectrumIM:master Jul 27, 2026
6 checks passed
@dekeonus
dekeonus deleted the communi-qt6 branch July 27, 2026 13:52
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.

if libcommuni is patched for QT6 support, spectrum2 will fail to compile

2 participants