# HG changeset patch # User John W. Eaton # Date 1673981006 18000 # Node ID 345a3f5890e7adbebdb408d057490f48d5b5cb23 # Parent e863066429f13284576240c158dfac46704a9f2a assume QOpenGLWidget is available QOpenGLWidget was introduced in Qt 5.4. * acinclude.m4 (OCTAVE_CHECK_QT_OPENGL_OK): Delete. (OCTAVE_CHECK_QT_VERSION): Delete use. Don't define separate macros and compiler flag variables for QtOpenGL module. Include them with the other Qt compiler flags. * subst-config-vals.in.sh, subst-cross-config-vals.in.sh, configure.ac, GLCanvas.cc, GLCanvas.h, module.mk, build-env.h, build-env.in.cc, toplev.cc: Eliminate checks for Qt QOpenGLWidget. Assume it is always available. Eliminate QtOpenGL configuration variables. diff -r e863066429f1 -r 345a3f5890e7 build-aux/subst-config-vals.in.sh --- a/build-aux/subst-config-vals.in.sh Tue Jan 17 13:11:02 2023 -0500 +++ b/build-aux/subst-config-vals.in.sh Tue Jan 17 13:43:26 2023 -0500 @@ -210,7 +210,6 @@ QT_CPPFLAGS="@QT_CPPFLAGS@" QT_LDFLAGS="@QT_LDFLAGS@" QT_LIBS="@QT_LIBS@" -QT_OPENGL_LIBS="@QT_OPENGL_LIBS@" RANLIB="@RANLIB@" RDYNAMIC_FLAG="@RDYNAMIC_FLAG@" READLINE_LIBS="@LIBREADLINE@" @@ -372,7 +371,6 @@ -e "s|%OCTAVE_CONF_QT_CPPFLAGS%|\"${QT_CPPFLAGS}\"|" \ -e "s|%OCTAVE_CONF_QT_LDFLAGS%|\"${QT_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_QT_LIBS%|\"${QT_LIBS}\"|" \ - -e "s|%OCTAVE_CONF_QT_OPENGL_LIBS%|\"${QT_OPENGL_LIBS}\"|" \ -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \ -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \ -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" | \ diff -r e863066429f1 -r 345a3f5890e7 build-aux/subst-cross-config-vals.in.sh --- a/build-aux/subst-cross-config-vals.in.sh Tue Jan 17 13:11:02 2023 -0500 +++ b/build-aux/subst-cross-config-vals.in.sh Tue Jan 17 13:43:26 2023 -0500 @@ -214,7 +214,6 @@ QT_CPPFLAGS="@QT_CPPFLAGS@" QT_LDFLAGS="@QT_LDFLAGS@" QT_LIBS="@QT_LIBS@" -QT_OPENGL_LIBS="@QT_OPENGL_LIBS@" RANLIB="@RANLIB@" RDYNAMIC_FLAG="@RDYNAMIC_FLAG@" READLINE_LIBS="@LIBREADLINE@" @@ -376,7 +375,6 @@ -e "s|%OCTAVE_CONF_QT_CPPFLAGS%|\"${QT_CPPFLAGS}\"|" \ -e "s|%OCTAVE_CONF_QT_LDFLAGS%|\"${QT_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_QT_LIBS%|\"${QT_LIBS}\"|" \ - -e "s|%OCTAVE_CONF_QT_OPENGL_LIBS%|\"${QT_OPENGL_LIBS}\"|" \ -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \ -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \ -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" | \ diff -r e863066429f1 -r 345a3f5890e7 configure.ac --- a/configure.ac Tue Jan 17 13:11:02 2023 -0500 +++ b/configure.ac Tue Jan 17 13:43:26 2023 -0500 @@ -3027,8 +3027,8 @@ OCTAVE_GUI_LINK_OPTS="" if test $build_qt_gui = yes; then - LIBOCTGUI_LINK_DEPS="$QT_LIBS $QT_OPENGL_LIBS" - LIBOCTGUI_LINK_OPTS="$QT_LDFLAGS $QT_OPENGL_LDFLAGS" + LIBOCTGUI_LINK_DEPS="$QT_LIBS" + LIBOCTGUI_LINK_OPTS="$QT_LDFLAGS" if test $link_all_deps = yes || test -n "$QT_LDFLAGS"; then LIBOCTGUI_LINK_DEPS="$LIBOCTGUI_LINK_DEPS $LIBOCTINTERP_LINK_DEPS" @@ -3273,7 +3273,6 @@ Qt CPPFLAGS: $QT_CPPFLAGS Qt LDFLAGS: $QT_LDFLAGS Qt GUI libraries: $QT_LIBS - Qt OpenGL libraries: $QT_OPENGL_LIBS Qt moc: $MOC $MOCFLAGS Qt uic: $UIC $UICFLAGS Qt rcc: $RCC $RCCFLAGS diff -r e863066429f1 -r 345a3f5890e7 libgui/graphics/GLCanvas.cc --- a/libgui/graphics/GLCanvas.cc Tue Jan 17 13:11:02 2023 -0500 +++ b/libgui/graphics/GLCanvas.cc Tue Jan 17 13:43:26 2023 -0500 @@ -37,23 +37,10 @@ OCTAVE_BEGIN_NAMESPACE(octave) -#if defined (HAVE_QOPENGLWIDGET) -# define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS -#else -# if defined (Q_OS_WIN32) -# define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS \ - QGLFormat (QGL::SampleBuffers | QGL::AlphaChannel \ - | QGL::IndirectRendering), -# else -# define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS \ - QGLFormat (QGL::SampleBuffers | QGL::AlphaChannel), -# endif -#endif - GLCanvas::GLCanvas (octave::interpreter& interp, const graphics_handle& gh, QWidget *xparent) - : OCTAVE_QT_OPENGL_WIDGET (OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS xparent), - Canvas (interp, gh), m_glfcns (), m_renderer (m_glfcns) + : QOpenGLWidget (xparent), Canvas (interp, gh), m_glfcns (), + m_renderer (m_glfcns) { setFocusPolicy (Qt::ClickFocus); setFocus (); @@ -113,9 +100,9 @@ if (go.get ("visible").string_value () == "off" || go.get ("__printing__").string_value () == "on") { - OCTAVE_QT_OPENGL_FBO - fbo (pos(2), pos(3), - OCTAVE_QT_OPENGL_FBO::Attachment::Depth); + QOpenGLFramebufferObject + fbo (pos(2), pos(3), + QOpenGLFramebufferObject::Attachment::Depth); fbo.bind (); @@ -172,9 +159,9 @@ pos(2) *= dpr; pos(3) *= dpr; - OCTAVE_QT_OPENGL_FBO + QOpenGLFramebufferObject fbo (pos(2), pos(3), - OCTAVE_QT_OPENGL_FBO::Attachment::Depth); + QOpenGLFramebufferObject::Attachment::Depth); fbo.bind (); @@ -273,14 +260,14 @@ GLCanvas::keyPressEvent (QKeyEvent *xevent) { if (! canvasKeyPressEvent (xevent)) - OCTAVE_QT_OPENGL_WIDGET::keyPressEvent (xevent); + QOpenGLWidget::keyPressEvent (xevent); } void GLCanvas::keyReleaseEvent (QKeyEvent *xevent) { if (! canvasKeyReleaseEvent (xevent)) - OCTAVE_QT_OPENGL_WIDGET::keyReleaseEvent (xevent); + QOpenGLWidget::keyReleaseEvent (xevent); } bool diff -r e863066429f1 -r 345a3f5890e7 libgui/graphics/GLCanvas.h --- a/libgui/graphics/GLCanvas.h Tue Jan 17 13:11:02 2023 -0500 +++ b/libgui/graphics/GLCanvas.h Tue Jan 17 13:43:26 2023 -0500 @@ -26,21 +26,10 @@ #if ! defined (octave_GLCanvas_h) #define octave_GLCanvas_h 1 -#if defined (HAVE_QOPENGLWIDGET) -# include -# define OCTAVE_QT_OPENGL_WIDGET QOpenGLWidget -# include -# define OCTAVE_QT_OPENGL_FBO QOpenGLFramebufferObject -# include -# include -#elif defined (HAVE_QGLWIDGET) -# include -# define OCTAVE_QT_OPENGL_WIDGET QGLWidget -# include -# define OCTAVE_QT_OPENGL_FBO QGLFramebufferObject -#else -# error "configuration error: must have or ." -#endif +#include +#include +#include +#include #include "Canvas.h" @@ -49,7 +38,7 @@ OCTAVE_BEGIN_NAMESPACE(octave) - class GLCanvas : public OCTAVE_QT_OPENGL_WIDGET, public Canvas + class GLCanvas : public QOpenGLWidget, public Canvas { public: GLCanvas (octave::interpreter& interp, diff -r e863066429f1 -r 345a3f5890e7 libgui/graphics/module.mk --- a/libgui/graphics/module.mk Tue Jan 17 13:11:02 2023 -0500 +++ b/libgui/graphics/module.mk Tue Jan 17 13:43:26 2023 -0500 @@ -128,7 +128,6 @@ $(FONTCONFIG_CPPFLAGS) \ $(HDF5_CPPFLAGS) \ @OCTGUI_DLL_DEFS@ \ - @QT_OPENGL_CPPFLAGS@ \ -Ilibgui/graphics -I$(srcdir)/libgui/graphics \ -Ilibgui/src -I$(srcdir)/libgui/src \ -Iliboctave \ diff -r e863066429f1 -r 345a3f5890e7 libinterp/build-env.h --- a/libinterp/build-env.h Tue Jan 17 13:11:02 2023 -0500 +++ b/libinterp/build-env.h Tue Jan 17 13:43:26 2023 -0500 @@ -144,7 +144,6 @@ extern OCTINTERP_API const char *QT_CPPFLAGS; extern OCTINTERP_API const char *QT_LDFLAGS; extern OCTINTERP_API const char *QT_LIBS; -extern OCTINTERP_API const char *QT_OPENGL_LIBS; extern OCTINTERP_API const char *RANLIB; extern OCTINTERP_API const char *RDYNAMIC_FLAG; extern OCTINTERP_API const char *READLINE_LIBS; diff -r e863066429f1 -r 345a3f5890e7 libinterp/build-env.in.cc --- a/libinterp/build-env.in.cc Tue Jan 17 13:11:02 2023 -0500 +++ b/libinterp/build-env.in.cc Tue Jan 17 13:43:26 2023 -0500 @@ -251,8 +251,6 @@ const char *QT_LIBS = %OCTAVE_CONF_QT_LIBS%; -const char *QT_OPENGL_LIBS = %OCTAVE_CONF_QT_OPENGL_LIBS%; - const char *RANLIB = %OCTAVE_CONF_RANLIB%; const char *RDYNAMIC_FLAG = %OCTAVE_CONF_RDYNAMIC_FLAG%; diff -r e863066429f1 -r 345a3f5890e7 libinterp/corefcn/toplev.cc --- a/libinterp/corefcn/toplev.cc Tue Jan 17 13:11:02 2023 -0500 +++ b/libinterp/corefcn/toplev.cc Tue Jan 17 13:43:26 2023 -0500 @@ -540,7 +540,6 @@ { "QT_CPPFLAGS", build_env::QT_CPPFLAGS }, { "QT_LDFLAGS", build_env::QT_LDFLAGS }, { "QT_LIBS", build_env::QT_LIBS }, - { "QT_OPENGL_LIBS", build_env::QT_OPENGL_LIBS }, { "RANLIB", build_env::RANLIB }, { "RDYNAMIC_FLAG", build_env::RDYNAMIC_FLAG }, { "READLINE_LIBS", build_env::READLINE_LIBS }, diff -r e863066429f1 -r 345a3f5890e7 m4/acinclude.m4 --- a/m4/acinclude.m4 Tue Jan 17 13:11:02 2023 -0500 +++ b/m4/acinclude.m4 Tue Jan 17 13:43:26 2023 -0500 @@ -1688,67 +1688,6 @@ AM_CONDITIONAL([WIN32_TERMINAL], [test $win32_terminal = yes]) ]) dnl -dnl Check whether Qt works with full OpenGL support -dnl -AC_DEFUN([OCTAVE_CHECK_QT_OPENGL_OK], [ - dnl Normally the language and compiler flags would be set and restored - dnl inside of the AC_CACHE_CHECK body. Because we also need to check for - dnl Qt header files associated with the compilation test, set and restore - dnl these values outside of the AC_CACHE_CHECK for this macro only. - AC_LANG_PUSH(C++) - ac_octave_save_CPPFLAGS="$CPPFLAGS" - ac_octave_save_CXXFLAGS="$CXXFLAGS" - CPPFLAGS="$QT_OPENGL_CPPFLAGS $CXXPICFLAG $CPPFLAGS" - CXXFLAGS="$CXXPICFLAG $CXXFLAGS" - AC_CHECK_HEADERS([QOpenGLWidget QGLWidget QGLFunctions_1_1]) - AC_CACHE_CHECK([whether Qt works with OpenGL and GLU], - [octave_cv_qt_opengl_ok], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #if HAVE_WINDOWS_H - # include - #endif - #if defined (HAVE_GL_GL_H) - # include - #elif defined (HAVE_OPENGL_GL_H) - # include - #endif - #if defined (HAVE_GL_GLU_H) - # include - #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL - # include - #endif - #if defined (HAVE_QOPENGLWIDGET) - # include - # define OCTAVE_QT_OPENGL_WIDGET QOpenGLWidget - #elif defined (HAVE_QGLWIDGET) - # include - # define OCTAVE_QT_OPENGL_WIDGET QGLWidget - #endif - class gl_widget : public OCTAVE_QT_OPENGL_WIDGET - { - public: - gl_widget (QWidget *parent = 0) - : OCTAVE_QT_OPENGL_WIDGET (parent) { } - ~gl_widget () {} - }; - ]], [[ - gl_widget widget; - ]])], - octave_cv_qt_opengl_ok=yes, - octave_cv_qt_opengl_ok=no) - ]) - CPPFLAGS="$ac_octave_save_CPPFLAGS" - CXXFLAGS="$ac_octave_save_CXXFLAGS" - AC_LANG_POP(C++) - if test $octave_cv_qt_opengl_ok = yes; then - $1 - : - else - $2 - : - fi -]) -dnl dnl Check whether the Qt::ImCursorRectangle enum value exists. dnl It replaces the Qt::ImMicroFocus enum value that was deprecated dnl in Qt 5.14. @@ -1830,8 +1769,8 @@ fi ]) dnl -dnl Check whether Qt VERSION is present, supports QtOpenGL and -dnl QScintilla, and will work for Octave. +dnl Check whether Qt VERSION is present, supports QScintilla, +dnl and will work for Octave. dnl dnl OCTAVE_CHECK_QT_VERSION(VERSION) dnl @@ -1857,8 +1796,7 @@ ## Check for Qt libraries case "$qt_version" in 5) - QT_OPENGL_MODULE="Qt5OpenGL" - QT_MODULES="Qt5Core Qt5Gui Qt5Help Qt5Network Qt5PrintSupport Qt5Xml" + QT_MODULES="Qt5Core Qt5Gui Qt5Help Qt5Network Qt5OpenGL Qt5PrintSupport Qt5Xml" ;; *) AC_MSG_ERROR([Unrecognized Qt version $qt_version]) @@ -1888,9 +1826,6 @@ QT_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_MODULES | $SED -e 's/^ *$//')" QT_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_MODULES | $SED -e 's/^ *$//')" QT_LIBS="$($PKG_CONFIG --libs-only-l $QT_MODULES | $SED -e 's/^ *$//')" - QT_OPENGL_CPPFLAGS="$($PKG_CONFIG --cflags-only-I $QT_OPENGL_MODULE | $SED -e 's/^ *$//')" - QT_OPENGL_LDFLAGS="$($PKG_CONFIG --libs-only-L $QT_OPENGL_MODULE | $SED -e 's/^ *$//')" - QT_OPENGL_LIBS="$($PKG_CONFIG --libs-only-l $QT_OPENGL_MODULE | $SED -e 's/^ *$//')" case $host_os in *darwin*) @@ -1898,8 +1833,6 @@ if test -z "$QT_LIBS"; then QT_LDFLAGS="`$PKG_CONFIG --libs-only-other $QT_MODULES | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`" QT_LIBS="`$PKG_CONFIG --libs-only-other $QT_MODULES | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`" - QT_OPENGL_LDFLAGS="`$PKG_CONFIG --libs-only-other $QT_OPENGL_MODULE | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`" - QT_OPENGL_LIBS="`$PKG_CONFIG --libs-only-other $QT_OPENGL_MODULE | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`" ## Enabling link_all_deps works around libtool's imperfect handling ## of the -F flag if test -n "$QT_LDFLAGS"; then @@ -2002,15 +1935,6 @@ OCTAVE_CHECK_QT_IMCURSORRECTANGLE_ENUM_VALUE OCTAVE_CHECK_QT_SPLITBEHAVIOR_ENUM - if test -n "$OPENGL_LIBS"; then - OCTAVE_CHECK_QT_OPENGL_OK([build_qt_graphics=yes], - [warn_qt_opengl="Qt does not work with the OpenGL libs (GL and GLU); disabling OpenGL graphics with Qt GUI"]) - - if test $build_qt_graphics = yes; then - AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)]) - fi - fi - OCTAVE_CHECK_QSCINTILLA([$qt_version]) fi @@ -2023,9 +1947,6 @@ AC_SUBST(QT_CPPFLAGS) AC_SUBST(QT_LDFLAGS) AC_SUBST(QT_LIBS) - AC_SUBST(QT_OPENGL_CPPFLAGS) - AC_SUBST(QT_OPENGL_LDFLAGS) - AC_SUBST(QT_OPENGL_LIBS) ]) dnl dnl Check if the default Fortran INTEGER is 64 bits wide.