1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

PyFalkon: Export Menu and Action classes + fix warnings

This commit is contained in:
David Rosca 2018-03-01 20:38:43 +01:00
parent e427f14445
commit db66ea91df
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
3 changed files with 53 additions and 1 deletions

View File

@ -39,6 +39,7 @@ set(SHIBOKEN_OPTIONS --generator-set=shiboken --enable-parent-ctor-heuristic
${INCLUDES} ${INCLUDES}
-T${PYSIDE_TYPESYSTEMS} -T${PYSIDE_TYPESYSTEMS}
--output-directory=${CMAKE_CURRENT_BINARY_DIR} --output-directory=${CMAKE_CURRENT_BINARY_DIR}
--api-version="${Qt5_VERSION_MAJOR}.${Qt5_VERSION_MINOR}"
) )
# Specify which sources will be generated by shiboken, and their dependencies. # Specify which sources will be generated by shiboken, and their dependencies.
@ -122,6 +123,8 @@ set(GENERATED_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/sqldatabase_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/sqldatabase_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/toolbutton_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/toolbutton_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/wheelhelper_wrapper.cpp ${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/wheelhelper_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/menu_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PyFalkon/action_wrapper.cpp
) )
set(GENERATED_SOURCES_DEPENDENCIES set(GENERATED_SOURCES_DEPENDENCIES
${GLOBAL_HEADER} ${GLOBAL_HEADER}

View File

@ -102,6 +102,7 @@
#include "clickablelabel.h" #include "clickablelabel.h"
#include "delayedfilewatcher.h" #include "delayedfilewatcher.h"
#include "desktopfile.h" #include "desktopfile.h"
#include "enhancedmenu.h"
#include "iconprovider.h" #include "iconprovider.h"
#include "qztools.h" #include "qztools.h"
#include "sqldatabase.h" #include "sqldatabase.h"

View File

@ -180,8 +180,47 @@
<object-type name="ClickableLabel"/> <object-type name="ClickableLabel"/>
<object-type name="DelayedFileWatcher"/> <object-type name="DelayedFileWatcher"/>
<value-type name="DesktopFile"/> <value-type name="DesktopFile"/>
<object-type name="Menu"/>
<object-type name="Action"/>
<object-type name="IconProvider"/> <object-type name="IconProvider"/>
<object-type name="QzTools"/> <object-type name="QzTools">
<modify-function signature="getOpenFileName(const QString&amp;, QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)">
<modify-argument index="return">
<replace-type modified-type="(fileName, selectedFilter)"/>
</modify-argument>
<modify-argument index="6">
<replace-type modified-type="QString"/>
<replace-default-expression with="QString()"/>
</modify-argument>
<inject-code class="target" position="end">
<insert-template name="return_for_QFileDialog"/>
</inject-code>
</modify-function>
<modify-function signature="getOpenFileNames(const QString&amp;, QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)">
<modify-argument index="return">
<replace-type modified-type="(fileNames, selectedFilter)"/>
</modify-argument>
<modify-argument index="6">
<replace-type modified-type="QString"/>
<replace-default-expression with="QString()"/>
</modify-argument>
<inject-code class="target" position="end">
<insert-template name="return_for_QFileDialog"/>
</inject-code>
</modify-function>
<modify-function signature="getSaveFileName(const QString&amp;, QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)">
<modify-argument index="return">
<replace-type modified-type="(fileName, selectedFilter)"/>
</modify-argument>
<modify-argument index="6">
<replace-type modified-type="QString"/>
<replace-default-expression with="QString()"/>
</modify-argument>
<inject-code class="target" position="end">
<insert-template name="return_for_QFileDialog"/>
</inject-code>
</modify-function>
</object-type>
<object-type name="SqlDatabase"/> <object-type name="SqlDatabase"/>
<object-type name="ToolButton"/> <object-type name="ToolButton"/>
<value-type name="WheelHelper"> <value-type name="WheelHelper">
@ -210,6 +249,15 @@
PyModule_AddStringConstant(module, "__version__", Qz::VERSION); PyModule_AddStringConstant(module, "__version__", Qz::VERSION);
</inject-code> </inject-code>
<template name="return_for_QFileDialog">
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, &amp;%6, %7);
%END_ALLOW_THREADS
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG6_TYPE](%6));
</template>
<suppress-warning text="Unable to translate type &quot;std::function&lt;QPoint (QSize)&gt;&quot;:*"/> <suppress-warning text="Unable to translate type &quot;std::function&lt;QPoint (QSize)&gt;&quot;:*"/>
<suppress-warning text="Unable to translate type &quot;std::function&lt;void ()&gt;&quot;:*"/> <suppress-warning text="Unable to translate type &quot;std::function&lt;void ()&gt;&quot;:*"/>
<suppress-warning text="skipping field 'ClickController::popupClosed'*"/> <suppress-warning text="skipping field 'ClickController::popupClosed'*"/>