Skip to content

2.0.0-beta fails to compile on Qt 6.4 due to Qt API mismatches and missing includes #2076

Description

@gagrilli

Bug description
2.0.0-beta does not compile against Qt 6.4.2 despite declaring Qt 6.4.0 as the minimum required version in CMake.
Specifically, the first error reports:

QPalette::Accent

Compilation fails in:

libs/libgui/src/settings/appearanceconfigwidget.cpp

Errors:

error: no member named 'Accent' in 'QPalette'

this is not available in Qt 6.4.2 (Debian Bookworm Qt version). It appears to have been introduced in later Qt versions (Qt ≥ 6.6), AFAICT, with the minimal search I am able to perform.

CMake still declares:
find_package(Qt6 6.4.0 REQUIRED ...)

I am no developer. LLMs suggested I replace QPalette::Accent with a conditional for qt < 6.6.

#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
constexpr auto AccentRole = QPalette::Accent;
#else
constexpr auto AccentRole = QPalette::Highlight;
#endif

And I replaced qPalette::Accent with AccentRole throughout the file.

I was very happy that compilation proceeded.

The second error :
Compilation fails in:

libs/libgui/src/tools/modelexporthelper.cpp

Error:

use of undeclared identifier 'qApp'

Again, I am no developer. I just searched around and found that qApp is included in qApplication. Looked for that string , found it nowhere. In a hunch, I added:
#include

at the other includes of the file.
Compilation proceeded.

How to reproduce
Get a clean Debian 12 system. Add the qt6.4 (qt6-base-dev and libpq5 libpq-dev, qt6-svg-dev))
configuratino succeeds.
run cmake --build . Compilation fails with above errors

Expected behavior
I expected compilation to finish if I followed the instructions published.

Info about your desktop

  • OS: Debian 12 (Bookworm)
  • Compiler: GCC 12.x
  • Qt: 6.4.2 (Debian packages)
  • pgModeler: 2.0.0-beta (tarball build)
  • Window manager: i3

Stacktrace / Debug info
N/A

Additional info
pgModeler runs fine after the workarounds I mentioned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions