From a0319c4073dc7db7aae128db94613439c2341685 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 30 Nov 2021 07:56:04 +0100 Subject: [PATCH] WIP: some more build fixes --- scripts/mkqtdecl6/mkqtdecl.conf | 13 +- scripts/mkqtdecl_common/produce.rb | 175 ------------------ src/gsiqt/qtbasic/gsiQtCoreExternals.h | 4 +- src/gsiqt/qtbasic/gsiQtDesignerExternals.h | 3 + src/gsiqt/qtbasic/gsiQtMultimediaExternals.h | 2 + src/gsiqt/qtbasic/gsiQtNetworkExternals.h | 2 + .../qtbasic/gsiQtPrintSupportExternals.h | 2 + src/gsiqt/qtbasic/gsiQtSqlExternals.h | 2 + src/gsiqt/qtbasic/gsiQtSvgExternals.h | 2 + src/gsiqt/qtbasic/gsiQtUiToolsExternals.h | 2 + src/gsiqt/qtbasic/gsiQtXmlExternals.h | 2 + src/gsiqt/qtbasic/gsiQtXmlPatternsExternals.h | 3 + 12 files changed, 31 insertions(+), 181 deletions(-) diff --git a/scripts/mkqtdecl6/mkqtdecl.conf b/scripts/mkqtdecl6/mkqtdecl.conf index 4bea2dfc9..9a082cc5b 100644 --- a/scripts/mkqtdecl6/mkqtdecl.conf +++ b/scripts/mkqtdecl6/mkqtdecl.conf @@ -741,11 +741,14 @@ include "QVector3D", [ "", "", "" ] include "QVector4D", [ "", "", "" ] include "QAction", [ "", "", "", "" ] include "QCursor", [ "", "", "" ] -include "QGraphicsItem", [ "", "", "", "", "", "", "", "", "", "", "" ] +include "QGraphicsItem", [ "", "", "", "", "", "", "", "", "", "", "", "" ] include "QGraphicsScene", [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ] -include "QGuiApplication", [ "", "", "", "", "", "" ] -include "QApplication", [ "", "", "", "", "" ] -include "QWindow", [ "", "" ] +include "QGuiApplication", [ "", "", "", "", "", "", "", "" ] +include "QApplication", [ "", "", "", "", "", "", "", "" ] +include "QWindow", [ "", "" + "", "", "", "", "", + "", "", "", "", "", + "", "", "", "" ] include "QOffscreenSurface", [ "", "" ] include "QScreenOrientationChangeEvent", [ "", "" ] @@ -1148,7 +1151,7 @@ drop_class "QSqlDriverPlugin" # not required ? include "QCamera", [ "", "", "", "" ] include "QAudioBuffer", [ "" ] include "QBackingStore", [ "" ] -include "QMediaPlayer", [ "", "", "", "", "", "" ] +include "QMediaPlayer", [ "", "", "", "", "", "", "" ] drop_class "QAudioBuffer", /StereoFrameDefault/ drop_class "QAudioBuffer", /StereoFrame/ diff --git a/scripts/mkqtdecl_common/produce.rb b/scripts/mkqtdecl_common/produce.rb index d02c70055..2679f501f 100755 --- a/scripts/mkqtdecl_common/produce.rb +++ b/scripts/mkqtdecl_common/produce.rb @@ -1608,7 +1608,6 @@ END ofile.puts("#include \"gsiQt.h\"") ofile.puts("#include \"gsi#{modn}Common.h\"") - ofile.puts("#include \"gsiDecl#{modn}TypeTraits.h\"") end @@ -2396,22 +2395,6 @@ END # forward decl @ext_decls << "#{struct.kind.to_s} #{cls};\n\n" - if false # @@@ no longer needed - # type traits included ... - tt = "namespace tl { template <> struct type_traits<#{cls}> : public type_traits {\n" - if !conf.has_copy_ctor?(cls) || is_abstract || (eq_op && eq_op.visibility == :private) - tt += " typedef tl::false_tag has_copy_constructor;\n" - end - if !conf.has_default_ctor?(cls) || is_abstract - tt += " typedef tl::false_tag has_default_constructor;\n" - end - if (dtor = struct.get_dtor) && dtor.visibility != :public - tt += " typedef tl::false_tag has_public_destructor;\n" - end - tt += "}; }\n\n" - @ext_decls << tt - end - # only for top-level classes external declarations are produced currently @ext_decls << "namespace gsi { GSI_#{modn.upcase}_PUBLIC gsi::Class<#{cls}> &qtdecl_#{clsn} (); }\n\n" @@ -2970,161 +2953,6 @@ END end - def produce_ttfile_traits(ttfile, conf, decl_obj) - - (cls, clsn) = make_cls_names(decl_obj) - - struct = decl_obj.struct - - mm = {} - struct.collect_all_methods(mm, conf) - - # if one method is abstract, omit ctors for example - is_abstract = mm.values.find do |m| - m.find { |bd| bd.virtual && bd.type.init == "0" } != nil - end - - eq_op = (mm["operator="] || [])[0] - - # Note: right now, there is no way to specify type traits globally for nested - # classes because there is no forward declaration of inner classes. In that case we - # use the header - if cls =~ /^(.*?)::/ - ttfile.puts("#include <#{$1}>") - else - ttfile.puts("#{struct.kind.to_s} #{cls};") - end - - if false # @@@ no longer needed - ttfile.puts("namespace tl {") - ttfile.puts "template <> struct type_traits<#{cls}> : public type_traits {" - if !conf.has_copy_ctor?(cls) || is_abstract || (eq_op && eq_op.visibility == :private) - ttfile.puts " typedef tl::false_tag has_copy_constructor;" - end - if !conf.has_default_ctor?(cls) || is_abstract - ttfile.puts " typedef tl::false_tag has_default_constructor;" - end - if (dtor = struct.get_dtor) && dtor.visibility != :public - ttfile.puts " typedef tl::false_tag has_public_destructor;" - end - ttfile.puts "};" - ttfile.puts "}" - ttfile.puts "" - end - - if struct.needs_adaptor(conf) - - if false # @@@ no longer needed - ttfile.puts("class #{clsn}_Adaptor;") - ttfile.puts("namespace tl {") - ttfile.puts "template <> struct type_traits<#{clsn}_Adaptor> : public type_traits {" - if !conf.has_copy_ctor?(cls) || (eq_op && eq_op.visibility == :private) - ttfile.puts " typedef tl::false_tag has_copy_constructor;" - end - if !conf.has_default_ctor?(cls) - ttfile.puts " typedef tl::false_tag has_default_constructor;" - end - ttfile.puts "};" - ttfile.puts "}" - ttfile.puts "" - end - - end - - # walk through the subclasses - - (struct.body_decl || []).each do |bd| - if bd.is_a?(CPPStructDeclaration) && bd.visibility == :public && bd.struct.body_decl && bd.myself != "" && !conf.is_class_dropped?(cls, bd.myself) - produce_ttfile_traits(ttfile, conf, bd) - end - end - - end - - def produce_ttfile(conf) - - ttfile_name = "gsiDecl#{modn}TypeTraits.h" - ttfile_path = $gen_dir + "/" + ttfile_name - - ttfile_path && File.open(ttfile_path, "w") do |ttfile| - - ttfile.puts(<<"END"); - -/* - - KLayout Layout Viewer - Copyright (C) 2006-2021 Matthias Koefferlein - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -END - - ttfile.puts("/**") - ttfile.puts("* @file #{ttfile_path}") - ttfile.puts("* @brief Type traits for the Qt binding classes") - ttfile.puts("*") - ttfile.puts("* DO NOT EDIT THIS FILE. ") - ttfile.puts("* This file has been created automatically") - ttfile.puts("*/") - ttfile.puts("") - - if false # @@@ no longer required - ttfile.puts("#ifndef _HDR_gsiDecl#{modn}TypeTraits") - ttfile.puts("#define _HDR_gsiDecl#{modn}TypeTraits") - ttfile.puts("") - ttfile.puts("#include \"gsiTypes.h\"") - ttfile.puts("") - - ttfile.puts("") - - prod_list(conf).each do |decl_obj| - - if decl_obj.is_a?(CPPStructDeclaration) - - decl_obj.myself && produce_ttfile_traits(ttfile, conf, decl_obj) - - elsif decl_obj.is_a?(CPPNamespace) - - cls = decl_obj.myself - if false # no longer required - ttfile.puts("class #{cls}_Namespace;") - ttfile.puts("namespace tl {") - ttfile.puts "template <> struct type_traits<#{cls}_Namespace> : public type_traits {" - ttfile.puts " typedef tl::false_tag has_copy_constructor;" - ttfile.puts " typedef tl::false_tag has_default_constructor;" - ttfile.puts "};" - ttfile.puts("}") - ttfile.puts "" - end - - end - - end - - ttfile.puts("") - ttfile.puts("#endif") - end - - puts("#{ttfile_name} written.") - - end - - end - def produce_externals externals_name = "gsiQtExternals.h" @@ -3332,9 +3160,6 @@ end puts("Producing class list") bp.produce_class_list -puts("Producing type traits file ..") -bp.produce_ttfile(conf) - puts("Producing main source file ..") bp.produce_main_source diff --git a/src/gsiqt/qtbasic/gsiQtCoreExternals.h b/src/gsiqt/qtbasic/gsiQtCoreExternals.h index 5a313e210..c0ffc429d 100644 --- a/src/gsiqt/qtbasic/gsiQtCoreExternals.h +++ b/src/gsiqt/qtbasic/gsiQtCoreExternals.h @@ -20,7 +20,9 @@ */ -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= 0x060000 +# include "../qt6/QtCore/gsiQtExternals.h" +#elif QT_VERSION >= 0x050000 # include "../qt5/QtCore/gsiQtExternals.h" #else # include "../qt4/QtCore/gsiQtExternals.h" diff --git a/src/gsiqt/qtbasic/gsiQtDesignerExternals.h b/src/gsiqt/qtbasic/gsiQtDesignerExternals.h index e969f0fea..10d3d0222 100644 --- a/src/gsiqt/qtbasic/gsiQtDesignerExternals.h +++ b/src/gsiqt/qtbasic/gsiQtDesignerExternals.h @@ -22,6 +22,9 @@ #if !defined(HAVE_QT_DESIGNER) # define FORCE_LINK_GSI_QTDESIGNER +#elif QT_VERSION >= 0x060000 +// Not present in Qt6 +# define FORCE_LINK_GSI_QTDESIGNER #elif QT_VERSION >= 0x050000 # include "../qt5/QtDesigner/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtMultimediaExternals.h b/src/gsiqt/qtbasic/gsiQtMultimediaExternals.h index 92f3efc62..8a0bd5084 100644 --- a/src/gsiqt/qtbasic/gsiQtMultimediaExternals.h +++ b/src/gsiqt/qtbasic/gsiQtMultimediaExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_MULTIMEDIA) # define FORCE_LINK_GSI_QTMULTIMEDIA +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtMultimedia/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtMultimedia/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtNetworkExternals.h b/src/gsiqt/qtbasic/gsiQtNetworkExternals.h index d7032d221..ae514cd31 100644 --- a/src/gsiqt/qtbasic/gsiQtNetworkExternals.h +++ b/src/gsiqt/qtbasic/gsiQtNetworkExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_NETWORK) # define FORCE_LINK_GSI_QTNETWORK +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtNetwork/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtNetwork/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtPrintSupportExternals.h b/src/gsiqt/qtbasic/gsiQtPrintSupportExternals.h index 251a3dc79..6dbaa2dc2 100644 --- a/src/gsiqt/qtbasic/gsiQtPrintSupportExternals.h +++ b/src/gsiqt/qtbasic/gsiQtPrintSupportExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_PRINTSUPPORT) # define FORCE_LINK_GSI_QTPRINTSUPPORT +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtPrintSupport/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtPrintSupport/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtSqlExternals.h b/src/gsiqt/qtbasic/gsiQtSqlExternals.h index b595853eb..30e3f0743 100644 --- a/src/gsiqt/qtbasic/gsiQtSqlExternals.h +++ b/src/gsiqt/qtbasic/gsiQtSqlExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_SQL) # define FORCE_LINK_GSI_QTSQL +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtSql/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtSql/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtSvgExternals.h b/src/gsiqt/qtbasic/gsiQtSvgExternals.h index fd6468d92..5e5966cf5 100644 --- a/src/gsiqt/qtbasic/gsiQtSvgExternals.h +++ b/src/gsiqt/qtbasic/gsiQtSvgExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_SVG) # define FORCE_LINK_GSI_QTSVG +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtSvg/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtSvg/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtUiToolsExternals.h b/src/gsiqt/qtbasic/gsiQtUiToolsExternals.h index 3b3c740c9..d4412fbda 100644 --- a/src/gsiqt/qtbasic/gsiQtUiToolsExternals.h +++ b/src/gsiqt/qtbasic/gsiQtUiToolsExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_UITOOLS) # define FORCE_LINK_GSI_QTUITOOLS +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtUiTools/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtUiTools/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtXmlExternals.h b/src/gsiqt/qtbasic/gsiQtXmlExternals.h index b4713bd5c..b95f9f70c 100644 --- a/src/gsiqt/qtbasic/gsiQtXmlExternals.h +++ b/src/gsiqt/qtbasic/gsiQtXmlExternals.h @@ -22,6 +22,8 @@ #if !defined(HAVE_QT_XML) # define FORCE_LINK_GSI_QTXML +#elif QT_VERSION >= 0x060000 +# include "../qt6/QtXml/gsiQtExternals.h" #elif QT_VERSION >= 0x050000 # include "../qt5/QtXml/gsiQtExternals.h" #else diff --git a/src/gsiqt/qtbasic/gsiQtXmlPatternsExternals.h b/src/gsiqt/qtbasic/gsiQtXmlPatternsExternals.h index e5c48f1c0..5928c1db3 100644 --- a/src/gsiqt/qtbasic/gsiQtXmlPatternsExternals.h +++ b/src/gsiqt/qtbasic/gsiQtXmlPatternsExternals.h @@ -22,6 +22,9 @@ #if !defined(HAVE_QT_XML) # define FORCE_LINK_GSI_QTXMLPATTERNS +#elif QT_VERSION >= 0x060000 +// Not present in Qt6 +# define FORCE_LINK_GSI_QTXMLPATTERNS #elif QT_VERSION >= 0x050000 # include "../qt5/QtXmlPatterns/gsiQtExternals.h" #else