Added no-argument function generation
ClosedPublic

Authored by keeslinp on Oct 14 2017, 3:38 AM.

Details

Summary

Updated functions to accept and return strings

Diff Detail

Repository
R881 Rust Qt Binding Generator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
keeslinp created this revision.Oct 14 2017, 3:38 AM
keeslinp added a comment.EditedOct 14 2017, 3:41 AM

Example of use can be found in todo https://github.com/keeslinp/qml_todo.

I'm sure there are probably improvements that can be made, I've just been pretty busy so I wanted to get something submitted while I had the chance so we can work from there.

vandenoever added a comment.EditedOct 14 2017, 8:45 AM

Looking good. I tested with some simple functions with bool and QString and I'm happy to have this feature.

This is a significant feature so a/some unit tests in tests would be good.

For now functions should accept and return only simple types, not ones that are defined in the binding. Please add a check for that.

'void' return type is not supported yet. It is the most basic type.

'void' is not a supported type. Use one of
     bool
     quint8 (u8)
     qint32 (i32)
     quint32 (u32)
     quint64 (u64)
     float (f32)
     QString (String)
     QByteArray (Vec<u8>)
     Demo
     Fibonacci
     FibonacciList
     FileSystemTree
     Processes
     TimeSeries
src/cpp.cpp
522

Add a new line after function declaration.

keeslinp updated this revision to Diff 20766.Oct 14 2017, 11:57 PM
  • Added unit test for function, cleaned up an missing endline, added void, and added check for dynamic types
keeslinp marked an inline comment as done.Oct 15 2017, 12:01 AM

I think I got the check for user-declared types correct. I assume that pretty much excludes all Object types?

vandenoever accepted this revision.Oct 15 2017, 7:17 AM

Great patch, Pearce!

I suggest you push this patch yourself. Please apply for developer account.

https://identity.kde.org/index.php?r=developerApplication

You can point to this comment as a reference for the application.

This revision is now accepted and ready to land.Oct 15 2017, 7:17 AM

I've applied, I'll keep you posted. Thanks for the recommendation!

This revision was automatically updated to reflect the committed changes.