From a20c3259bf9798561ce06320d557fd92ecd297f0 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 5 Jun 2018 23:21:15 +0200 Subject: [PATCH] WIP: refactored mkqtdecl configuration (common part factored out), fixed .pro file dependencies --- scripts/mkqtdecl.sh | 2 +- scripts/mkqtdecl4/mkqtdecl.conf | 780 +---------------- scripts/mkqtdecl5/mkqtdecl.conf | 780 +---------------- scripts/mkqtdecl_common/common.conf | 824 ++++++++++++++++++ src/gsiqt/qt4/QtGui/gsiDeclQApplication.cc | 2 +- .../qt5/QtWidgets/gsiDeclQApplication.cc | 2 +- src/gsiqt/qt5/qt5.pro | 4 +- 7 files changed, 883 insertions(+), 1511 deletions(-) create mode 100644 scripts/mkqtdecl_common/common.conf diff --git a/scripts/mkqtdecl.sh b/scripts/mkqtdecl.sh index 816b0659e..e76693c35 100755 --- a/scripts/mkqtdecl.sh +++ b/scripts/mkqtdecl.sh @@ -164,7 +164,7 @@ if [ $update != 0 ]; then for d in Qt*; do cd $d cp $inst_dir/{mkqtdecl.conf,mkqtdecl.properties,mkqtdecl.events} . - cp $inst_dir_common/{cpp_parser_classes.rb,cpp_classes.rb,c++.treetop,parse.rb,reader_ext.rb,produce.rb} . + cp $inst_dir_common/{cpp_parser_classes.rb,cpp_classes.rb,c++.treetop,parse.rb,reader_ext.rb,produce.rb,common.conf} . cd .. done diff --git a/scripts/mkqtdecl4/mkqtdecl.conf b/scripts/mkqtdecl4/mkqtdecl.conf index 44fe53660..edb13c79e 100644 --- a/scripts/mkqtdecl4/mkqtdecl.conf +++ b/scripts/mkqtdecl4/mkqtdecl.conf @@ -1,48 +1,22 @@ +# +# Copyright (C) 2006-2018 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 +# -# -------------------------------------------------------------- -# Some definitions - -def add_native_qapp_ctor_impl(cls) - - qapplication_ctor_code = <<'CODE' - static %CLS% *ctor_%CLS%_Adaptor_args(const std::vector &args%ADDARGS%) - { - // %CLS% needs static sources, so we give it some. - static char **argv = 0; - static std::vector args_copy; - static int argc = 0; - - if (argv != 0) { - throw tl::Exception(tl::to_string(QObject::tr("%CLS% cannot be instantiated twice"))); - } - argv = new char *[args.size ()]; - args_copy = args; - argc = int (args.size ()); - for (std::vector::const_iterator a = args_copy.begin (); a != args_copy.end (); ++a) { - argv[a - args_copy.begin ()] = (char *) a->c_str (); - } - - return new %CLS%_Adaptor (argc, argv%ADDARGSCALL%); - } - - %CLS%_Adaptor (int &argc, char **argv%ADDARGS%) : %CLS% (argc, argv%ADDARGSCALL%) { } -CODE - - qapplication_ctor_decl = <<'DECL' - gsi::constructor("new", &%CLS%_Adaptor::ctor_%CLS%_Adaptor_args, gsi::arg ("argv")%ADDARGS%, "@brief Creates a new %CLS% object\n\n@param argv The command line arguments to pass to Qt%ADDDOC%") -DECL - - if cls == "QApplication" - add_native_impl(cls + "_Adaptor", - qapplication_ctor_code.gsub("%CLS%", cls).gsub("%ADDARGS%", ", bool gui").gsub("%ADDARGSCALL%", ", gui"), - qapplication_ctor_decl.gsub("%CLS%", cls).gsub("%ADDARGS%", ", gsi::arg (\"gui\", false)").gsub("%ADDDOC%", "\\n@param gui If true, a GUI-enabled application is constructed")) - else - add_native_impl(cls + "_Adaptor", - qapplication_ctor_code.gsub("%CLS%", cls).gsub("%ADDARGS%", "").gsub("%ADDARGSCALL%", ""), - qapplication_ctor_decl.gsub("%CLS%", cls).gsub("%ADDARGS%", "").gsub("%ADDDOC%", "")) - end - -end +load(File.join(File.dirname(__FILE__), "common.conf")) # -------------------------------------------------------------- # all modules @@ -323,12 +297,8 @@ rename "QProcess", /QProcess::finished\(int[\s\w]*\)/, "finished_int" # disambig drop_method "QCoreApplication", /QCoreApplication::QCoreApplication/ add_native_qapp_ctor_impl("QCoreApplication") -# alternative implementation for QObject::findChild using QObject for T -add_native_impl("QObject", <<'CODE', <<'DECL') - QObject *find_child_impl (QObject *object, const QString &name) { return object->findChild (name); } -CODE - gsi::method_ext("findChild", &find_child_impl, "@brief Specialisation for findChild (uses QObject as T).") -DECL +# alternative implementation for QObject::findChild +add_native_impl_QObject_findChild # alternative implementation for QChildEvent::child # Reason: this method does not supply a true QObject pointer. Instead it will @@ -389,456 +359,16 @@ CODE DECL # alternative implementation for QFont::Light, QFont::Bold, QFont::Normal, QFont::DemiBold, QFont::Black -add_native_impl("QFont", <<'CODE', <<'DECL') - static unsigned int font_const_light () { return (unsigned int) QFont::Light; } - static unsigned int font_const_normal () { return (unsigned int) QFont::Normal; } - static unsigned int font_const_demibold () { return (unsigned int) QFont::DemiBold; } - static unsigned int font_const_bold () { return (unsigned int) QFont::Bold; } - static unsigned int font_const_black () { return (unsigned int) QFont::Black; } -CODE - gsi::method("Light", &font_const_light, "@brief Font weight constant 'QFont::Light'.") + - gsi::method("Normal", &font_const_normal, "@brief Font weight constant 'QFont::Normal'.") + - gsi::method("DemiBold", &font_const_demibold, "@brief Font weight constant 'QFont::DemiBold'.") + - gsi::method("Bold", &font_const_bold, "@brief Font weight constant 'QFont::Bold'.") + - gsi::method("Black", &font_const_black, "@brief Font weight constant 'QFont::Black'.") -DECL +add_native_impl_QFont # alternative implementation for QRegion::setRects -add_native_impl("QRegion", <<'CODE', <<'DECL') - static void f_QRegion_setRects(QRegion *r, const std::vector &rects) - { - if (! rects.empty ()) { - return r->setRects (&rects.front (), int (rects.size ())); - } - } -CODE - gsi::method_ext("setRects", &f_QRegion_setRects, "@brief Adaption of setRects without pointer.") -DECL +add_native_impl_QRegion # alternative implementation for QPersistentQModelIndex::operator const QModelIndex & -add_native_impl("QPersistentModelIndex", <<'CODE', <<'DECL') - static const QModelIndex &castToQModelIndex(const QPersistentModelIndex *m) - { - return m->operator const QModelIndex &(); - } -CODE - gsi::method_ext("castToQModelIndex", &castToQModelIndex, "@brief Binding for \"operator const QModelIndex &\".") -DECL +add_native_impl_QPersistentQModelIndex # implementation of operator<< and operator>> for QDataStream -add_native_impl("QDataStream", <<'CODE', <<'DECL') - static qint8 f_QDataStream_read_qint8(QDataStream *s) - { - qint8 v = 0; - *s >> v; - return v; - } - - static quint8 f_QDataStream_read_quint8(QDataStream *s) - { - quint8 v = 0; - *s >> v; - return v; - } - - static qint16 f_QDataStream_read_qint16(QDataStream *s) - { - qint16 v = 0; - *s >> v; - return v; - } - - static quint16 f_QDataStream_read_quint16(QDataStream *s) - { - quint16 v = 0; - *s >> v; - return v; - } - - static qint32 f_QDataStream_read_qint32(QDataStream *s) - { - qint32 v = 0; - *s >> v; - return v; - } - - static quint32 f_QDataStream_read_quint32(QDataStream *s) - { - quint32 v = 0; - *s >> v; - return v; - } - - static quint64 f_QDataStream_read_quint64(QDataStream *s) - { - quint64 v = 0; - *s >> v; - return v; - } - - static qint64 f_QDataStream_read_qint64(QDataStream *s) - { - qint64 v = 0; - *s >> v; - return v; - } - - static double f_QDataStream_read_double(QDataStream *s) - { - double v = 0; - *s >> v; - return v; - } - - static float f_QDataStream_read_float(QDataStream *s) - { - float v = 0; - *s >> v; - return v; - } - - static bool f_QDataStream_read_bool(QDataStream *s) - { - bool v = 0; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QDataStream_read_qchar(QDataStream *s) - { - QChar v = 0; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static qt_gsi::Converter >::target_type f_QDataStream_read_int_list(QDataStream *s) - { - QList v; - *s >> v; - return qt_gsi::Converter >::toc (v); - } - - static qt_gsi::Converter >::target_type f_QDataStream_read_int_vector(QDataStream *s) - { - QVector v; - *s >> v; - return qt_gsi::Converter >::toc (v); - } - - static QString f_QDataStream_read_string(QDataStream *s) - { - QString v; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QDataStream_read_bytearray(QDataStream *s) - { - QByteArray v; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static QDataStream *f_QDataStream_put_qint8(QDataStream *s, qint8 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint8(QDataStream *s, quint8 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qint16(QDataStream *s, qint16 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint16(QDataStream *s, quint16 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qint32(QDataStream *s, qint32 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint32(QDataStream *s, quint32 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qint64(QDataStream *s, qint64 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint64(QDataStream *s, quint64 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_float(QDataStream *s, float v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_double(QDataStream *s, double v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_bool(QDataStream *s, bool v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qchar(QDataStream *s, const qt_gsi::Converter::target_type &v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - - static QDataStream *f_QDataStream_put_int_list(QDataStream *s, const qt_gsi::Converter >::target_type &v) - { - *s << qt_gsi::Converter >::toq (v); - return s; - } - - static QDataStream *f_QDataStream_put_int_vector(QDataStream *s, const qt_gsi::Converter >::target_type &v) - { - *s << qt_gsi::Converter >::toq (v); - return s; - } - - static QDataStream *f_QDataStream_put_string(QDataStream *s, const QString &v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_bytearray(QDataStream *s, const qt_gsi::Converter::target_type &v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - -CODE - gsi::method_ext("read_i8", &f_QDataStream_read_qint8, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui8", &f_QDataStream_read_quint8, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i16", &f_QDataStream_read_qint16, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui16", &f_QDataStream_read_quint16, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i32", &f_QDataStream_read_qint32, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui32", &f_QDataStream_read_quint32, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i64", &f_QDataStream_read_qint64, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui64", &f_QDataStream_read_quint64, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_d", &f_QDataStream_read_double, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_f", &f_QDataStream_read_float, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_b", &f_QDataStream_read_bool, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_qc", &f_QDataStream_read_qchar, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_il", &f_QDataStream_read_int_list, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_iv", &f_QDataStream_read_int_vector, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_s", &f_QDataStream_read_string, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ba", &f_QDataStream_read_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("put_i8", &f_QDataStream_put_qint8, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui8", &f_QDataStream_put_quint8, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i16", &f_QDataStream_put_qint16, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui16", &f_QDataStream_put_quint16, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i32", &f_QDataStream_put_qint32, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui32", &f_QDataStream_put_quint32, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i64", &f_QDataStream_put_qint64, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui64", &f_QDataStream_put_quint64, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_d", &f_QDataStream_put_double, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_f", &f_QDataStream_put_float, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_b", &f_QDataStream_put_bool, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_qc", &f_QDataStream_put_qchar, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_il", &f_QDataStream_put_int_list, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_iv", &f_QDataStream_put_int_vector, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_s", &f_QDataStream_put_string, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ba", &f_QDataStream_put_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator<<") -DECL - -# implementation of operator<< and operator>> for QTextStream -add_native_impl("QTextStream", <<'CODE', <<'DECL') - static short f_QTextStream_read_s(QTextStream *s) - { - short v = 0; - *s >> v; - return v; - } - - static unsigned short f_QTextStream_read_us(QTextStream *s) - { - unsigned short v = 0; - *s >> v; - return v; - } - - static int f_QTextStream_read_i(QTextStream *s) - { - int v = 0; - *s >> v; - return v; - } - - static unsigned int f_QTextStream_read_ui(QTextStream *s) - { - unsigned int v = 0; - *s >> v; - return v; - } - - static qulonglong f_QTextStream_read_ull(QTextStream *s) - { - qulonglong v = 0; - *s >> v; - return v; - } - - static qlonglong f_QTextStream_read_ll(QTextStream *s) - { - qlonglong v = 0; - *s >> v; - return v; - } - - static double f_QTextStream_read_double(QTextStream *s) - { - double v = 0; - *s >> v; - return v; - } - - static float f_QTextStream_read_float(QTextStream *s) - { - float v = 0; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QTextStream_read_qchar(QTextStream *s) - { - QChar v = 0; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static QString f_QTextStream_read_string(QTextStream *s) - { - QString v; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QTextStream_read_bytearray(QTextStream *s) - { - QByteArray v; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static QTextStream *f_QTextStream_put_s(QTextStream *s, short v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_us(QTextStream *s, unsigned short v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_i(QTextStream *s, int v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_ui(QTextStream *s, unsigned int v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_ll(QTextStream *s, qlonglong v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_ull(QTextStream *s, qulonglong v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_float(QTextStream *s, float v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_double(QTextStream *s, double v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_qchar(QTextStream *s, const qt_gsi::Converter::target_type v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - - static QTextStream *f_QTextStream_put_string(QTextStream *s, const QString &v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_bytearray(QTextStream *s, const qt_gsi::Converter::target_type &v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - -CODE - gsi::method_ext("read_s", &f_QTextStream_read_s, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_us", &f_QTextStream_read_us, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i", &f_QTextStream_read_i, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui", &f_QTextStream_read_ui, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ull", &f_QTextStream_read_ull, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ll", &f_QTextStream_read_ll, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_d", &f_QTextStream_read_double, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_f", &f_QTextStream_read_float, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_qc", &f_QTextStream_read_qchar, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_s", &f_QTextStream_read_string, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ba", &f_QTextStream_read_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("put_s", &f_QTextStream_put_s, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_us", &f_QTextStream_put_us, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i", &f_QTextStream_put_i, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui", &f_QTextStream_put_ui, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ull", &f_QTextStream_put_ull, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ll", &f_QTextStream_put_ll, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_d", &f_QTextStream_put_double, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_f", &f_QTextStream_put_float, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_qc", &f_QTextStream_put_qchar, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_s", &f_QTextStream_put_string, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ba", &f_QTextStream_put_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator<<") -DECL +add_native_impl_streams final_class "QIODevice" # because readData cannot be reimplemented final_class "QBuffer" # because readData cannot be reimplemented @@ -852,265 +382,9 @@ drop_method "QPolygon", /QPolygon::QPolygon\(.*const\s+int\s+\*/ # requires cons no_imports "QPolygon" # base class is a template. Base methods are implemented specifically. no_imports "QPolygonF" # base class is a template. Base methods are implemented specifically. -# enhance QPolygon by some missing methods because we dropped the base class -add_native_impl("QPolygon", <<'CODE', <<'DECL') - -#include "dbPolygon.h" - - static QPolygon *ctor_QPolygon_from_polygon (const db::Polygon &pts) - { - QPolygon *p = new QPolygon (); - p->reserve (int (pts.hull ().size ())); - for (db::Polygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPoint ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygon *ctor_QPolygon_from_simple_polygon (const db::SimplePolygon &pts) - { - QPolygon *p = new QPolygon (); - p->reserve (int (pts.hull ().size ())); - for (db::SimplePolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPoint ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygon::const_iterator f_QPolygon_each_begin (const QPolygon *m) - { - return m->begin (); - } - - static QPolygon::const_iterator f_QPolygon_each_end (const QPolygon *m) - { - return m->end (); - } - - static QPoint f_QPolygon_at (const QPolygon *m, int i) - { - return m->at(i); - } - - static QPoint f_QPolygon_front (const QPolygon *m) - { - return m->front(); - } - - static QPoint f_QPolygon_back (const QPolygon *m) - { - return m->back(); - } - - static int f_QPolygon_size (const QPolygon *m) - { - return m->size(); - } - - static void f_QPolygon_clear (QPolygon *m) - { - return m->clear(); - } - - static void f_QPolygon_remove (QPolygon *m, int i) - { - return m->remove (i); - } - - static void f_QPolygon_insert (QPolygon *m, int i, const QPoint &p) - { - return m->insert (i, p); - } - - static void f_QPolygon_replace (QPolygon *m, int i, const QPoint &p) - { - return m->replace (i, p); - } - - static void f_QPolygon_pop_front (QPolygon *m) - { - return m->pop_front (); - } - - static void f_QPolygon_pop_back (QPolygon *m) - { - return m->pop_back (); - } - - static void f_QPolygon_push_front (QPolygon *m, const QPoint &p) - { - return m->push_front (p); - } - - static void f_QPolygon_push_back (QPolygon *m, const QPoint &p) - { - return m->push_back (p); - } - - static void f_QPolygon_reserve (QPolygon *m, int n) - { - return m->reserve (n); - } - - static void f_QPolygon_resize (QPolygon *m, int n) - { - return m->resize (n); - } - - static void f_QPolygon_fill (QPolygon *m, const QPoint &p, int n) - { - m->fill (p, n); - } -CODE - gsi::constructor("new", &ctor_QPolygon_from_polygon, "@brief Creates a polygon from the given KLayout Polygon\n@args p\nRemark: holes are not transferred into the QPolygon.") + - gsi::constructor("new", &ctor_QPolygon_from_simple_polygon, "@brief Creates a polygon from the given KLayout SimplePolygon\n@args p") + - gsi::iterator_ext ("each", &f_QPolygon_each_begin, &f_QPolygon_each_end, "@brief Iterates over all points of the polygon.") + - gsi::method_ext("[]", &f_QPolygon_at, "@brief Gets the point at the given position\n@args index") + - gsi::method_ext("front", &f_QPolygon_front, "@brief Gets the first point") + - gsi::method_ext("back", &f_QPolygon_back, "@brief Gets the last point") + - gsi::method_ext("size", &f_QPolygon_size, "@brief Gets the number of points in the polygon") + - gsi::method_ext("clear", &f_QPolygon_clear, "@brief Empties the polygon") + - gsi::method_ext("remove", &f_QPolygon_remove, "@brief Removes the point at the given position\n@args index") + - gsi::method_ext("insert", &f_QPolygon_insert, "@brief Inserts the point after the given position\n@args index, p") + - gsi::method_ext("replace", &f_QPolygon_replace, "@brief Replaces the point at the given position\n@args index, p") + - gsi::method_ext("pop_front", &f_QPolygon_pop_front, "@brief Removes the point at the beginning of the list") + - gsi::method_ext("pop_back", &f_QPolygon_pop_back, "@brief Removes the point at the end of the list") + - gsi::method_ext("push_front", &f_QPolygon_push_front, "@brief Inserts the point at the beginning of the list\n@args p") + - gsi::method_ext("push_back", &f_QPolygon_push_back, "@brief Inserts the point at the end of the list\n@args p") + - gsi::method_ext("reserve", &f_QPolygon_reserve, "@brief Reserve memory for the given number of points\n@args n") + - gsi::method_ext("resize", &f_QPolygon_resize, "@brief Sets the number of points to the given length\n@args l") + - gsi::method_ext("fill", &f_QPolygon_fill, "@brief Resizes the polygon to l points and ets all elements to the given point\n@args p,l") -DECL - -# enhance QPolygonF by some missing methods because we dropped the base class -add_native_impl("QPolygonF", <<'CODE', <<'DECL') - -#include "dbPolygon.h" - - static QPolygonF *ctor_QPolygonF_from_polygon (const db::DPolygon &pts) - { - QPolygonF *p = new QPolygonF (); - p->reserve (int (pts.hull ().size ())); - for (db::DPolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPointF ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygonF *ctor_QPolygonF_from_simple_polygon (const db::DSimplePolygon &pts) - { - QPolygonF *p = new QPolygonF (); - p->reserve (int (pts.hull ().size ())); - for (db::DSimplePolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPointF ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygonF::const_iterator f_QPolygonF_each_begin (const QPolygonF *m) - { - return m->begin (); - } - - static QPolygonF::const_iterator f_QPolygonF_each_end (const QPolygonF *m) - { - return m->end (); - } - - static QPointF f_QPolygonF_at (const QPolygonF *m, int i) - { - return m->at(i); - } - - static QPointF f_QPolygonF_front (const QPolygonF *m) - { - return m->front(); - } - - static QPointF f_QPolygonF_back (const QPolygonF *m) - { - return m->back(); - } - - static int f_QPolygonF_size (const QPolygonF *m) - { - return m->size(); - } - - static void f_QPolygonF_clear (QPolygonF *m) - { - return m->clear(); - } - - static void f_QPolygonF_remove (QPolygonF *m, int i) - { - return m->remove (i); - } - - static void f_QPolygonF_insert (QPolygonF *m, int i, const QPointF &p) - { - return m->insert (i, p); - } - - static void f_QPolygonF_replace (QPolygonF *m, int i, const QPointF &p) - { - return m->replace (i, p); - } - - static void f_QPolygonF_pop_front (QPolygonF *m) - { - return m->pop_front (); - } - - static void f_QPolygonF_pop_back (QPolygonF *m) - { - return m->pop_back (); - } - - static void f_QPolygonF_push_front (QPolygonF *m, const QPointF &p) - { - return m->push_front (p); - } - - static void f_QPolygonF_push_back (QPolygonF *m, const QPointF &p) - { - return m->push_back (p); - } - - static void f_QPolygonF_reserve (QPolygonF *m, int n) - { - return m->reserve (n); - } - - static void f_QPolygonF_resize (QPolygonF *m, int n) - { - return m->resize (n); - } - - static void f_QPolygonF_fill (QPolygonF *m, const QPointF &p, int n) - { - m->fill (p, n); - } -CODE - gsi::constructor("new", &ctor_QPolygonF_from_polygon, "@brief Creates a polygon from the given KLayout DPolygon\n@args p\nRemark: holes are not transferred into the QPolygonF.") + - gsi::constructor("new", &ctor_QPolygonF_from_simple_polygon, "@brief Creates a polygon from the given KLayout DSimplePolygon\n@args p") + - gsi::iterator_ext ("each", &f_QPolygonF_each_begin, &f_QPolygonF_each_end, "@brief Iterates over all points of the polygon.") + - gsi::method_ext("[]", &f_QPolygonF_at, "@brief Gets the point at the given position\n@args index") + - gsi::method_ext("front", &f_QPolygonF_front, "@brief Gets the first point") + - gsi::method_ext("back", &f_QPolygonF_back, "@brief Gets the last point") + - gsi::method_ext("size", &f_QPolygonF_size, "@brief Gets the number of points in the polygon") + - gsi::method_ext("clear", &f_QPolygonF_clear, "@brief Empties the polygon") + - gsi::method_ext("remove", &f_QPolygonF_remove, "@brief Removes the point at the given position\n@args index") + - gsi::method_ext("insert", &f_QPolygonF_insert, "@brief Inserts the point after the given position\n@args index, p") + - gsi::method_ext("replace", &f_QPolygonF_replace, "@brief Replaces the point at the given position\n@args index, p") + - gsi::method_ext("pop_front", &f_QPolygonF_pop_front, "@brief Removes the point at the beginning of the list") + - gsi::method_ext("pop_back", &f_QPolygonF_pop_back, "@brief Removes the point at the end of the list") + - gsi::method_ext("push_front", &f_QPolygonF_push_front, "@brief Inserts the point at the beginning of the list\n@args p") + - gsi::method_ext("push_back", &f_QPolygonF_push_back, "@brief Inserts the point at the end of the list\n@args p") + - gsi::method_ext("reserve", &f_QPolygonF_reserve, "@brief Reserve memory for the given number of points\n@args n") + - gsi::method_ext("resize", &f_QPolygonF_resize, "@brief Sets the number of points to the given length\n@args l") + - gsi::method_ext("fill", &f_QPolygonF_fill, "@brief Resizes the polygon to l points and ets all elements to the given point\n@args p,l") -DECL +# enhance QPolygon by some missing methods because we dropped the base class and +# support for db methods +add_native_impl_polygons # -------------------------------------------------------------- # QtGui diff --git a/scripts/mkqtdecl5/mkqtdecl.conf b/scripts/mkqtdecl5/mkqtdecl.conf index e043f0d9f..224b69d5f 100644 --- a/scripts/mkqtdecl5/mkqtdecl.conf +++ b/scripts/mkqtdecl5/mkqtdecl.conf @@ -1,48 +1,22 @@ +# +# Copyright (C) 2006-2018 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 +# -# -------------------------------------------------------------- -# Some definitions - -def add_native_qapp_ctor_impl(cls) - - qapplication_ctor_code = <<'CODE' - static %CLS% *ctor_%CLS%_Adaptor_args(const std::vector &args%ADDARGS%) - { - // %CLS% needs static sources, so we give it some. - static char **argv = 0; - static std::vector args_copy; - static int argc = 0; - - if (argv != 0) { - throw tl::Exception(tl::to_string(QObject::tr("%CLS% cannot be instantiated twice"))); - } - argv = new char *[args.size ()]; - args_copy = args; - argc = int (args.size ()); - for (std::vector::const_iterator a = args_copy.begin (); a != args_copy.end (); ++a) { - argv[a - args_copy.begin ()] = (char *) a->c_str (); - } - - return new %CLS%_Adaptor (argc, argv%ADDARGSCALL%); - } - - %CLS%_Adaptor (int &argc, char **argv%ADDARGS%) : %CLS% (argc, argv%ADDARGSCALL%) { } -CODE - - qapplication_ctor_decl = <<'DECL' - gsi::constructor("new", &%CLS%_Adaptor::ctor_%CLS%_Adaptor_args, gsi::arg ("argv")%ADDARGS%, "@brief Creates a new %CLS% object\n\n@param argv The command line arguments to pass to Qt%ADDDOC%") -DECL - - if cls == "QApplication" - add_native_impl(cls + "_Adaptor", - qapplication_ctor_code.gsub("%CLS%", cls).gsub("%ADDARGS%", ", bool gui").gsub("%ADDARGSCALL%", ", gui"), - qapplication_ctor_decl.gsub("%CLS%", cls).gsub("%ADDARGS%", ", gsi::arg (\"gui\", false)").gsub("%ADDDOC%", "\\n@param gui If true, a GUI-enabled application is constructed")) - else - add_native_impl(cls + "_Adaptor", - qapplication_ctor_code.gsub("%CLS%", cls).gsub("%ADDARGS%", "").gsub("%ADDARGSCALL%", ""), - qapplication_ctor_decl.gsub("%CLS%", cls).gsub("%ADDARGS%", "").gsub("%ADDDOC%", "")) - end - -end +load(File.join(File.dirname(__FILE__), "common.conf")) # -------------------------------------------------------------- # all modules @@ -395,49 +369,17 @@ rename "QProcess", /QProcess::finished\(int[\s\w]*\)/, "finished_int" # disambig drop_method "QCoreApplication", /QCoreApplication::QCoreApplication/ add_native_qapp_ctor_impl("QCoreApplication") -# alternative implementation for QObject::findChild using QObject for T -add_native_impl("QObject", <<'CODE', <<'DECL') - QObject *find_child_impl (QObject *object, const QString &name) { return object->findChild (name); } -CODE - gsi::method_ext("findChild", &find_child_impl, "@brief Specialisation for findChild (uses QObject as T).") -DECL +# alternative implementation for QObject::findChild +add_native_impl_QObject_findChild # alternative implementation for QFont::Light, QFont::Bold, QFont::Normal, QFont::DemiBold, QFont::Black -add_native_impl("QFont", <<'CODE', <<'DECL') - static unsigned int font_const_light () { return (unsigned int) QFont::Light; } - static unsigned int font_const_normal () { return (unsigned int) QFont::Normal; } - static unsigned int font_const_demibold () { return (unsigned int) QFont::DemiBold; } - static unsigned int font_const_bold () { return (unsigned int) QFont::Bold; } - static unsigned int font_const_black () { return (unsigned int) QFont::Black; } -CODE - gsi::method("Light", &font_const_light, "@brief Font weight constant 'QFont::Light'.") + - gsi::method("Normal", &font_const_normal, "@brief Font weight constant 'QFont::Normal'.") + - gsi::method("DemiBold", &font_const_demibold, "@brief Font weight constant 'QFont::DemiBold'.") + - gsi::method("Bold", &font_const_bold, "@brief Font weight constant 'QFont::Bold'.") + - gsi::method("Black", &font_const_black, "@brief Font weight constant 'QFont::Black'.") -DECL +add_native_impl_QFont # alternative implementation for QRegion::setRects -add_native_impl("QRegion", <<'CODE', <<'DECL') - static void f_QRegion_setRects(QRegion *r, const std::vector &rects) - { - if (! rects.empty ()) { - return r->setRects (&rects.front (), int (rects.size ())); - } - } -CODE - gsi::method_ext("setRects", &f_QRegion_setRects, "@brief Adaption of setRects without pointer.") -DECL +add_native_impl_QRegion # alternative implementation for QPersistentQModelIndex::operator const QModelIndex & -add_native_impl("QPersistentModelIndex", <<'CODE', <<'DECL') - static const QModelIndex &castToQModelIndex(const QPersistentModelIndex *m) - { - return m->operator const QModelIndex &(); - } -CODE - gsi::method_ext("castToQModelIndex", &castToQModelIndex, "@brief Binding for \"operator const QModelIndex &\".") -DECL +add_native_impl_QPersistentQModelIndex # satisfy abstract methods for WIN32 add_native_impl("QAbstractEventDispatcher_Adaptor", <<'CODE', nil) @@ -448,419 +390,7 @@ add_native_impl("QAbstractEventDispatcher_Adaptor", <<'CODE', nil) CODE # implementation of operator<< and operator>> for QDataStream -add_native_impl("QDataStream", <<'CODE', <<'DECL') - static qint8 f_QDataStream_read_qint8(QDataStream *s) - { - qint8 v = 0; - *s >> v; - return v; - } - - static quint8 f_QDataStream_read_quint8(QDataStream *s) - { - quint8 v = 0; - *s >> v; - return v; - } - - static qint16 f_QDataStream_read_qint16(QDataStream *s) - { - qint16 v = 0; - *s >> v; - return v; - } - - static quint16 f_QDataStream_read_quint16(QDataStream *s) - { - quint16 v = 0; - *s >> v; - return v; - } - - static qint32 f_QDataStream_read_qint32(QDataStream *s) - { - qint32 v = 0; - *s >> v; - return v; - } - - static quint32 f_QDataStream_read_quint32(QDataStream *s) - { - quint32 v = 0; - *s >> v; - return v; - } - - static quint64 f_QDataStream_read_quint64(QDataStream *s) - { - quint64 v = 0; - *s >> v; - return v; - } - - static qint64 f_QDataStream_read_qint64(QDataStream *s) - { - qint64 v = 0; - *s >> v; - return v; - } - - static double f_QDataStream_read_double(QDataStream *s) - { - double v = 0; - *s >> v; - return v; - } - - static float f_QDataStream_read_float(QDataStream *s) - { - float v = 0; - *s >> v; - return v; - } - - static bool f_QDataStream_read_bool(QDataStream *s) - { - bool v = 0; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QDataStream_read_qchar(QDataStream *s) - { - QChar v = 0; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static qt_gsi::Converter >::target_type f_QDataStream_read_int_list(QDataStream *s) - { - QList v; - *s >> v; - return qt_gsi::Converter >::toc (v); - } - - static qt_gsi::Converter >::target_type f_QDataStream_read_int_vector(QDataStream *s) - { - QVector v; - *s >> v; - return qt_gsi::Converter >::toc (v); - } - - static QString f_QDataStream_read_string(QDataStream *s) - { - QString v; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QDataStream_read_bytearray(QDataStream *s) - { - QByteArray v; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static QDataStream *f_QDataStream_put_qint8(QDataStream *s, qint8 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint8(QDataStream *s, quint8 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qint16(QDataStream *s, qint16 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint16(QDataStream *s, quint16 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qint32(QDataStream *s, qint32 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint32(QDataStream *s, quint32 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qint64(QDataStream *s, qint64 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_quint64(QDataStream *s, quint64 v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_float(QDataStream *s, float v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_double(QDataStream *s, double v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_bool(QDataStream *s, bool v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_qchar(QDataStream *s, const qt_gsi::Converter::target_type &v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - - static QDataStream *f_QDataStream_put_int_list(QDataStream *s, const qt_gsi::Converter >::target_type &v) - { - *s << qt_gsi::Converter >::toq (v); - return s; - } - - static QDataStream *f_QDataStream_put_int_vector(QDataStream *s, const qt_gsi::Converter >::target_type &v) - { - *s << qt_gsi::Converter >::toq (v); - return s; - } - - static QDataStream *f_QDataStream_put_string(QDataStream *s, const QString &v) - { - *s << v; - return s; - } - - static QDataStream *f_QDataStream_put_bytearray(QDataStream *s, const qt_gsi::Converter::target_type &v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - -CODE - gsi::method_ext("read_i8", &f_QDataStream_read_qint8, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui8", &f_QDataStream_read_quint8, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i16", &f_QDataStream_read_qint16, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui16", &f_QDataStream_read_quint16, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i32", &f_QDataStream_read_qint32, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui32", &f_QDataStream_read_quint32, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i64", &f_QDataStream_read_qint64, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui64", &f_QDataStream_read_quint64, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_d", &f_QDataStream_read_double, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_f", &f_QDataStream_read_float, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_b", &f_QDataStream_read_bool, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_qc", &f_QDataStream_read_qchar, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_il", &f_QDataStream_read_int_list, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_iv", &f_QDataStream_read_int_vector, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_s", &f_QDataStream_read_string, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ba", &f_QDataStream_read_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("put_i8", &f_QDataStream_put_qint8, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui8", &f_QDataStream_put_quint8, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i16", &f_QDataStream_put_qint16, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui16", &f_QDataStream_put_quint16, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i32", &f_QDataStream_put_qint32, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui32", &f_QDataStream_put_quint32, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i64", &f_QDataStream_put_qint64, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui64", &f_QDataStream_put_quint64, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_d", &f_QDataStream_put_double, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_f", &f_QDataStream_put_float, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_b", &f_QDataStream_put_bool, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_qc", &f_QDataStream_put_qchar, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_il", &f_QDataStream_put_int_list, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_iv", &f_QDataStream_put_int_vector, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_s", &f_QDataStream_put_string, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ba", &f_QDataStream_put_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator<<") -DECL - -# implementation of operator<< and operator>> for QTextStream -add_native_impl("QTextStream", <<'CODE', <<'DECL') - static short f_QTextStream_read_s(QTextStream *s) - { - short v = 0; - *s >> v; - return v; - } - - static unsigned short f_QTextStream_read_us(QTextStream *s) - { - unsigned short v = 0; - *s >> v; - return v; - } - - static int f_QTextStream_read_i(QTextStream *s) - { - int v = 0; - *s >> v; - return v; - } - - static unsigned int f_QTextStream_read_ui(QTextStream *s) - { - unsigned int v = 0; - *s >> v; - return v; - } - - static qulonglong f_QTextStream_read_ull(QTextStream *s) - { - qulonglong v = 0; - *s >> v; - return v; - } - - static qlonglong f_QTextStream_read_ll(QTextStream *s) - { - qlonglong v = 0; - *s >> v; - return v; - } - - static double f_QTextStream_read_double(QTextStream *s) - { - double v = 0; - *s >> v; - return v; - } - - static float f_QTextStream_read_float(QTextStream *s) - { - float v = 0; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QTextStream_read_qchar(QTextStream *s) - { - QChar v = 0; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static QString f_QTextStream_read_string(QTextStream *s) - { - QString v; - *s >> v; - return v; - } - - static qt_gsi::Converter::target_type f_QTextStream_read_bytearray(QTextStream *s) - { - QByteArray v; - *s >> v; - return qt_gsi::Converter::toc (v); - } - - static QTextStream *f_QTextStream_put_s(QTextStream *s, short v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_us(QTextStream *s, unsigned short v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_i(QTextStream *s, int v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_ui(QTextStream *s, unsigned int v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_ll(QTextStream *s, qlonglong v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_ull(QTextStream *s, qulonglong v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_float(QTextStream *s, float v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_double(QTextStream *s, double v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_qchar(QTextStream *s, const qt_gsi::Converter::target_type v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - - static QTextStream *f_QTextStream_put_string(QTextStream *s, const QString &v) - { - *s << v; - return s; - } - - static QTextStream *f_QTextStream_put_bytearray(QTextStream *s, const qt_gsi::Converter::target_type &v) - { - *s << qt_gsi::Converter::toq (v); - return s; - } - -CODE - gsi::method_ext("read_s", &f_QTextStream_read_s, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_us", &f_QTextStream_read_us, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_i", &f_QTextStream_read_i, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ui", &f_QTextStream_read_ui, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ull", &f_QTextStream_read_ull, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ll", &f_QTextStream_read_ll, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_d", &f_QTextStream_read_double, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_f", &f_QTextStream_read_float, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_qc", &f_QTextStream_read_qchar, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_s", &f_QTextStream_read_string, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("read_ba", &f_QTextStream_read_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator>>") + - gsi::method_ext("put_s", &f_QTextStream_put_s, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_us", &f_QTextStream_put_us, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_i", &f_QTextStream_put_i, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ui", &f_QTextStream_put_ui, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ull", &f_QTextStream_put_ull, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ll", &f_QTextStream_put_ll, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_d", &f_QTextStream_put_double, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_f", &f_QTextStream_put_float, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_qc", &f_QTextStream_put_qchar, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_s", &f_QTextStream_put_string, "@brief Non-ambiguous adaptation of the corresponding operator<<") + - gsi::method_ext("put_ba", &f_QTextStream_put_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator<<") -DECL +add_native_impl_streams final_class "QIODevice" # because readData cannot be reimplemented final_class "QBuffer" # because readData cannot be reimplemented @@ -874,265 +404,9 @@ drop_method "QPolygon", /QPolygon::QPolygon\(.*const\s+int\s+\*/ # requires cons no_imports "QPolygon" # base class is a template. Base methods are implemented specifically. no_imports "QPolygonF" # base class is a template. Base methods are implemented specifically. -# enhance QPolygon by some missing methods because we dropped the base class -add_native_impl("QPolygon", <<'CODE', <<'DECL') - -#include "dbPolygon.h" - - static QPolygon *ctor_QPolygon_from_polygon (const db::Polygon &pts) - { - QPolygon *p = new QPolygon (); - p->reserve (int (pts.hull ().size ())); - for (db::Polygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPoint ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygon *ctor_QPolygon_from_simple_polygon (const db::SimplePolygon &pts) - { - QPolygon *p = new QPolygon (); - p->reserve (int (pts.hull ().size ())); - for (db::SimplePolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPoint ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygon::const_iterator f_QPolygon_each_begin (const QPolygon *m) - { - return m->begin (); - } - - static QPolygon::const_iterator f_QPolygon_each_end (const QPolygon *m) - { - return m->end (); - } - - static QPoint f_QPolygon_at (const QPolygon *m, int i) - { - return m->at(i); - } - - static QPoint f_QPolygon_front (const QPolygon *m) - { - return m->front(); - } - - static QPoint f_QPolygon_back (const QPolygon *m) - { - return m->back(); - } - - static int f_QPolygon_size (const QPolygon *m) - { - return m->size(); - } - - static void f_QPolygon_clear (QPolygon *m) - { - return m->clear(); - } - - static void f_QPolygon_remove (QPolygon *m, int i) - { - return m->remove (i); - } - - static void f_QPolygon_insert (QPolygon *m, int i, const QPoint &p) - { - return m->insert (i, p); - } - - static void f_QPolygon_replace (QPolygon *m, int i, const QPoint &p) - { - return m->replace (i, p); - } - - static void f_QPolygon_pop_front (QPolygon *m) - { - return m->pop_front (); - } - - static void f_QPolygon_pop_back (QPolygon *m) - { - return m->pop_back (); - } - - static void f_QPolygon_push_front (QPolygon *m, const QPoint &p) - { - return m->push_front (p); - } - - static void f_QPolygon_push_back (QPolygon *m, const QPoint &p) - { - return m->push_back (p); - } - - static void f_QPolygon_reserve (QPolygon *m, int n) - { - return m->reserve (n); - } - - static void f_QPolygon_resize (QPolygon *m, int n) - { - return m->resize (n); - } - - static void f_QPolygon_fill (QPolygon *m, const QPoint &p, int n) - { - m->fill (p, n); - } -CODE - gsi::constructor("new", &ctor_QPolygon_from_polygon, "@brief Creates a polygon from the given KLayout Polygon\n@args p\nRemark: holes are not transferred into the QPolygon.") + - gsi::constructor("new", &ctor_QPolygon_from_simple_polygon, "@brief Creates a polygon from the given KLayout SimplePolygon\n@args p") + - gsi::iterator_ext ("each", &f_QPolygon_each_begin, &f_QPolygon_each_end, "@brief Iterates over all points of the polygon.") + - gsi::method_ext("[]", &f_QPolygon_at, "@brief Gets the point at the given position\n@args index") + - gsi::method_ext("front", &f_QPolygon_front, "@brief Gets the first point") + - gsi::method_ext("back", &f_QPolygon_back, "@brief Gets the last point") + - gsi::method_ext("size", &f_QPolygon_size, "@brief Gets the number of points in the polygon") + - gsi::method_ext("clear", &f_QPolygon_clear, "@brief Empties the polygon") + - gsi::method_ext("remove", &f_QPolygon_remove, "@brief Removes the point at the given position\n@args index") + - gsi::method_ext("insert", &f_QPolygon_insert, "@brief Inserts the point after the given position\n@args index, p") + - gsi::method_ext("replace", &f_QPolygon_replace, "@brief Replaces the point at the given position\n@args index, p") + - gsi::method_ext("pop_front", &f_QPolygon_pop_front, "@brief Removes the point at the beginning of the list") + - gsi::method_ext("pop_back", &f_QPolygon_pop_back, "@brief Removes the point at the end of the list") + - gsi::method_ext("push_front", &f_QPolygon_push_front, "@brief Inserts the point at the beginning of the list\n@args p") + - gsi::method_ext("push_back", &f_QPolygon_push_back, "@brief Inserts the point at the end of the list\n@args p") + - gsi::method_ext("reserve", &f_QPolygon_reserve, "@brief Reserve memory for the given number of points\n@args n") + - gsi::method_ext("resize", &f_QPolygon_resize, "@brief Sets the number of points to the given length\n@args l") + - gsi::method_ext("fill", &f_QPolygon_fill, "@brief Resizes the polygon to l points and ets all elements to the given point\n@args p,l") -DECL - -# enhance QPolygonF by some missing methods because we dropped the base class -add_native_impl("QPolygonF", <<'CODE', <<'DECL') - -#include "dbPolygon.h" - - static QPolygonF *ctor_QPolygonF_from_polygon (const db::DPolygon &pts) - { - QPolygonF *p = new QPolygonF (); - p->reserve (int (pts.hull ().size ())); - for (db::DPolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPointF ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygonF *ctor_QPolygonF_from_simple_polygon (const db::DSimplePolygon &pts) - { - QPolygonF *p = new QPolygonF (); - p->reserve (int (pts.hull ().size ())); - for (db::DSimplePolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { - p->push_back (QPointF ((*q).x (), (*q).y ())); - } - return p; - } - - static QPolygonF::const_iterator f_QPolygonF_each_begin (const QPolygonF *m) - { - return m->begin (); - } - - static QPolygonF::const_iterator f_QPolygonF_each_end (const QPolygonF *m) - { - return m->end (); - } - - static QPointF f_QPolygonF_at (const QPolygonF *m, int i) - { - return m->at(i); - } - - static QPointF f_QPolygonF_front (const QPolygonF *m) - { - return m->front(); - } - - static QPointF f_QPolygonF_back (const QPolygonF *m) - { - return m->back(); - } - - static int f_QPolygonF_size (const QPolygonF *m) - { - return m->size(); - } - - static void f_QPolygonF_clear (QPolygonF *m) - { - return m->clear(); - } - - static void f_QPolygonF_remove (QPolygonF *m, int i) - { - return m->remove (i); - } - - static void f_QPolygonF_insert (QPolygonF *m, int i, const QPointF &p) - { - return m->insert (i, p); - } - - static void f_QPolygonF_replace (QPolygonF *m, int i, const QPointF &p) - { - return m->replace (i, p); - } - - static void f_QPolygonF_pop_front (QPolygonF *m) - { - return m->pop_front (); - } - - static void f_QPolygonF_pop_back (QPolygonF *m) - { - return m->pop_back (); - } - - static void f_QPolygonF_push_front (QPolygonF *m, const QPointF &p) - { - return m->push_front (p); - } - - static void f_QPolygonF_push_back (QPolygonF *m, const QPointF &p) - { - return m->push_back (p); - } - - static void f_QPolygonF_reserve (QPolygonF *m, int n) - { - return m->reserve (n); - } - - static void f_QPolygonF_resize (QPolygonF *m, int n) - { - return m->resize (n); - } - - static void f_QPolygonF_fill (QPolygonF *m, const QPointF &p, int n) - { - m->fill (p, n); - } -CODE - gsi::constructor("new", &ctor_QPolygonF_from_polygon, "@brief Creates a polygon from the given KLayout DPolygon\n@args p\nRemark: holes are not transferred into the QPolygonF.") + - gsi::constructor("new", &ctor_QPolygonF_from_simple_polygon, "@brief Creates a polygon from the given KLayout DSimplePolygon\n@args p") + - gsi::iterator_ext ("each", &f_QPolygonF_each_begin, &f_QPolygonF_each_end, "@brief Iterates over all points of the polygon.") + - gsi::method_ext("[]", &f_QPolygonF_at, "@brief Gets the point at the given position\n@args index") + - gsi::method_ext("front", &f_QPolygonF_front, "@brief Gets the first point") + - gsi::method_ext("back", &f_QPolygonF_back, "@brief Gets the last point") + - gsi::method_ext("size", &f_QPolygonF_size, "@brief Gets the number of points in the polygon") + - gsi::method_ext("clear", &f_QPolygonF_clear, "@brief Empties the polygon") + - gsi::method_ext("remove", &f_QPolygonF_remove, "@brief Removes the point at the given position\n@args index") + - gsi::method_ext("insert", &f_QPolygonF_insert, "@brief Inserts the point after the given position\n@args index, p") + - gsi::method_ext("replace", &f_QPolygonF_replace, "@brief Replaces the point at the given position\n@args index, p") + - gsi::method_ext("pop_front", &f_QPolygonF_pop_front, "@brief Removes the point at the beginning of the list") + - gsi::method_ext("pop_back", &f_QPolygonF_pop_back, "@brief Removes the point at the end of the list") + - gsi::method_ext("push_front", &f_QPolygonF_push_front, "@brief Inserts the point at the beginning of the list\n@args p") + - gsi::method_ext("push_back", &f_QPolygonF_push_back, "@brief Inserts the point at the end of the list\n@args p") + - gsi::method_ext("reserve", &f_QPolygonF_reserve, "@brief Reserve memory for the given number of points\n@args n") + - gsi::method_ext("resize", &f_QPolygonF_resize, "@brief Sets the number of points to the given length\n@args l") + - gsi::method_ext("fill", &f_QPolygonF_fill, "@brief Resizes the polygon to l points and ets all elements to the given point\n@args p,l") -DECL +# enhance QPolygon by some missing methods because we dropped the base class and +# support for db methods +add_native_impl_polygons no_copy_ctor "QBasicMutex" no_copy_ctor "QMapDataBase" diff --git a/scripts/mkqtdecl_common/common.conf b/scripts/mkqtdecl_common/common.conf new file mode 100644 index 000000000..0be94c9e9 --- /dev/null +++ b/scripts/mkqtdecl_common/common.conf @@ -0,0 +1,824 @@ +# +# Copyright (C) 2006-2018 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 +# + +# -------------------------------------------------------------- +# Provides the definitions of QCoreApplication, QApplication and QGuiApplication + +def add_native_qapp_ctor_impl(cls) + + qapplication_ctor_code = <<'CODE' + static %CLS% *ctor_%CLS%_Adaptor_args(const std::vector &args%ADDARGS%) + { + // %CLS% needs static sources, so we give it some. + static char **argv = 0; + static std::vector args_copy; + static int argc = 0; + + if (argv != 0) { + throw tl::Exception(tl::to_string(QObject::tr("%CLS% cannot be instantiated twice"))); + } + argv = new char *[args.size ()]; + args_copy = args; + argc = int (args.size ()); + for (std::vector::const_iterator a = args_copy.begin (); a != args_copy.end (); ++a) { + argv[a - args_copy.begin ()] = (char *) a->c_str (); + } + + return new %CLS%_Adaptor (argc, argv%ADDARGSCALL%); + } + + %CLS%_Adaptor (int &argc, char **argv%ADDARGS%) : %CLS% (argc, argv%ADDARGSCALL%) { } +CODE + + qapplication_ctor_decl = <<'DECL' + gsi::constructor("new", &%CLS%_Adaptor::ctor_%CLS%_Adaptor_args, gsi::arg ("argv")%ADDARGS%, "@brief Creates a new %CLS% object\n\n@param argv The command line arguments to pass to Qt%ADDDOC%") +DECL + + if cls == "QApplication" + add_native_impl(cls + "_Adaptor", + qapplication_ctor_code.gsub("%CLS%", cls).gsub("%ADDARGS%", ", bool gui").gsub("%ADDARGSCALL%", ", gui"), + qapplication_ctor_decl.gsub("%CLS%", cls).gsub("%ADDARGS%", ", gsi::arg (\"gui\", true)").gsub("%ADDDOC%", "\\n@param gui If true, a GUI-enabled application is constructed")) + else + add_native_impl(cls + "_Adaptor", + qapplication_ctor_code.gsub("%CLS%", cls).gsub("%ADDARGS%", "").gsub("%ADDARGSCALL%", ""), + qapplication_ctor_decl.gsub("%CLS%", cls).gsub("%ADDARGS%", "").gsub("%ADDDOC%", "")) + end + +end + +# -------------------------------------------------------------- +# Provides the definitions for QObject::findChild + +def add_native_impl_QObject_findChild() + + # alternative implementation for QObject::findChild using QObject for T + add_native_impl("QObject", <<'CODE', <<'DECL') + QObject *find_child_impl (QObject *object, const QString &name) { return object->findChild (name); } +CODE + gsi::method_ext("findChild", &find_child_impl, "@brief Specialisation for findChild (uses QObject as T).") +DECL + +end + +# -------------------------------------------------------------- +# Alternative implementation for QFont::Light, QFont::Bold, QFont::Normal, QFont::DemiBold, QFont::Black + +def add_native_impl_QFont + + add_native_impl("QFont", <<'CODE', <<'DECL') + static unsigned int font_const_light () { return (unsigned int) QFont::Light; } + static unsigned int font_const_normal () { return (unsigned int) QFont::Normal; } + static unsigned int font_const_demibold () { return (unsigned int) QFont::DemiBold; } + static unsigned int font_const_bold () { return (unsigned int) QFont::Bold; } + static unsigned int font_const_black () { return (unsigned int) QFont::Black; } +CODE + gsi::method("Light", &font_const_light, "@brief Font weight constant 'QFont::Light'.") + + gsi::method("Normal", &font_const_normal, "@brief Font weight constant 'QFont::Normal'.") + + gsi::method("DemiBold", &font_const_demibold, "@brief Font weight constant 'QFont::DemiBold'.") + + gsi::method("Bold", &font_const_bold, "@brief Font weight constant 'QFont::Bold'.") + + gsi::method("Black", &font_const_black, "@brief Font weight constant 'QFont::Black'.") +DECL + +end + +# -------------------------------------------------------------- +# Alternative implementation for QRegion + +def add_native_impl_QRegion + + # alternative implementation for QRegion::setRects + add_native_impl("QRegion", <<'CODE', <<'DECL') + static void f_QRegion_setRects(QRegion *r, const std::vector &rects) + { + if (! rects.empty ()) { + return r->setRects (&rects.front (), int (rects.size ())); + } + } +CODE + gsi::method_ext("setRects", &f_QRegion_setRects, "@brief Adaption of setRects without pointer.") +DECL + +end + +# -------------------------------------------------------------- +# Alternative implementation for QPersistentQModelIndex + +def add_native_impl_QPersistentQModelIndex + + # alternative implementation for QPersistentQModelIndex::operator const QModelIndex & + add_native_impl("QPersistentModelIndex", <<'CODE', <<'DECL') + static const QModelIndex &castToQModelIndex(const QPersistentModelIndex *m) + { + return m->operator const QModelIndex &(); + } +CODE + gsi::method_ext("castToQModelIndex", &castToQModelIndex, "@brief Binding for \"operator const QModelIndex &\".") +DECL + +end + +# -------------------------------------------------------------- +# implementation of operator<< and operator>> for QDataStream + +def add_native_impl_streams + + add_native_impl("QDataStream", <<'CODE', <<'DECL') + static qint8 f_QDataStream_read_qint8(QDataStream *s) + { + qint8 v = 0; + *s >> v; + return v; + } + + static quint8 f_QDataStream_read_quint8(QDataStream *s) + { + quint8 v = 0; + *s >> v; + return v; + } + + static qint16 f_QDataStream_read_qint16(QDataStream *s) + { + qint16 v = 0; + *s >> v; + return v; + } + + static quint16 f_QDataStream_read_quint16(QDataStream *s) + { + quint16 v = 0; + *s >> v; + return v; + } + + static qint32 f_QDataStream_read_qint32(QDataStream *s) + { + qint32 v = 0; + *s >> v; + return v; + } + + static quint32 f_QDataStream_read_quint32(QDataStream *s) + { + quint32 v = 0; + *s >> v; + return v; + } + + static quint64 f_QDataStream_read_quint64(QDataStream *s) + { + quint64 v = 0; + *s >> v; + return v; + } + + static qint64 f_QDataStream_read_qint64(QDataStream *s) + { + qint64 v = 0; + *s >> v; + return v; + } + + static double f_QDataStream_read_double(QDataStream *s) + { + double v = 0; + *s >> v; + return v; + } + + static float f_QDataStream_read_float(QDataStream *s) + { + float v = 0; + *s >> v; + return v; + } + + static bool f_QDataStream_read_bool(QDataStream *s) + { + bool v = 0; + *s >> v; + return v; + } + + static qt_gsi::Converter::target_type f_QDataStream_read_qchar(QDataStream *s) + { + QChar v = 0; + *s >> v; + return qt_gsi::Converter::toc (v); + } + + static qt_gsi::Converter >::target_type f_QDataStream_read_int_list(QDataStream *s) + { + QList v; + *s >> v; + return qt_gsi::Converter >::toc (v); + } + + static qt_gsi::Converter >::target_type f_QDataStream_read_int_vector(QDataStream *s) + { + QVector v; + *s >> v; + return qt_gsi::Converter >::toc (v); + } + + static QString f_QDataStream_read_string(QDataStream *s) + { + QString v; + *s >> v; + return v; + } + + static qt_gsi::Converter::target_type f_QDataStream_read_bytearray(QDataStream *s) + { + QByteArray v; + *s >> v; + return qt_gsi::Converter::toc (v); + } + + static QDataStream *f_QDataStream_put_qint8(QDataStream *s, qint8 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_quint8(QDataStream *s, quint8 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_qint16(QDataStream *s, qint16 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_quint16(QDataStream *s, quint16 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_qint32(QDataStream *s, qint32 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_quint32(QDataStream *s, quint32 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_qint64(QDataStream *s, qint64 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_quint64(QDataStream *s, quint64 v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_float(QDataStream *s, float v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_double(QDataStream *s, double v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_bool(QDataStream *s, bool v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_qchar(QDataStream *s, const qt_gsi::Converter::target_type &v) + { + *s << qt_gsi::Converter::toq (v); + return s; + } + + static QDataStream *f_QDataStream_put_int_list(QDataStream *s, const qt_gsi::Converter >::target_type &v) + { + *s << qt_gsi::Converter >::toq (v); + return s; + } + + static QDataStream *f_QDataStream_put_int_vector(QDataStream *s, const qt_gsi::Converter >::target_type &v) + { + *s << qt_gsi::Converter >::toq (v); + return s; + } + + static QDataStream *f_QDataStream_put_string(QDataStream *s, const QString &v) + { + *s << v; + return s; + } + + static QDataStream *f_QDataStream_put_bytearray(QDataStream *s, const qt_gsi::Converter::target_type &v) + { + *s << qt_gsi::Converter::toq (v); + return s; + } + +CODE + gsi::method_ext("read_i8", &f_QDataStream_read_qint8, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ui8", &f_QDataStream_read_quint8, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_i16", &f_QDataStream_read_qint16, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ui16", &f_QDataStream_read_quint16, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_i32", &f_QDataStream_read_qint32, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ui32", &f_QDataStream_read_quint32, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_i64", &f_QDataStream_read_qint64, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ui64", &f_QDataStream_read_quint64, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_d", &f_QDataStream_read_double, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_f", &f_QDataStream_read_float, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_b", &f_QDataStream_read_bool, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_qc", &f_QDataStream_read_qchar, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_il", &f_QDataStream_read_int_list, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_iv", &f_QDataStream_read_int_vector, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_s", &f_QDataStream_read_string, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ba", &f_QDataStream_read_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("put_i8", &f_QDataStream_put_qint8, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ui8", &f_QDataStream_put_quint8, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_i16", &f_QDataStream_put_qint16, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ui16", &f_QDataStream_put_quint16, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_i32", &f_QDataStream_put_qint32, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ui32", &f_QDataStream_put_quint32, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_i64", &f_QDataStream_put_qint64, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ui64", &f_QDataStream_put_quint64, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_d", &f_QDataStream_put_double, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_f", &f_QDataStream_put_float, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_b", &f_QDataStream_put_bool, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_qc", &f_QDataStream_put_qchar, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_il", &f_QDataStream_put_int_list, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_iv", &f_QDataStream_put_int_vector, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_s", &f_QDataStream_put_string, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ba", &f_QDataStream_put_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator<<") +DECL + +# implementation of operator<< and operator>> for QTextStream +add_native_impl("QTextStream", <<'CODE', <<'DECL') + static short f_QTextStream_read_s(QTextStream *s) + { + short v = 0; + *s >> v; + return v; + } + + static unsigned short f_QTextStream_read_us(QTextStream *s) + { + unsigned short v = 0; + *s >> v; + return v; + } + + static int f_QTextStream_read_i(QTextStream *s) + { + int v = 0; + *s >> v; + return v; + } + + static unsigned int f_QTextStream_read_ui(QTextStream *s) + { + unsigned int v = 0; + *s >> v; + return v; + } + + static qulonglong f_QTextStream_read_ull(QTextStream *s) + { + qulonglong v = 0; + *s >> v; + return v; + } + + static qlonglong f_QTextStream_read_ll(QTextStream *s) + { + qlonglong v = 0; + *s >> v; + return v; + } + + static double f_QTextStream_read_double(QTextStream *s) + { + double v = 0; + *s >> v; + return v; + } + + static float f_QTextStream_read_float(QTextStream *s) + { + float v = 0; + *s >> v; + return v; + } + + static qt_gsi::Converter::target_type f_QTextStream_read_qchar(QTextStream *s) + { + QChar v = 0; + *s >> v; + return qt_gsi::Converter::toc (v); + } + + static QString f_QTextStream_read_string(QTextStream *s) + { + QString v; + *s >> v; + return v; + } + + static qt_gsi::Converter::target_type f_QTextStream_read_bytearray(QTextStream *s) + { + QByteArray v; + *s >> v; + return qt_gsi::Converter::toc (v); + } + + static QTextStream *f_QTextStream_put_s(QTextStream *s, short v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_us(QTextStream *s, unsigned short v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_i(QTextStream *s, int v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_ui(QTextStream *s, unsigned int v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_ll(QTextStream *s, qlonglong v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_ull(QTextStream *s, qulonglong v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_float(QTextStream *s, float v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_double(QTextStream *s, double v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_qchar(QTextStream *s, const qt_gsi::Converter::target_type v) + { + *s << qt_gsi::Converter::toq (v); + return s; + } + + static QTextStream *f_QTextStream_put_string(QTextStream *s, const QString &v) + { + *s << v; + return s; + } + + static QTextStream *f_QTextStream_put_bytearray(QTextStream *s, const qt_gsi::Converter::target_type &v) + { + *s << qt_gsi::Converter::toq (v); + return s; + } + +CODE + gsi::method_ext("read_s", &f_QTextStream_read_s, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_us", &f_QTextStream_read_us, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_i", &f_QTextStream_read_i, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ui", &f_QTextStream_read_ui, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ull", &f_QTextStream_read_ull, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ll", &f_QTextStream_read_ll, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_d", &f_QTextStream_read_double, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_f", &f_QTextStream_read_float, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_qc", &f_QTextStream_read_qchar, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_s", &f_QTextStream_read_string, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("read_ba", &f_QTextStream_read_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator>>") + + gsi::method_ext("put_s", &f_QTextStream_put_s, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_us", &f_QTextStream_put_us, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_i", &f_QTextStream_put_i, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ui", &f_QTextStream_put_ui, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ull", &f_QTextStream_put_ull, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ll", &f_QTextStream_put_ll, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_d", &f_QTextStream_put_double, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_f", &f_QTextStream_put_float, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_qc", &f_QTextStream_put_qchar, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_s", &f_QTextStream_put_string, "@brief Non-ambiguous adaptation of the corresponding operator<<") + + gsi::method_ext("put_ba", &f_QTextStream_put_bytearray, "@brief Non-ambiguous adaptation of the corresponding operator<<") +DECL + +end + +# -------------------------------------------------------------- +# enhance QPolygon by some missing methods because we dropped the base class and +# support for db methods + +# enhance QPolygon by some missing methods because we dropped the base class +def add_native_impl_polygons + + # enhance QPolygon by some missing methods because we dropped the base class + add_native_impl("QPolygon", <<'CODE', <<'DECL') + +#include "dbPolygon.h" + + static QPolygon *ctor_QPolygon_from_polygon (const db::Polygon &pts) + { + QPolygon *p = new QPolygon (); + p->reserve (int (pts.hull ().size ())); + for (db::Polygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { + p->push_back (QPoint ((*q).x (), (*q).y ())); + } + return p; + } + + static QPolygon *ctor_QPolygon_from_simple_polygon (const db::SimplePolygon &pts) + { + QPolygon *p = new QPolygon (); + p->reserve (int (pts.hull ().size ())); + for (db::SimplePolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { + p->push_back (QPoint ((*q).x (), (*q).y ())); + } + return p; + } + + static QPolygon::const_iterator f_QPolygon_each_begin (const QPolygon *m) + { + return m->begin (); + } + + static QPolygon::const_iterator f_QPolygon_each_end (const QPolygon *m) + { + return m->end (); + } + + static QPoint f_QPolygon_at (const QPolygon *m, int i) + { + return m->at(i); + } + + static QPoint f_QPolygon_front (const QPolygon *m) + { + return m->front(); + } + + static QPoint f_QPolygon_back (const QPolygon *m) + { + return m->back(); + } + + static int f_QPolygon_size (const QPolygon *m) + { + return m->size(); + } + + static void f_QPolygon_clear (QPolygon *m) + { + return m->clear(); + } + + static void f_QPolygon_remove (QPolygon *m, int i) + { + return m->remove (i); + } + + static void f_QPolygon_insert (QPolygon *m, int i, const QPoint &p) + { + return m->insert (i, p); + } + + static void f_QPolygon_replace (QPolygon *m, int i, const QPoint &p) + { + return m->replace (i, p); + } + + static void f_QPolygon_pop_front (QPolygon *m) + { + return m->pop_front (); + } + + static void f_QPolygon_pop_back (QPolygon *m) + { + return m->pop_back (); + } + + static void f_QPolygon_push_front (QPolygon *m, const QPoint &p) + { + return m->push_front (p); + } + + static void f_QPolygon_push_back (QPolygon *m, const QPoint &p) + { + return m->push_back (p); + } + + static void f_QPolygon_reserve (QPolygon *m, int n) + { + return m->reserve (n); + } + + static void f_QPolygon_resize (QPolygon *m, int n) + { + return m->resize (n); + } + + static void f_QPolygon_fill (QPolygon *m, const QPoint &p, int n) + { + m->fill (p, n); + } +CODE + gsi::constructor("new", &ctor_QPolygon_from_polygon, "@brief Creates a polygon from the given KLayout Polygon\n@args p\nRemark: holes are not transferred into the QPolygon.") + + gsi::constructor("new", &ctor_QPolygon_from_simple_polygon, "@brief Creates a polygon from the given KLayout SimplePolygon\n@args p") + + gsi::iterator_ext ("each", &f_QPolygon_each_begin, &f_QPolygon_each_end, "@brief Iterates over all points of the polygon.") + + gsi::method_ext("[]", &f_QPolygon_at, "@brief Gets the point at the given position\n@args index") + + gsi::method_ext("front", &f_QPolygon_front, "@brief Gets the first point") + + gsi::method_ext("back", &f_QPolygon_back, "@brief Gets the last point") + + gsi::method_ext("size", &f_QPolygon_size, "@brief Gets the number of points in the polygon") + + gsi::method_ext("clear", &f_QPolygon_clear, "@brief Empties the polygon") + + gsi::method_ext("remove", &f_QPolygon_remove, "@brief Removes the point at the given position\n@args index") + + gsi::method_ext("insert", &f_QPolygon_insert, "@brief Inserts the point after the given position\n@args index, p") + + gsi::method_ext("replace", &f_QPolygon_replace, "@brief Replaces the point at the given position\n@args index, p") + + gsi::method_ext("pop_front", &f_QPolygon_pop_front, "@brief Removes the point at the beginning of the list") + + gsi::method_ext("pop_back", &f_QPolygon_pop_back, "@brief Removes the point at the end of the list") + + gsi::method_ext("push_front", &f_QPolygon_push_front, "@brief Inserts the point at the beginning of the list\n@args p") + + gsi::method_ext("push_back", &f_QPolygon_push_back, "@brief Inserts the point at the end of the list\n@args p") + + gsi::method_ext("reserve", &f_QPolygon_reserve, "@brief Reserve memory for the given number of points\n@args n") + + gsi::method_ext("resize", &f_QPolygon_resize, "@brief Sets the number of points to the given length\n@args l") + + gsi::method_ext("fill", &f_QPolygon_fill, "@brief Resizes the polygon to l points and ets all elements to the given point\n@args p,l") +DECL + + # enhance QPolygonF by some missing methods because we dropped the base class + add_native_impl("QPolygonF", <<'CODE', <<'DECL') + +#include "dbPolygon.h" + + static QPolygonF *ctor_QPolygonF_from_polygon (const db::DPolygon &pts) + { + QPolygonF *p = new QPolygonF (); + p->reserve (int (pts.hull ().size ())); + for (db::DPolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { + p->push_back (QPointF ((*q).x (), (*q).y ())); + } + return p; + } + + static QPolygonF *ctor_QPolygonF_from_simple_polygon (const db::DSimplePolygon &pts) + { + QPolygonF *p = new QPolygonF (); + p->reserve (int (pts.hull ().size ())); + for (db::DSimplePolygon::polygon_contour_iterator q = pts.begin_hull (); q != pts.end_hull (); ++q) { + p->push_back (QPointF ((*q).x (), (*q).y ())); + } + return p; + } + + static QPolygonF::const_iterator f_QPolygonF_each_begin (const QPolygonF *m) + { + return m->begin (); + } + + static QPolygonF::const_iterator f_QPolygonF_each_end (const QPolygonF *m) + { + return m->end (); + } + + static QPointF f_QPolygonF_at (const QPolygonF *m, int i) + { + return m->at(i); + } + + static QPointF f_QPolygonF_front (const QPolygonF *m) + { + return m->front(); + } + + static QPointF f_QPolygonF_back (const QPolygonF *m) + { + return m->back(); + } + + static int f_QPolygonF_size (const QPolygonF *m) + { + return m->size(); + } + + static void f_QPolygonF_clear (QPolygonF *m) + { + return m->clear(); + } + + static void f_QPolygonF_remove (QPolygonF *m, int i) + { + return m->remove (i); + } + + static void f_QPolygonF_insert (QPolygonF *m, int i, const QPointF &p) + { + return m->insert (i, p); + } + + static void f_QPolygonF_replace (QPolygonF *m, int i, const QPointF &p) + { + return m->replace (i, p); + } + + static void f_QPolygonF_pop_front (QPolygonF *m) + { + return m->pop_front (); + } + + static void f_QPolygonF_pop_back (QPolygonF *m) + { + return m->pop_back (); + } + + static void f_QPolygonF_push_front (QPolygonF *m, const QPointF &p) + { + return m->push_front (p); + } + + static void f_QPolygonF_push_back (QPolygonF *m, const QPointF &p) + { + return m->push_back (p); + } + + static void f_QPolygonF_reserve (QPolygonF *m, int n) + { + return m->reserve (n); + } + + static void f_QPolygonF_resize (QPolygonF *m, int n) + { + return m->resize (n); + } + + static void f_QPolygonF_fill (QPolygonF *m, const QPointF &p, int n) + { + m->fill (p, n); + } +CODE + gsi::constructor("new", &ctor_QPolygonF_from_polygon, "@brief Creates a polygon from the given KLayout DPolygon\n@args p\nRemark: holes are not transferred into the QPolygonF.") + + gsi::constructor("new", &ctor_QPolygonF_from_simple_polygon, "@brief Creates a polygon from the given KLayout DSimplePolygon\n@args p") + + gsi::iterator_ext ("each", &f_QPolygonF_each_begin, &f_QPolygonF_each_end, "@brief Iterates over all points of the polygon.") + + gsi::method_ext("[]", &f_QPolygonF_at, "@brief Gets the point at the given position\n@args index") + + gsi::method_ext("front", &f_QPolygonF_front, "@brief Gets the first point") + + gsi::method_ext("back", &f_QPolygonF_back, "@brief Gets the last point") + + gsi::method_ext("size", &f_QPolygonF_size, "@brief Gets the number of points in the polygon") + + gsi::method_ext("clear", &f_QPolygonF_clear, "@brief Empties the polygon") + + gsi::method_ext("remove", &f_QPolygonF_remove, "@brief Removes the point at the given position\n@args index") + + gsi::method_ext("insert", &f_QPolygonF_insert, "@brief Inserts the point after the given position\n@args index, p") + + gsi::method_ext("replace", &f_QPolygonF_replace, "@brief Replaces the point at the given position\n@args index, p") + + gsi::method_ext("pop_front", &f_QPolygonF_pop_front, "@brief Removes the point at the beginning of the list") + + gsi::method_ext("pop_back", &f_QPolygonF_pop_back, "@brief Removes the point at the end of the list") + + gsi::method_ext("push_front", &f_QPolygonF_push_front, "@brief Inserts the point at the beginning of the list\n@args p") + + gsi::method_ext("push_back", &f_QPolygonF_push_back, "@brief Inserts the point at the end of the list\n@args p") + + gsi::method_ext("reserve", &f_QPolygonF_reserve, "@brief Reserve memory for the given number of points\n@args n") + + gsi::method_ext("resize", &f_QPolygonF_resize, "@brief Sets the number of points to the given length\n@args l") + + gsi::method_ext("fill", &f_QPolygonF_fill, "@brief Resizes the polygon to l points and ets all elements to the given point\n@args p,l") +DECL + +end + diff --git a/src/gsiqt/qt4/QtGui/gsiDeclQApplication.cc b/src/gsiqt/qt4/QtGui/gsiDeclQApplication.cc index 2a33e2264..2fe294f5e 100644 --- a/src/gsiqt/qt4/QtGui/gsiDeclQApplication.cc +++ b/src/gsiqt/qt4/QtGui/gsiDeclQApplication.cc @@ -2110,7 +2110,7 @@ static gsi::Methods methods_QApplication_Adaptor () { } gsi::Class decl_QApplication_Adaptor (qtdecl_QApplication (), "QtGui", "QApplication", - gsi::constructor("new", &QApplication_Adaptor::ctor_QApplication_Adaptor_args, gsi::arg ("argv"), gsi::arg ("gui", false), "@brief Creates a new QApplication object\n\n@param argv The command line arguments to pass to Qt\n@param gui If true, a GUI-enabled application is constructed") + gsi::constructor("new", &QApplication_Adaptor::ctor_QApplication_Adaptor_args, gsi::arg ("argv"), gsi::arg ("gui", true), "@brief Creates a new QApplication object\n\n@param argv The command line arguments to pass to Qt\n@param gui If true, a GUI-enabled application is constructed") + methods_QApplication_Adaptor (), "@qt\n@brief Binding of QApplication"); diff --git a/src/gsiqt/qt5/QtWidgets/gsiDeclQApplication.cc b/src/gsiqt/qt5/QtWidgets/gsiDeclQApplication.cc index e16c5f849..8ee74c7ae 100644 --- a/src/gsiqt/qt5/QtWidgets/gsiDeclQApplication.cc +++ b/src/gsiqt/qt5/QtWidgets/gsiDeclQApplication.cc @@ -1991,7 +1991,7 @@ static gsi::Methods methods_QApplication_Adaptor () { } gsi::Class decl_QApplication_Adaptor (qtdecl_QApplication (), "QtWidgets", "QApplication", - gsi::constructor("new", &QApplication_Adaptor::ctor_QApplication_Adaptor_args, gsi::arg ("argv"), gsi::arg ("gui", false), "@brief Creates a new QApplication object\n\n@param argv The command line arguments to pass to Qt\n@param gui If true, a GUI-enabled application is constructed") + gsi::constructor("new", &QApplication_Adaptor::ctor_QApplication_Adaptor_args, gsi::arg ("argv"), gsi::arg ("gui", true), "@brief Creates a new QApplication object\n\n@param argv The command line arguments to pass to Qt\n@param gui If true, a GUI-enabled application is constructed") + methods_QApplication_Adaptor (), "@qt\n@brief Binding of QApplication"); diff --git a/src/gsiqt/qt5/qt5.pro b/src/gsiqt/qt5/qt5.pro index 258113d46..bdc683f44 100644 --- a/src/gsiqt/qt5/qt5.pro +++ b/src/gsiqt/qt5/qt5.pro @@ -19,8 +19,8 @@ QtNetwork.depends += QtCore QtSql.depends += QtCore QtWidgets.depends += QtGui QtDesigner.depends += QtCore -QtMultimedia.depends += QtCore -QtPrintSupports.depends += QtCore QtWidgets +QtMultimedia.depends += QtCore QtWidgets +QtPrintSupport.depends += QtCore QtWidgets QtSvg.depends += QtCore QtWidgets QtXmlPatterns.depends += QtCore QtXml.depends += QtCore