Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template / findchild Support #50

Open
Hecatron opened this issue Dec 18, 2016 · 3 comments
Open

Template / findchild Support #50

Hecatron opened this issue Dec 18, 2016 · 3 comments

Comments

@Hecatron
Copy link
Contributor

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

@ddobrev
Copy link
Owner

ddobrev commented Dec 18, 2016

@grbd QtQFindChildHelper is not a documented function as far as I can see. I would try it in C++ and see if I get any results there.
The good news is that I've been working on support for templates for a few weeks now. I expect them to be complete in no more than a month from now. I have just solved a critical problem and a large part of class templates will be fully operational. Function templates are going to take a while more but they would pose little trouble compared to class templates.

@Hecatron
Copy link
Contributor Author

That's great thanks for the info

@tezine
Copy link

tezine commented May 16, 2017

Hi Dimitar, is there any workaround to QObject.QtQFindChildHelper?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants