Menu

#560 Support for Qt 6

None
closed-accepted
nobody
None
5
2023-12-30
2023-07-30
FX
No

Qt 5 is nearing end of life (in fact, has already reached it). Having gnuplot tied to Qt version 5 makes it hard for distributions like Homebrew, because most other packages have moved on.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2023-07-31

    Sure. No problem. The autoconf script is now updated for both 6.1 and 6.0 (will be in -rc2).

    Notes
    1. Qt6 requires C++2017, which neither gcc nor clang default to at this point. You will have to add an appropriate compiler flag, e.g. CXXFLAGS = "-std=c++17"
    2. Qt6 does not support 8-bit encodings other than UTF-8, so in order to have gnuplot's "set encoding" work you must install the Qt6 compatibility module Core5QtCompat. If Qt6 doesn't eventually support this natively, I suppose we will have to look into implementing the locale->utf8 conversion outside the Qt libraries.
    3. gnuplot and gnuplot_qt must be linked against the same version of Qt, so if you rebuild one you must also rebuild the other.

    It works here with no issues, but please report any problems you see.

     
  • FX

    FX - 2023-07-31

    Hi, I backported the commit at https://sourceforge.net/p/gnuplot/gnuplot-main/ci/e458b88e481e8af4ef2d97c9af79fdf40e40ed81/ to 5.4.8 and it did not compile. The build is done with:

    ./configure --disable-dependency-tracking --disable-silent-rules --prefix=/opt/homebrew/Cellar/gnuplot/5.4.8_1 --with-readline=/opt/homebrew/opt/readline --without-tutorial --disable-wxwidgets --with-qt --without-x --without-latex

    but it fails with:

    checking Checking for Qt6 support libraries... checking for QT... configure: WARNING:
    Package requirements (Qt6Core Qt6Gui Qt6Network Qt6Svg Qt6PrintSupport Qt6Core5Compat) were not met:

    No package 'Qt6Core' found
    No package 'Qt6Gui' found
    No package 'Qt6Network' found
    No package 'Qt6Svg' found
    No package 'Qt6PrintSupport' found
    No package 'Qt6Core5Compat' found

     
  • FX

    FX - 2023-07-31

    OK, so Qt 6 is not always shipping pkg-config style .pc files. In particular, it's not shipping them on macOS, where it is built as a series of frameworks. https://bugreports.qt.io/browse/QTBUG-86080

     
    • Ethan Merritt

      Ethan Merritt - 2023-07-31

      Qt6 restored inclusion of pkgconfig files in Qt 6.3.1, see https://codereview.qt-project.org/c/qt/qtbase/+/405678

       
      • FX

        FX - 2023-07-31

        If you look at the latest comments in https://bugreports.qt.io/browse/QTBUG-86080 you will see that it was only restored on some platforms. pkg-config files are not generated when Qt is built with static libraries, or when building for macOS.

         
  • FX

    FX - 2023-07-31

    OK, using QT_LIBS and QT_CFLAGS and UIC as environment varibales, I can proceed further with the build. Another error is this:

    qtterminal/QtGnuplotItems.cpp:114:17: error: no member named 'width' in 'QFontMetricsF'
    return metrics.width(m_text);
    ~~~~~~~ ^

    I think horizontalAdvance() should be used instead?

     
    • Ethan Merritt

      Ethan Merritt - 2023-07-31

      yes, thanks. That change was already made elsewhere but I guess that one line was missed.

       
  • FX

    FX - 2023-07-31

    Replacing width() with horizontalAdvance() above, this is what I obtain. Is the text issue (blue box in the middle) expected? Otherwise, seems to work well.

     
  • Ethan Merritt

    Ethan Merritt - 2023-08-28
    • status: open --> pending-accepted
    • Group: -->
     
  • Ethan Merritt

    Ethan Merritt - 2023-12-30
    • Status: pending-accepted --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.