Skip to content

Template / findchild Support #50

Open
@Hecatron

Description

@Hecatron

From what I understand CppSharp currently has problems with support for template functions
in order to get a list of all child QWidgets within a QWidget you need to use the findchild() method
but this isn't included because it's a function with a template parameter

display->findChild<QPushButton *>("bar");
display->findChildren<QWidget *>();

This is the one thing stopping me from using QtSharp at the moment
I did notice there's a QObject.QtQFindChildHelper function, but so far I've not managed to get it to work
the result is always null

QMetaObject meta = QWidget.QtGetQtMetaObject;
//QMetaObject meta = QWidget.StaticMetaObject;
var opts = QtCore.Qt.FindChildOption.FindChildrenRecursively;
var result = QObject.QtQFindChildHelper(parent, "*", meta, opts);
  • Is there any info on if CppSharp is any closer to Template function support?
  • Has anyone else figured out how to get QtQFindChildHelper working?

The closets I got was ChildAt(x,y) but that relies on knowing the cordinates before hand of the child control

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions