From 39236c01ae6c9bc99ee3a02d8294679e12d9b734 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 22 May 2017 16:44:51 +0200 Subject: move everying into sources/pyside2 in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it. --- sources/pyside2/PySide2/QtWidgets/CMakeLists.txt | 260 ++ .../PySide2/QtWidgets/glue/qapplication_init.cpp | 80 + .../QtWidgets/glue/qlayout_help_functions.cpp | 161 + .../pyside2/PySide2/QtWidgets/glue/qmenu_glue.cpp | 60 + .../PySide2/QtWidgets/glue/qmenubar_glue.cpp | 59 + .../PySide2/QtWidgets/glue/qtwidgets_qapp.cpp | 49 + .../PySide2/QtWidgets/glue/qwidget_glue.cpp | 104 + .../PySide2/QtWidgets/typesystem_widgets.xml.in | 46 + .../QtWidgets/typesystem_widgets_common.xml | 3695 ++++++++++++++++++++ .../PySide2/QtWidgets/typesystem_widgets_mac.xml | 55 + .../PySide2/QtWidgets/typesystem_widgets_win.xml | 42 + .../PySide2/QtWidgets/typesystem_widgets_x11.xml | 42 + 12 files changed, 4653 insertions(+) create mode 100644 sources/pyside2/PySide2/QtWidgets/CMakeLists.txt create mode 100644 sources/pyside2/PySide2/QtWidgets/glue/qapplication_init.cpp create mode 100644 sources/pyside2/PySide2/QtWidgets/glue/qlayout_help_functions.cpp create mode 100644 sources/pyside2/PySide2/QtWidgets/glue/qmenu_glue.cpp create mode 100644 sources/pyside2/PySide2/QtWidgets/glue/qmenubar_glue.cpp create mode 100644 sources/pyside2/PySide2/QtWidgets/glue/qtwidgets_qapp.cpp create mode 100644 sources/pyside2/PySide2/QtWidgets/glue/qwidget_glue.cpp create mode 100644 sources/pyside2/PySide2/QtWidgets/typesystem_widgets.xml.in create mode 100644 sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml create mode 100644 sources/pyside2/PySide2/QtWidgets/typesystem_widgets_mac.xml create mode 100644 sources/pyside2/PySide2/QtWidgets/typesystem_widgets_win.xml create mode 100644 sources/pyside2/PySide2/QtWidgets/typesystem_widgets_x11.xml (limited to 'sources/pyside2/PySide2/QtWidgets') diff --git a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt new file mode 100644 index 000000000..84dec8fa9 --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt @@ -0,0 +1,260 @@ +project(QtWidgets) + + +set(QtWidgets_OPTIONAL_SRC ) +set(QtWidgets_DROPPED_ENTRIES ) +## gone check_qt_class(Qt5Widgets QAbstractPageSetupDialog QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +## actually, all the printer stuff is in QtPrintSupport +## XXX check if these conditionals need to be done elsewhere +check_qt_class(Qt5Widgets QAbstractPrintDialog QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QGtkStyle QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPageSetupDialog QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPrintDialog QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPrintEngine QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPrintPreviewDialog QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPrintPreviewWidget QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPrinter QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QPrinterInfo QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QSessionManager QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QSizeGrip QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QSystemTrayIcon QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) +check_qt_class(Qt5Widgets QMacStyle QtWidgets_OPTIONAL_SRC QtWidgets_DROPPED_ENTRIES) + +set(QtWidgets_SRC +${QtWidgets_GEN_DIR}/qabstractbutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qabstractgraphicsshapeitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qabstractitemdelegate_wrapper.cpp +${QtWidgets_GEN_DIR}/qabstractitemview_wrapper.cpp +${QtWidgets_GEN_DIR}/qabstractscrollarea_wrapper.cpp +${QtWidgets_GEN_DIR}/qabstractslider_wrapper.cpp +${QtWidgets_GEN_DIR}/qabstractspinbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qaction_wrapper.cpp +${QtWidgets_GEN_DIR}/qactiongroup_wrapper.cpp +${QtWidgets_GEN_DIR}/qapplication_wrapper.cpp +${QtWidgets_GEN_DIR}/qboxlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qbuttongroup_wrapper.cpp +${QtWidgets_GEN_DIR}/qcalendarwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qcheckbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qcolordialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qcolumnview_wrapper.cpp +${QtWidgets_GEN_DIR}/qcombobox_wrapper.cpp +${QtWidgets_GEN_DIR}/qcommandlinkbutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qcommonstyle_wrapper.cpp +${QtWidgets_GEN_DIR}/qcompleter_wrapper.cpp +${QtWidgets_GEN_DIR}/qdatawidgetmapper_wrapper.cpp +${QtWidgets_GEN_DIR}/qdateedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qdatetimeedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qdesktopwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qdial_wrapper.cpp +${QtWidgets_GEN_DIR}/qdialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qdialogbuttonbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qdirmodel_wrapper.cpp +${QtWidgets_GEN_DIR}/qdockwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qdoublespinbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qerrormessage_wrapper.cpp +${QtWidgets_GEN_DIR}/qfiledialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qfileiconprovider_wrapper.cpp +${QtWidgets_GEN_DIR}/qfilesystemmodel_wrapper.cpp +${QtWidgets_GEN_DIR}/qfocusframe_wrapper.cpp +${QtWidgets_GEN_DIR}/qfontcombobox_wrapper.cpp +${QtWidgets_GEN_DIR}/qfontdialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qformlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qframe_wrapper.cpp +${QtWidgets_GEN_DIR}/qgesture_wrapper.cpp +${QtWidgets_GEN_DIR}/qgestureevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgesturerecognizer_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsanchor_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsanchorlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsblureffect_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicscolorizeeffect_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsdropshadoweffect_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicseffect_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsellipseitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsgridlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsitemanimation_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsitemgroup_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicslayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicslayoutitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicslinearlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicslineitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsobject_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsopacityeffect_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicspathitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicspixmapitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicspolygonitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsproxywidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsrectitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsrotation_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscale_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscene_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenecontextmenuevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenedragdropevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicssceneevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenehelpevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenehoverevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenemouseevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenemoveevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicssceneresizeevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsscenewheelevent_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicssimpletextitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicstextitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicstransform_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicsview_wrapper.cpp +${QtWidgets_GEN_DIR}/qgraphicswidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qgridlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qgroupbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qhboxlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qheaderview_wrapper.cpp +${QtWidgets_GEN_DIR}/qinputdialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qitemdelegate_wrapper.cpp +${QtWidgets_GEN_DIR}/qitemeditorcreatorbase_wrapper.cpp +${QtWidgets_GEN_DIR}/qitemeditorfactory_wrapper.cpp +${QtWidgets_GEN_DIR}/qkeyeventtransition_wrapper.cpp +${QtWidgets_GEN_DIR}/qkeysequenceedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qlabel_wrapper.cpp +${QtWidgets_GEN_DIR}/qlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qlayoutitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qlcdnumber_wrapper.cpp +${QtWidgets_GEN_DIR}/qlineedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qlistview_wrapper.cpp +${QtWidgets_GEN_DIR}/qlistwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qlistwidgetitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qmainwindow_wrapper.cpp +${QtWidgets_GEN_DIR}/qmdiarea_wrapper.cpp +${QtWidgets_GEN_DIR}/qmdisubwindow_wrapper.cpp +${QtWidgets_GEN_DIR}/qmenu_wrapper.cpp +${QtWidgets_GEN_DIR}/qmenubar_wrapper.cpp +${QtWidgets_GEN_DIR}/qmessagebox_wrapper.cpp +${QtWidgets_GEN_DIR}/qmouseeventtransition_wrapper.cpp +${QtWidgets_GEN_DIR}/qopenglwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qpangesture_wrapper.cpp +${QtWidgets_GEN_DIR}/qpinchgesture_wrapper.cpp +${QtWidgets_GEN_DIR}/qplaintextdocumentlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qplaintextedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qprogressbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qprogressdialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qpushbutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qradiobutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qrubberband_wrapper.cpp +${QtWidgets_GEN_DIR}/qscrollarea_wrapper.cpp +${QtWidgets_GEN_DIR}/qscrollbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qshortcut_wrapper.cpp +${QtWidgets_GEN_DIR}/qsizegrip_wrapper.cpp +${QtWidgets_GEN_DIR}/qsizepolicy_wrapper.cpp +${QtWidgets_GEN_DIR}/qslider_wrapper.cpp +${QtWidgets_GEN_DIR}/qspaceritem_wrapper.cpp +${QtWidgets_GEN_DIR}/qspinbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qsplashscreen_wrapper.cpp +${QtWidgets_GEN_DIR}/qsplitter_wrapper.cpp +${QtWidgets_GEN_DIR}/qsplitterhandle_wrapper.cpp +${QtWidgets_GEN_DIR}/qstackedlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qstackedwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qstatusbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyle_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleditemdelegate_wrapper.cpp +${QtWidgets_GEN_DIR}/qstylefactory_wrapper.cpp +${QtWidgets_GEN_DIR}/qstylehintreturn_wrapper.cpp +${QtWidgets_GEN_DIR}/qstylehintreturnmask_wrapper.cpp +${QtWidgets_GEN_DIR}/qstylehintreturnvariant_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoption_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionbutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptioncombobox_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptioncomplex_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiondockwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionfocusrect_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionframe_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiongraphicsitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiongroupbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionheader_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionmenuitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionprogressbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionrubberband_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionsizegrip_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionslider_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionspinbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontab_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontabbarbase_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontabwidgetframe_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontitlebar_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontoolbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontoolbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptiontoolbutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qstyleoptionviewitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qstylepainter_wrapper.cpp +${QtWidgets_GEN_DIR}/qswipegesture_wrapper.cpp +${QtWidgets_GEN_DIR}/qsystemtrayicon_wrapper.cpp +${QtWidgets_GEN_DIR}/qtabbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qtableview_wrapper.cpp +${QtWidgets_GEN_DIR}/qtablewidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qtablewidgetitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qtablewidgetselectionrange_wrapper.cpp +${QtWidgets_GEN_DIR}/qtabwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qtapandholdgesture_wrapper.cpp +${QtWidgets_GEN_DIR}/qtapgesture_wrapper.cpp +${QtWidgets_GEN_DIR}/qtextbrowser_wrapper.cpp +${QtWidgets_GEN_DIR}/qtextedit_extraselection_wrapper.cpp +${QtWidgets_GEN_DIR}/qtextedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qtilerules_wrapper.cpp +${QtWidgets_GEN_DIR}/qtimeedit_wrapper.cpp +${QtWidgets_GEN_DIR}/qtoolbar_wrapper.cpp +${QtWidgets_GEN_DIR}/qtoolbox_wrapper.cpp +${QtWidgets_GEN_DIR}/qtoolbutton_wrapper.cpp +${QtWidgets_GEN_DIR}/qtooltip_wrapper.cpp +${QtWidgets_GEN_DIR}/qtreeview_wrapper.cpp +${QtWidgets_GEN_DIR}/qtreewidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qtreewidgetitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qtreewidgetitemiterator_wrapper.cpp +${QtWidgets_GEN_DIR}/qundocommand_wrapper.cpp +${QtWidgets_GEN_DIR}/qundogroup_wrapper.cpp +${QtWidgets_GEN_DIR}/qundostack_wrapper.cpp +${QtWidgets_GEN_DIR}/qundoview_wrapper.cpp +${QtWidgets_GEN_DIR}/qvboxlayout_wrapper.cpp +${QtWidgets_GEN_DIR}/qwhatsthis_wrapper.cpp +${QtWidgets_GEN_DIR}/qwidget_wrapper.cpp +${QtWidgets_GEN_DIR}/qwidgetaction_wrapper.cpp +${QtWidgets_GEN_DIR}/qwidgetitem_wrapper.cpp +${QtWidgets_GEN_DIR}/qwizard_wrapper.cpp +${QtWidgets_GEN_DIR}/qwizardpage_wrapper.cpp + +${SPECIFIC_OS_FILES} +# module is always needed +${QtWidgets_GEN_DIR}/qtwidgets_module_wrapper.cpp +) + +configure_file("${QtWidgets_SOURCE_DIR}/typesystem_widgets.xml.in" + "${QtWidgets_BINARY_DIR}/typesystem_widgets.xml" @ONLY) + +make_path(QtWidgets_typesystem_path ${QtCore_SOURCE_DIR} ${QtGui_SOURCE_DIR} + ${QtCore_BINARY_DIR} ${QtGui_BINARY_DIR} + ${QtWidgets_SOURCE_DIR}) + +set(QtWidgets_include_dirs ${QtWidgets_SOURCE_DIR} + ${QtWidgets_BINARY_DIR} + ${pyside2_SOURCE_DIR} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${Qt5Widgets_INCLUDE_DIRS} + ${SHIBOKEN_INCLUDE_DIR} + ${libpyside_SOURCE_DIR} + ${SHIBOKEN_PYTHON_INCLUDE_DIR} + ${QtCore_GEN_DIR} + ${QtGui_GEN_DIR} + ) +set(QtWidgets_libraries pyside2 + ${SHIBOKEN_PYTHON_LIBRARIES} + ${SHIBOKEN_LIBRARY} + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ) +set(QtWidgets_deps QtGui) + +create_pyside_module(QtWidgets + QtWidgets_include_dirs + QtWidgets_libraries + QtWidgets_deps + QtWidgets_typesystem_path + QtWidgets_SRC + "" + ${QtWidgets_BINARY_DIR}/typesystem_widgets.xml) diff --git a/sources/pyside2/PySide2/QtWidgets/glue/qapplication_init.cpp b/sources/pyside2/PySide2/QtWidgets/glue/qapplication_init.cpp new file mode 100644 index 000000000..0de34d9c5 --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/glue/qapplication_init.cpp @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// Borrowed reference to QtWidgets module +extern PyObject* moduleQtWidgets; + +static int QApplicationArgCount; +static char** QApplicationArgValues; +static const char QAPP_MACRO[] = "qApp"; + +bool QApplicationConstructorStart(PyObject* argv) +{ + if (QApplication::instance()) { + PyErr_SetString(PyExc_RuntimeError, "A QApplication instance already exists."); + return false; + } + + return Shiboken::sequenceToArgcArgv(argv, &QApplicationArgCount, &QApplicationArgValues, "PySideApp"); +} + +void QApplicationConstructorEnd(PyObject* self) +{ + // Verify if qApp is in main module + PyObject* globalsDict = PyEval_GetGlobals(); + if (globalsDict) { + PyObject* qAppObj = PyDict_GetItemString(globalsDict, QAPP_MACRO); + if (qAppObj) + PyDict_SetItemString(globalsDict, QAPP_MACRO, self); + } + + PyObject_SetAttrString(moduleQtWidgets, QAPP_MACRO, self); + PySide::registerCleanupFunction(&PySide::destroyQCoreApplication); + Py_INCREF(self); +} + +static void QApplicationConstructor(PyObject* self, PyObject* argv, QApplicationWrapper** cptr) +{ + if (QApplicationConstructorStart(argv)) { + // XXX do we need to support the ApplicationFlags parameter, instead of 0? + *cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues, 0); + Shiboken::Object::releaseOwnership(reinterpret_cast(self)); + QApplicationConstructorEnd(self); + } +} diff --git a/sources/pyside2/PySide2/QtWidgets/glue/qlayout_help_functions.cpp b/sources/pyside2/PySide2/QtWidgets/glue/qlayout_help_functions.cpp new file mode 100644 index 000000000..e1d2ffc4d --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/glue/qlayout_help_functions.cpp @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +void addLayoutOwnership(QLayout* layout, QLayoutItem* item); +void removeLayoutOwnership(QLayout* layout, QWidget* widget); + +inline QByteArray retrieveObjectName(PyObject* obj) +{ + Shiboken::AutoDecRef objName(PyObject_Str(obj)); + return Shiboken::String::toCString(objName); +} + +inline void addLayoutOwnership(QLayout* layout, QWidget* widget) +{ + //transfer ownership to parent widget + QWidget *lw = layout->parentWidget(); + QWidget *pw = widget->parentWidget(); + + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget)); + + //Transfer parent to layout widget + if (pw && lw && pw != lw) + Shiboken::Object::setParent(0, pyChild); + + if (!lw && !pw) { + //keep the reference while the layout is orphan + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](layout)); + Shiboken::Object::keepReference(reinterpret_cast(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true); + } else { + if (!lw) + lw = pw; + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](lw)); + Shiboken::Object::setParent(pyParent, pyChild); + } +} + +inline void addLayoutOwnership(QLayout* layout, QLayout* other) +{ + //transfer all children widgets from other to layout parent widget + QWidget* parent = layout->parentWidget(); + if (!parent) { + //keep the reference while the layout is orphan + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout)); + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](other)); + Shiboken::Object::keepReference(reinterpret_cast(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true); + return; + } + + for (int i=0, i_max=other->count(); i < i_max; i++) { + QLayoutItem* item = other->itemAt(i); + if (PyErr_Occurred() || !item) + return; + addLayoutOwnership(layout, item); + } + + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout)); + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](other)); + Shiboken::Object::setParent(pyParent, pyChild); +} + +inline void addLayoutOwnership(QLayout* layout, QLayoutItem* item) +{ + if (!item) + return; + + QWidget* w = item->widget(); + if (w) + addLayoutOwnership(layout, w); + else { + QLayout* l = item->layout(); + if (l) + addLayoutOwnership(layout, l); + } + + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout)); + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem*](item)); + Shiboken::Object::setParent(pyParent, pyChild); +} + +static void removeWidgetFromLayout(QLayout* layout, QWidget* widget) +{ + QWidget* parent = widget->parentWidget(); + + if (!parent) { + //remove reference on layout + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](layout)); + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget)); + Shiboken::Object::removeReference(reinterpret_cast(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild); + } else { + //give the ownership to parent + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent)); + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget)); + Shiboken::Object::setParent(pyParent, pyChild); + } +} + +inline void removeLayoutOwnership(QLayout* layout, QLayoutItem* item) +{ + QWidget* w = item->widget(); + if (w) + removeWidgetFromLayout(layout, w); + else { + QLayout* l = item->layout(); + if (l && item != l) + removeLayoutOwnership(layout, l); + } + + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem*](item)); + Shiboken::Object::invalidate(pyChild); + Shiboken::Object::setParent(0, pyChild); +} + +inline void removeLayoutOwnership(QLayout* layout, QWidget* widget) +{ + if (!widget) + return; + + for (int i=0, i_max=layout->count(); i < i_max; i++) { + QLayoutItem* item = layout->itemAt(i); + if (PyErr_Occurred() || !item) + return; + if (item->widget() == widget) + removeLayoutOwnership(layout, item); + } +} diff --git a/sources/pyside2/PySide2/QtWidgets/glue/qmenu_glue.cpp b/sources/pyside2/PySide2/QtWidgets/glue/qmenu_glue.cpp new file mode 100644 index 000000000..68e991ce7 --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/glue/qmenu_glue.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +inline PyObject* addActionWithPyObject(QMenu* self, const QIcon& icon, const QString& text, PyObject* callback, const QKeySequence& shortcut) +{ + QAction* act = new QAction(text, self); + + if (!icon.isNull()) + act->setIcon(icon); + + if (!shortcut.isEmpty()) + act->setShortcut(shortcut); + + self->addAction(act); + + PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act); + Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, SIGNAL(triggered()), callback)); + if (result.isNull()) { + Py_DECREF(pyAct); + return 0; + } + + return pyAct; +} diff --git a/sources/pyside2/PySide2/QtWidgets/glue/qmenubar_glue.cpp b/sources/pyside2/PySide2/QtWidgets/glue/qmenubar_glue.cpp new file mode 100644 index 000000000..15ddfb81a --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/glue/qmenubar_glue.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +inline PyObject* +addActionWithPyObject(QMenuBar* self, const QString& text, PyObject* callback) +{ + QAction* act = new QAction(text, self); + + self->addAction(act); + + PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act); + PyObject* result = PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, + SIGNAL(triggered(bool)), callback); + + if (result == 0 || result == Py_False) { + if (result) + Py_DECREF(result); + Py_DECREF(pyAct); + return 0; + } + + return pyAct; +} diff --git a/sources/pyside2/PySide2/QtWidgets/glue/qtwidgets_qapp.cpp b/sources/pyside2/PySide2/QtWidgets/glue/qtwidgets_qapp.cpp new file mode 100644 index 000000000..e041c7680 --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/glue/qtwidgets_qapp.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// Init qApp macro to None. +if (qApp) { + PyObject* pyApp = %CONVERTTOPYTHON[QApplication*](qApp); + Py_INCREF(pyApp); + PyModule_AddObject(module, "qApp", pyApp); +} else { + Py_INCREF(Py_None); + PyModule_AddObject(module, "qApp", Py_None); +} +moduleQtWidgets = module; diff --git a/sources/pyside2/PySide2/QtWidgets/glue/qwidget_glue.cpp b/sources/pyside2/PySide2/QtWidgets/glue/qwidget_glue.cpp new file mode 100644 index 000000000..1dd03a8fc --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/glue/qwidget_glue.cpp @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +static QString retrieveObjectName(PyObject *obj) +{ + Shiboken::AutoDecRef objName(PyObject_Str(obj)); + return QString(Shiboken::String::toCString(objName)); +} + + +/** + * Tranfer objects ownership from layout to widget + **/ +static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout) +{ + Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent)); + + for (int i=0; i < layout->count(); i++) { + QLayoutItem* item = layout->itemAt(i); + if (PyErr_Occurred() || !item) + return; + + QWidget* w = item->widget(); + if (w) { + QWidget* pw = w->parentWidget(); + if (pw != parent) { + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](w)); + Shiboken::Object::setParent(pyParent, pyChild); + } + } else { + QLayout* l = item->layout(); + if (l) + qwidgetReparentLayout(parent, l); + } + } + + Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](layout)); + Shiboken::Object::setParent(pyParent, pyChild); + //remove previous references + Shiboken::Object::keepReference(reinterpret_cast(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None); +} + +static inline void qwidgetSetLayout(QWidget *self, QLayout *layout) +{ + if (!layout || self->layout()) + return; + + QObject* oldParent = layout->parent(); + if (oldParent && oldParent != self) { + if (oldParent->isWidgetType()) { + // remove old parent policy + Shiboken::AutoDecRef pyLayout(%CONVERTTOPYTHON[QLayout*](layout)); + Shiboken::Object::setParent(Py_None, pyLayout); + } else { + PyErr_Format(PyExc_RuntimeError, "QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent", + qPrintable(layout->objectName()), self->metaObject()->className(), qPrintable(self->objectName())); + return; + } + } + + if (oldParent != self) { + qwidgetReparentLayout(self, layout); + if (PyErr_Occurred()) + return; + + self->setLayout(layout); + } +} diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets.xml.in b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets.xml.in new file mode 100644 index 000000000..e6952c2fe --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets.xml.in @@ -0,0 +1,46 @@ + + + + + + + diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml new file mode 100644 index 000000000..59412699c --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -0,0 +1,3695 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if (**%CPPSELF) { + QTreeWidgetItemIterator* %0 = new QTreeWidgetItemIterator((*%CPPSELF)++); + %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0); + } + + + + + + QTreeWidgetItem* %0 = %CPPSELF.operator*(); + %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0); + Shiboken::Object::releaseOwnership(%PYARG_0); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PyObject* userTypeConstant = PyInt_FromLong(QGraphicsItem::UserType); + PyDict_SetItemString(Sbk_QGraphicsItem_Type.super.ht_type.tp_dict, "UserType", userTypeConstant); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QGraphicsItem *item_ = NULL; + %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_); + %PYARG_0 = PyTuple_New(2); + PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_)); + PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_)); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shiboken::Object::releaseOwnership(%PYARG_2); + + + + + + + + //this function is static we need keep ref to default value, to be able to call python virtual functions + static PyObject* _defaultValue = 0; + %CPPSELF.%FUNCTION_NAME(%1); + Py_INCREF(%PYARG_1); + if (_defaultValue) + Py_DECREF(_defaultValue); + + _defaultValue = %PYARG_1; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3); + + + + + + + + + + + + + %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4); + + + + + + %CPPSELF.addAction(%1); + + + + + + Shiboken::BindingManager& bm = Shiboken::BindingManager::instance(); + PyObject* pyObj; + foreach(QAction* act, %CPPSELF.actions()) { + if ((pyObj = (PyObject*)bm.retrieveWrapper(act)) != 0) { + Py_INCREF(pyObj); + Shiboken::Object::setParent(NULL, pyObj); + Shiboken::Object::invalidate(pyObj); + Py_DECREF(pyObj); + } + } + + + + + + + + + + + + + + + + + + + + %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + foreach(QAction *act, %CPPSELF.actions()) { + Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act)); + Shiboken::Object::setParent(NULL, pyAct); + Shiboken::Object::invalidate(pyAct); + } + + + + + + %CPPSELF.addAction(%1); + + + + + + + + + + + + + + + + + + + + + + + %0 = new %TYPE(%1, %2); + + + Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3)); + if (!result.isNull()) + Shiboken::Object::setParent(%PYARG_2, %PYSELF); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QWidget *_widget = %CPPSELF.widget(%1); + if (_widget) { + Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget)); + Shiboken::Object::setParent(0, pyWidget); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + addLayoutOwnership(%CPPSELF, %0); + + + + + + removeLayoutOwnership(%CPPSELF, %1); + + + + + removeLayoutOwnership(%CPPSELF, %1); + + + + + + + + + + + + + + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %CPPSELF.setAlignment(%1); + + + + + + + + + + + addLayoutOwnership(%CPPSELF, %2); + + + + + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + addLayoutOwnership(%CPPSELF, %2); + + + + + addLayoutOwnership(%CPPSELF, %2); + + + + + addLayoutOwnership(%CPPSELF, %2); + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + addLayoutOwnership(%CPPSELF, %2); + + + + + + + + + + + + addLayoutOwnership(%CPPSELF, %0); + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + + + + + + + + + addLayoutOwnership(%CPPSELF, %1); + + + + + + + + + + + + + + + + + + + + + int a, b, c, d; + %CPPSELF.%FUNCTION_NAME(%1, &a, &b, &c, &d); + %PYARG_0 = PyTuple_New(4); + PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a)); + PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b)); + PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c)); + PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d)); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + int %out = PySequence_Size(%PYARG_1); + + + + + + + int numItems = PySequence_Size(%PYARG_1); + Shiboken::AutoArrayPointer<QGraphicsItem*> %out(numItems); + for (int i=0; i < numItems; i++) { + %out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i)); + } + + + + Shiboken::AutoDecRef object(PyList_New(0)); + for (int i=0, max=numItems; i < max; i++) { + PyList_Append(object, %CONVERTTOPYTHON[QGraphicsItem*](%in[i])); + } + PyObject *%out = object.object(); + + + + + + + Shiboken::AutoDecRef option_object(PyList_New(0)); + for (int i=0, max=numItems; i < max; i++) { + const QStyleOptionGraphicsItem* item = &%in[i]; + PyList_Append(option_object, %CONVERTTOPYTHON[QStyleOptionGraphicsItem](item)); + } + PyObject* %out = option_object.object(); + + + + int numOptions = PySequence_Size(%PYARG_2); + Shiboken::AutoArrayPointer<QStyleOptionGraphicsItem> %out(numOptions); + for (int i=0; i < numOptions; i++) { + %out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i)); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QGraphicsItem* parentItem = %1->parentItem(); + Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem)); + foreach (QGraphicsItem* item, %1->childItems()) + Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item)); + %BEGIN_ALLOW_THREADS + %CPPSELF.%FUNCTION_NAME(%1); + %END_ALLOW_THREADS + // the arg was destroyed by Qt. + Shiboken::Object::invalidate(%PYARG_1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2); + %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); + Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1); + + + + + + + + + + + + + const QList<QGraphicsItem*> items = %CPPSELF.items(); + Shiboken::BindingManager& bm = Shiboken::BindingManager::instance(); + foreach (QGraphicsItem* item, items) { + SbkObject* obj = bm.retrieveWrapper(item); + if (obj) { + if (reinterpret_cast<PyObject*>(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway. + Shiboken::Object::invalidate(obj); + Shiboken::Object::removeParent(obj); + } + } + %CPPSELF.%FUNCTION_NAME(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem(); + Shiboken::BindingManager &bm = Shiboken::BindingManager::instance(); + for (int i = 0; i < rootItem->childCount(); ++i) { + QTreeWidgetItem *item = rootItem->child(i); + SbkObject* wrapper = bm.retrieveWrapper(item); + if (wrapper) + Shiboken::Object::setParent(0, reinterpret_cast<PyObject*>(wrapper)); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // Only call the parent function if this return some value + // the parent can be the TreeWidget + if (%0) + Shiboken::Object::setParent(%PYARG_0, %PYSELF); + + + + + + + + // Only call the parent function if this return some value + // the parent can be the TreeWidgetItem + if (%0) + Shiboken::Object::setParent(%PYARG_0, %PYSELF); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_1); + + + + + QStyle* myStyle = %CPPSELF->style(); + if (myStyle && qApp) { + %PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle); + QStyle *appStyle = qApp->style(); + if (appStyle == myStyle) { + Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp)); + Shiboken::Object::setParent(pyApp, %PYARG_0); + Shiboken::Object::releaseOwnership(%PYARG_0); + } else { + Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_0); + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + qwidgetSetLayout(%CPPSELF, %1); + // %FUNCTION_NAME() - disable generation of function call. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QWidget* tab = %CPPSELF.widget(%1); + if (tab) { + Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab)); + %CPPSELF.%FUNCTION_NAME(%1); + } + + + + + for (int i = 0; i < %CPPSELF.count(); i++) { + QWidget* widget = %CPPSELF.widget(i); + Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget)); + Shiboken::Object::setParent(0, pyWidget); + } + %CPPSELF.%FUNCTION_NAME(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %CPPSELF.addAction(%1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +:: + + def callback_int(value_as_int): + print 'int value changed:', repr(value_as_int) + + app = QApplication(sys.argv) + spinbox = QSpinBox() + spinbox.valueChanged[unicode].connect(callback_unicode) + spinbox.show() + sys.exit(app.exec_()) + + + + +:: + + def callback_unicode(value_as_unicode): + print 'unicode value changed:', repr(value_as_unicode) + + app = QApplication(sys.argv) + spinbox = QSpinBox() + spinbox.valueChanged[unicode].connect(callback_unicode) + spinbox.show() + sys.exit(app.exec_()) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QAction* action = %CPPSELF.addAction(%1, %2); + %PYARG_0 = %CONVERTTOPYTHON[QAction*](action); + Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_3)); + + + + + + + + + + + + + + QAction* action = %CPPSELF.addAction(%1); + %PYARG_0 = %CONVERTTOPYTHON[QAction*](action); + Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_2)); + + + + + + + + + + + + + + + %CPPSELF.addAction(%1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QList<PyObject* > lst; + Shiboken::BindingManager& bm = Shiboken::BindingManager::instance(); + foreach(QToolButton* child, %CPPSELF.findChildren<QToolButton*>()) { + if (bm.hasWrapper(child)) { + PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child); + Shiboken::Object::setParent(0, pyChild); + lst << pyChild; + } + } + + //Remove actions + foreach(QAction *act, %CPPSELF.actions()) { + Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act)); + Shiboken::Object::setParent(NULL, pyAct); + Shiboken::Object::invalidate(pyAct); + } + + %CPPSELF.clear(); + foreach(PyObject* obj, lst) { + Shiboken::Object::invalidate(reinterpret_cast<SbkObject* >(obj)); + Py_XDECREF(obj); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PyObject* moduleQtWidgets; + + + + + + + + + + + + + + + + + QApplicationConstructor(%PYSELF, %1, &%0); + + + + + + + + + Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + QWidget* _old = %CPPSELF.widget(); + if (_old) + Shiboken::Object::setParent(NULL, %CONVERTTOPYTHON[QWidget*](_old)); + %CPPSELF.%FUNCTION_NAME(%1); + Shiboken::Object::setParent(%PYSELF, %PYARG_1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_mac.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_mac.xml new file mode 100644 index 000000000..a2d665b0a --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_mac.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_win.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_win.xml new file mode 100644 index 000000000..d15ec8191 --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_win.xml @@ -0,0 +1,42 @@ + + + diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_x11.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_x11.xml new file mode 100644 index 000000000..d15ec8191 --- /dev/null +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_x11.xml @@ -0,0 +1,42 @@ + + + -- cgit v1.2.3