Skip to content

Commit 1a8de2f

Browse files
committed
improved slot docs as provided from forum
1 parent 9d20f34 commit 1a8de2f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/PythonQtSlot.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,17 @@ meth_get__doc__(PythonQtSlotFunctionObject * m, void * /*closure*/)
481481
infoSearch = infoSearch->nextInfo();
482482
}
483483
doc = "X." + info->slotName(true) + "(";
484-
for (int i = 1;i<longestInfo->parameterCount(); i++) {
485-
if (i!=1) {
484+
int firstArgOffset = info->isInstanceDecorator() ? 2 : 1;
485+
QList<QByteArray> names = longestInfo->metaMethod()->parameterNames();
486+
for (int i = firstArgOffset; i < longestInfo->parameterCount(); i++) {
487+
if (i != firstArgOffset) {
486488
doc += ", ";
487489
}
488-
doc += QString('a' + i-1);
490+
if (!names.at(i - 1).isEmpty()) {
491+
doc += names.at(i - 1);
492+
} else {
493+
doc += QString('a' + i - firstArgOffset);
494+
}
489495
}
490496
doc += ")";
491497
QByteArray pyReturnType;

0 commit comments

Comments
 (0)