diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-11 15:26:55 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-12 04:50:58 +0000 |
commit | dbb78237ef6622a2daae32fa3f5fa0cd9b1ffda5 (patch) | |
tree | 19ed9388e1013095f6ca0f6ab8f30d2139ba640c | |
parent | 9f7532987dfcebb195fc46a9349975e00ab4ea62 (diff) |
shiboken: Line-wrap message about not find function for modification
Put each candidate on a new line and limit the number of member
functions in the output.
Change-Id: Ia628e61009997b37e0f3c2129fba5ccfa29f763e
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 8 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/messages.cpp | 20 |
2 files changed, 15 insertions, 13 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 9331259ca..19e571169 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -4402,7 +4402,7 @@ s1.addTransition(button.clicked, s1h)</code> <suppress-warning text="unhandled enum value: (sizeof(void*)<<3) in QSysInfo::Sizes"/> <suppress-warning text="unmatched enum ~0u"/> <suppress-warning text="unmatched enum (sizeof(void*)<<3)"/> - <suppress-warning text="signature 'setCustomType(float)' for function modification in 'QEasingCurve' not found. Possible candidates: setCustomType(double) in QEasingCurve"/> + <suppress-warning text="^signature 'setCustomType(float)' for function modification in 'QEasingCurve' not found.*$"/> <suppress-warning text="enum 'enum_4' does not have a type entry or is not an enum" /> <suppress-warning text="enum 'enum_5' does not have a type entry or is not an enum" /> <suppress-warning text="enum 'FP_NORMAL' does not have a type entry or is not an enum" /> @@ -4412,11 +4412,11 @@ s1.addTransition(button.clicked, s1h)</code> <suppress-warning text="enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum" /> <!-- this function only exists on Windows --> - <suppress-warning text="signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found. Possible candidates:*"/> + <suppress-warning text="^signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found.*"/> <!-- this is necessary to avoid warning on other modules --> - <suppress-warning text="signature 'operator*(QByteArray,const char*)' for function modification in 'QByteArray' not found. Possible candidates:*"/> - <suppress-warning text="signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found. Possible candidates:*"/> + <suppress-warning text="^signature 'operator*(QByteArray,const char*)' for function modification in 'QByteArray' not found.*"/> + <suppress-warning text="^signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found.*"/> <!-- This enum is intenaly used --> <suppress-warning text="enum 'PM_CbaIconHeight' does not have a type entry or is not an enum" /> diff --git a/sources/shiboken2/ApiExtractor/messages.cpp b/sources/shiboken2/ApiExtractor/messages.cpp index c4537ee39..b81585933 100644 --- a/sources/shiboken2/ApiExtractor/messages.cpp +++ b/sources/shiboken2/ApiExtractor/messages.cpp @@ -55,15 +55,17 @@ QString msgNoFunctionForModification(const QString &signature, str << " (specified as '" << originalSignature << "')"; str << " for function modification in '" << className << "' not found."; - if (possibleSignatures.isEmpty()) { - str << " No candidates were found. Member functions: "; - for (int f = 0, size = allFunctions.size(); f < size; ++f) { - if (f) - str << ", "; - str << allFunctions.at(f)->minimalSignature(); - } - } else { - str << " Possible candidates: " << possibleSignatures.join(QLatin1String(", ")); + if (!possibleSignatures.isEmpty()) { + str << "\n Possible candidates:\n"; + for (const auto &s : possibleSignatures) + str << " " << s << '\n'; + } else if (!allFunctions.isEmpty()) { + str << "\n No candidates were found. Member functions:\n"; + const int maxCount = qMin(10, allFunctions.size()); + for (int f = 0; f < maxCount; ++f) + str << " " << allFunctions.at(f)->minimalSignature() << '\n'; + if (maxCount < allFunctions.size()) + str << " ...\n"; } return result; } |