aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py4
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp16
2 files changed, 15 insertions, 5 deletions
diff --git a/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py b/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
index 6ea3aa95a..b4aef26d1 100644
--- a/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
+++ b/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
@@ -39,11 +39,7 @@ class MainTest(unittest.TestCase):
qApp = (QtWidgets.QApplication.instance() or
QtWidgets.QApplication([]))
view = QtWebEngineWidgets.QWebEngineView()
- with self.assertRaises(TypeError):
- view.findText(123)
view.findText("nothing")
- # we are testing only the existence of the function,
- # after it suddenly showed up.
if __name__ == '__main__':
unittest.main()
diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
index 739e32896..b862ba548 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp
@@ -2088,6 +2088,20 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(FunctionModel
bool ok;
AbstractMetaType* metaType = translateType(arg->type(), &ok);
if (!ok) {
+ // If an invalid argument has a default value, simply remove it
+ if (arg->defaultValue()) {
+ if (!m_currentClass
+ || (m_currentClass->typeEntry()->codeGeneration()
+ & TypeEntry::GenerateTargetLang)) {
+ qCWarning(lcShiboken).noquote().nospace()
+ << "Stripping argument #" << (i + 1) << " of "
+ << originalQualifiedSignatureWithReturn
+ << " due to unmatched type \"" << arg->type().toString()
+ << "\" with default expression \""
+ << arg->defaultValueExpression() << "\".";
+ }
+ break;
+ }
Q_ASSERT(metaType == 0);
const QString reason = msgUnmatchedParameterType(arg, i);
qCWarning(lcShiboken).noquote().nospace()
@@ -2123,7 +2137,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(FunctionModel
metaFunction->setArguments(metaArguments);
// Find the correct default values
- for (int i = 0; i < arguments.size(); ++i) {
+ for (int i = 0, size = metaArguments.size(); i < size; ++i) {
ArgumentModelItem arg = arguments.at(i);
AbstractMetaArgument* metaArg = metaArguments.at(i);