diff --git a/layouts/shortcodes/qmltype.html b/layouts/shortcodes/qmltype.html
index fa5718d..0def484 100644
--- a/layouts/shortcodes/qmltype.html
+++ b/layouts/shortcodes/qmltype.html
@@ -85,11 +85,11 @@
{{- if $type.functions -}}
Functions
- {{- range $funcname, $func := $type.functions -}}
+ {{- range $func := $type.functions -}}
-
{{ partial "qmltype.html" $func.ret }}
- {{ $funcname }}(
+ {{ $func.name }}(
{{- partial "qmlparams.html" $func.params -}}
)
@@ -172,8 +172,8 @@
{{- if $type.functions -}}
Function Details
- {{ range $funcname, $func := $type.functions }}
-
+ {{ range $func := $type.functions }}
+
{{- if $func.flags -}}
{{ partial "qmltypeflags.html" $func.flags }}
@@ -184,7 +184,7 @@
{{ partial "qmltype.html" $func.ret -}}
- {{ $funcname -}}
+ {{ $func.name -}}
(
{{- partial "qmlparams.html" $func.params -}}
)
diff --git a/typegen/src/outform.rs b/typegen/src/outform.rs
index 8d171b1..a6012af 100644
--- a/typegen/src/outform.rs
+++ b/typegen/src/outform.rs
@@ -25,7 +25,7 @@ pub struct ClassInfo {
#[serde(skip_serializing_if = "Vec::is_empty")]
pub flags: Vec,
pub properties: HashMap,
- pub functions: HashMap,
+ pub functions: Vec,
pub signals: HashMap,
}
@@ -50,6 +50,7 @@ pub enum PropertyType {
pub struct Function {
pub ret: Type,
pub name: String,
+ pub id: String,
pub details: Option,
pub params: HashMap,
}
diff --git a/typegen/src/parse.rs b/typegen/src/parse.rs
index a363bbc..3883fb7 100644
--- a/typegen/src/parse.rs
+++ b/typegen/src/parse.rs
@@ -133,7 +133,7 @@ impl Parser {
class_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*class\s+(?\w+)(?:\s*:\s*public\s+(?\w+)(\s*,(\s*\w+)*)*)?\s*\{(?[\s\S]*?)};"#).unwrap(),
macro_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*(?QSDOC_HIDE\s)?(?(Q|QML|QSDOC)_\w+)\s*(\(\s*(?.*)\s*\))?;"#).unwrap(),
property_regex: Regex::new(r#"^\s*(?(\w|::|, |<|>)+)\*?\s+(?\w+)(\s+(MEMBER\s+(?\w+)|READ\s+(?\w+)|WRITE\s+(?\w+)|NOTIFY\s+(?\w+)|(?CONSTANT)))+\s*$"#).unwrap(),
- fn_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*Q_INVOKABLE\s+(?(\w|::|<|>)+\*?)\s+(?\w+)\((?[\s\S]*?)\);"#).unwrap(),
+ fn_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*Q_INVOKABLE\s+(\[\[.*\]\]\s+)?(?(\w|::|<|>)+\*?)\s+(?\w+)\((?[\s\S]*?)\)(\s*const);"#).unwrap(),
signal_regex: Regex::new(r#"(?(\s*\/\/\/.*\n)+)?\s*void\s+(?\w+)\((?[\s\S]*?)\);"#).unwrap(),
fn_param_regex: Regex::new(r#"(const\s+)?(?(\w|::|<|>)+\*?)&?\s+(?\w+)(,|$)"#).unwrap(),
signals_regex: Regex::new(r#"signals:(?(\s*(\s*///.*\s*)*void .*;)*)"#).unwrap(),
diff --git a/typegen/src/resolver.rs b/typegen/src/resolver.rs
index da6d294..f54de9f 100644
--- a/typegen/src/resolver.rs
+++ b/typegen/src/resolver.rs
@@ -146,6 +146,22 @@ pub fn resolve_types(
outform::Function {
ret: qmlparamtype(&func.ret, typespec),
name: func.name.clone(),
+ id: {
+ let params = func.params
+ .iter()
+ .map(|FnParam { type_, .. }| qmlparamtype(type_, typespec).name);
+
+ let mut id = func.name.clone();
+ id.push('(');
+ for param in params {
+ id.push_str(¶m);
+ id.push('_')
+ }
+ id.truncate(id.len() - 1);
+ id.push(')');
+
+ id
+ },
details: func.details.clone(),
params: func
.params
@@ -183,8 +199,8 @@ pub fn resolve_types(
let functions = functions
.iter()
- .map(|func| (func.name.clone(), solvefunc(func, &typespec)))
- .collect::>();
+ .map(|func| solvefunc(func, &typespec))
+ .collect::>();
let signals = signals
.iter()
diff --git a/types/QtQuick.json b/types/QtQuick.json
index 62ba66f..8282009 100644
--- a/types/QtQuick.json
+++ b/types/QtQuick.json
@@ -25,6 +25,16 @@
"cname": "qreal",
"module": null
},
+ {
+ "name": "point",
+ "cname": "QPointF",
+ "module": null
+ },
+ {
+ "name": "rect",
+ "cname": "QRectF",
+ "module": null
+ },
{
"name": "string",
"cname": "QString",