changeset 31747:2f730c070d3e

assume QOverload template is available The QOverload Template was introduced in Qt 5.7. * acinclude.m4 (OCTAVE_CHECK_QOVERLOAD_TEMPLATE): Delete. (OCTAVE_CHECK_QT_VERSION): Delete use. * octave-qtutils.h: Delete. * libgui/src/module.mk: Update. * ButtonGroup.cc, PopupMenuControl.cc, documentation-bookmarks.cc, files-dock-widget.cc, file-editor-tab.cc, file-editor.cc, main-window.cc, set-path-dialog.cc, settings-dialog.cc, variable-editor.cc, workspace-view.cc: Don't include octave-qtutils.h.
author John W. Eaton <jwe@octave.org>
date Tue, 17 Jan 2023 10:00:45 -0500
parents 28177dcaefad
children 90a741992f3f
files libgui/graphics/ButtonGroup.cc libgui/graphics/PopupMenuControl.cc libgui/src/documentation-bookmarks.cc libgui/src/files-dock-widget.cc libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor.cc libgui/src/main-window.cc libgui/src/module.mk libgui/src/octave-qtutils.h libgui/src/set-path-dialog.cc libgui/src/settings-dialog.cc libgui/src/variable-editor.cc libgui/src/workspace-view.cc m4/acinclude.m4
diffstat 14 files changed, 0 insertions(+), 130 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/ButtonGroup.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/graphics/ButtonGroup.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -45,8 +45,6 @@
 #include "QtHandlesUtils.h"
 #include "qt-graphics-toolkit.h"
 
-#include "octave-qtutils.h"
-
 #include "interpreter.h"
 #include "oct-map.h"
 
--- a/libgui/graphics/PopupMenuControl.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/graphics/PopupMenuControl.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -33,8 +33,6 @@
 #include "PopupMenuControl.h"
 #include "QtHandlesUtils.h"
 
-#include "octave-qtutils.h"
-
 OCTAVE_BEGIN_NAMESPACE(octave)
 
   PopupMenuControl *
--- a/libgui/src/documentation-bookmarks.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/documentation-bookmarks.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -44,7 +44,6 @@
 #include "gui-preferences-dc.h"
 #include "gui-preferences-sc.h"
 #include "gui-settings.h"
-#include "octave-qtutils.h"
 
 #include "defaults.h"
 #include "file-ops.h"
--- a/libgui/src/files-dock-widget.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/files-dock-widget.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -50,7 +50,6 @@
 #include "gui-preferences-fb.h"
 #include "gui-preferences-global.h"
 #include "gui-settings.h"
-#include "octave-qtutils.h"
 #include "qt-interpreter-events.h"
 
 #include "oct-env.h"
--- a/libgui/src/m-editor/file-editor-tab.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/m-editor/file-editor-tab.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -74,7 +74,6 @@
 #include "gui-settings.h"
 #include "gui-utils.h"
 #include "marker.h"
-#include "octave-qtutils.h"
 #include "octave-txt-lexer.h"
 
 #include "cmd-edit.h"
--- a/libgui/src/m-editor/file-editor.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/m-editor/file-editor.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -52,7 +52,6 @@
 #include "gui-preferences-global.h"
 #include "gui-settings.h"
 #include "main-window.h"
-#include "octave-qtutils.h"
 
 #include "oct-env.h"
 
--- a/libgui/src/main-window.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/main-window.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -73,7 +73,6 @@
 #include "main-window.h"
 #include "news-reader.h"
 #include "octave-qobject.h"
-#include "octave-qtutils.h"
 #include "settings-dialog.h"
 #include "welcome-wizard.h"
 
--- a/libgui/src/module.mk	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/module.mk	Tue Jan 17 10:00:45 2023 -0500
@@ -377,7 +377,6 @@
   %reldir%/main-window.h \
   %reldir%/news-reader.h \
   %reldir%/octave-qobject.h \
-  %reldir%/octave-qtutils.h \
   %reldir%/qt-application.h \
   %reldir%/qt-interpreter-events.h \
   %reldir%/qt-utils.h \
--- a/libgui/src/octave-qtutils.h	Tue Jan 17 09:52:27 2023 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) 2021-2023 The Octave Project Developers
-//
-// See the file COPYRIGHT.md in the top-level directory of this
-// distribution or <https://octave.org/copyright/>.
-//
-// This file is part of Octave.
-//
-// Octave is free software: you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Octave is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Octave; see the file COPYING.  If not, see
-// <https://www.gnu.org/licenses/>.
-//
-////////////////////////////////////////////////////////////////////////
-
-#if ! defined (octave_octave_qtutils_h)
-#define octave_octave_qtutils_h 1
-
-// This file should not be installed and should only be included in C++
-// source files after config.h is included, not in other header files.
-
-#if ! defined (HAVE_QOVERLOAD_TEMPLATE)
-
-// The following are copied directly from qglobal.h from Qt 5.15.2 with
-// Q_DECL_CONSTEXPR replaced by constexpr so that we don't have to
-// include any Qt headers or define any other special magic here.
-// Octave requires C++11 so using constexpr should be OK.
-
-template <typename... Args>
-struct QNonConstOverload
-{
-  template <typename R, typename T>
-  constexpr auto operator()(R (T::*ptr)(Args...)) const noexcept -> decltype(ptr)
-  { return ptr; }
-
-  template <typename R, typename T>
-  static constexpr auto of(R (T::*ptr)(Args...)) noexcept -> decltype(ptr)
-  { return ptr; }
-};
-
-template <typename... Args>
-struct QConstOverload
-{
-  template <typename R, typename T>
-  constexpr auto operator()(R (T::*ptr)(Args...) const) const noexcept -> decltype(ptr)
-  { return ptr; }
-
-  template <typename R, typename T>
-  static constexpr auto of(R (T::*ptr)(Args...) const) noexcept -> decltype(ptr)
-  { return ptr; }
-};
-
-template <typename... Args>
-struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
-{
-  using QConstOverload<Args...>::of;
-  using QConstOverload<Args...>::operator();
-  using QNonConstOverload<Args...>::of;
-  using QNonConstOverload<Args...>::operator();
-
-  template <typename R>
-  constexpr auto operator()(R (*ptr)(Args...)) const noexcept -> decltype(ptr)
-  { return ptr; }
-
-  template <typename R>
-  static constexpr auto of(R (*ptr)(Args...)) noexcept -> decltype(ptr)
-  { return ptr; }
-};
-
-#endif
-
-#endif
--- a/libgui/src/set-path-dialog.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/set-path-dialog.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -51,7 +51,6 @@
 
 #include "gui-preferences-pd.h"
 #include "gui-settings.h"
-#include "octave-qtutils.h"
 #include "set-path-dialog.h"
 #include "set-path-model.h"
 
--- a/libgui/src/settings-dialog.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/settings-dialog.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -65,7 +65,6 @@
 
 #include "gui-preferences-all.h"
 #include "gui-settings.h"
-#include "octave-qtutils.h"
 #include "settings-dialog.h"
 #include "shortcuts-tree-widget.h"
 #include "variable-editor.h"
--- a/libgui/src/variable-editor.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/variable-editor.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -57,7 +57,6 @@
 #include "gui-preferences-sc.h"
 #include "gui-preferences-ve.h"
 #include "gui-settings.h"
-#include "octave-qtutils.h"
 #include "ovl.h"
 #include "qt-utils.h"
 #include "variable-editor-model.h"
--- a/libgui/src/workspace-view.cc	Tue Jan 17 09:52:27 2023 -0500
+++ b/libgui/src/workspace-view.cc	Tue Jan 17 10:00:45 2023 -0500
@@ -43,7 +43,6 @@
 
 #include "gui-preferences-ws.h"
 #include "gui-settings.h"
-#include "octave-qtutils.h"
 #include "workspace-view.h"
 
 OCTAVE_BEGIN_NAMESPACE(octave)
--- a/m4/acinclude.m4	Tue Jan 17 09:52:27 2023 -0500
+++ b/m4/acinclude.m4	Tue Jan 17 10:00:45 2023 -0500
@@ -1569,39 +1569,6 @@
   fi
 ])
 dnl
-dnl Check whether Qt has the QOverload template introduced in Qt 5.7.
-dnl
-AC_DEFUN([OCTAVE_CHECK_QOVERLOAD_TEMPLATE], [
-  AC_CACHE_CHECK([for QOverload template],
-    [octave_cv_qoverload_template],
-    [AC_LANG_PUSH(C++)
-    ac_octave_save_CPPFLAGS="$CPPFLAGS"
-    ac_octave_save_CXXFLAGS="$CXXFLAGS"
-    CPPFLAGS="$QT_CPPFLAGS $CXXPICFLAG $CPPFLAGS"
-    CXXFLAGS="$CXXPICFLAG $CXXFLAGS"
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-        #include <QtGlobal>
-        ]], [[
-        struct Foo
-        {
-            void overloadedFunction (int) const;
-            void overloadedFunction (int, const QString &) const;
-        };
-        QOverload<int>::of (&Foo::overloadedFunction);
-        QOverload<int, const QString &>::of (&Foo::overloadedFunction);
-        ]])],
-      octave_cv_qoverload_template=yes,
-      octave_cv_qoverload_template=no)
-    CPPFLAGS="$ac_octave_save_CPPFLAGS"
-    CXXFLAGS="$ac_octave_save_CXXFLAGS"
-    AC_LANG_POP(C++)
-  ])
-  if test $octave_cv_qoverload_template = yes; then
-    AC_DEFINE(HAVE_QOVERLOAD_TEMPLATE, 1,
-      [Define to 1 if you have the `QOverload' template.])
-  fi
-])
-dnl
 dnl Check whether the Qt class QRegion has the iterators and related
 dnl functions introduced in Qt 5.8.
 dnl
@@ -2189,7 +2156,6 @@
     OCTAVE_CHECK_FUNC_QWHEELEVENT_POSITION
     OCTAVE_CHECK_FUNC_QPAINTER_SETRENDERHINT_LOSSLESS
 
-    OCTAVE_CHECK_QOVERLOAD_TEMPLATE
     OCTAVE_CHECK_QREGION_ITERATORS
     OCTAVE_CHECK_QT_IMCURSORRECTANGLE_ENUM_VALUE
     OCTAVE_CHECK_QT_SPLITBEHAVIOR_ENUM