Skip to content

Allow only scriptable methods and properties #74

Discussion options

You must be logged in to vote

Ok, I have found the solution. The relevant file is PythonQtClassInfo and the relevant methods ar propertyList and memberList. I added tests for scriptable attributes and this worked:

QStringList PythonQtClassInfo::propertyList()
{
  QStringList l;
  if (_isQObject && _meta) {
    int i;
    int numProperties = _meta->propertyCount();
    for (i = 0; i < numProperties; i++) {
      QMetaProperty p = _meta->property(i);
      if (!p.isScriptable()) {
    	  l << QString(p.name());
      }
    }
  }
  QStringList members = memberList();
  foreach(QString member, members) {
    if (member.startsWith("py_get_")) {
      l << member.mid(7);
    }
  }
  return l;
}

QStringList PythonQtClassInf…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrbean-bremen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #67 on October 11, 2022 13:02.