Skip to content

Commit 4ed1667

Browse files
committed
improved completion with jedi by returning correct type and by adding all properties to the class
1 parent 7364b63 commit 4ed1667

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/PythonQtClassInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,9 @@ PythonQtClassInfo* PythonQtClassInfo::getClassInfoForProperty( const QString& na
10341034
}
10351035
}
10361036
if (!typeName.isEmpty()) {
1037+
if (typeName.endsWith("*")) {
1038+
typeName.truncate(typeName.length() - 1);
1039+
}
10371040
PythonQtClassInfo* classInfo = PythonQt::priv()->getClassInfo(typeName);
10381041
return classInfo;
10391042
}

src/PythonQtClassWrapper.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,10 @@ static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
466466
}
467467
PyObject* dict = PyDict_New();
468468

469-
QStringList l = wrapper->classInfo()->memberList();
470-
Q_FOREACH (QString name, l) {
471-
if (name.startsWith("py_get_")) {
472-
// add slot getters as normal properties
473-
name = name.mid(7);
474-
}
469+
QSet<QString> completeSet = QSet<QString>::fromList(wrapper->classInfo()->memberList());
470+
completeSet.unite(QSet<QString>::fromList(wrapper->classInfo()->propertyList()));
471+
472+
Q_FOREACH (QString name, completeSet) {
475473
if (name.startsWith("py_")) {
476474
// do not expose internal slots
477475
continue;

0 commit comments

Comments
 (0)