Skip to content

Commit

Permalink
Make QML parse error raise a Julia error
Browse files Browse the repository at this point in the history
Issue #49
  • Loading branch information
barche committed Oct 12, 2017
1 parent a76a1c6 commit b26ae10
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/src/qmlwrap/wrap_qml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ JULIA_CPP_MODULE_BEGIN(registry)
if(!success)
{
e->quit();
jl_error("Error loading QML");
}
return success;
});

qml_module.method("qt_prefix_path", []() { return QLibraryInfo::location(QLibraryInfo::PrefixPath); });
Expand Down
7 changes: 7 additions & 0 deletions test/badqml.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using QML
try
@qmlapp joinpath(dirname(@__FILE__), "qml", "badqml.qml")
exec()
catch e
@test e.msg == "Error loading QML"
end
2 changes: 1 addition & 1 deletion test/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ set_state2 = TestModuleFunction.set_state2
qmlfunction("unexported_return_two", UnExported.return_two)
qmlfunction("unexported_check", UnExported.check)

@test(@qmlapp joinpath(dirname(@__FILE__), "qml", "functions.qml"))
@qmlapp joinpath(dirname(@__FILE__), "qml", "functions.qml")
exec()

stringresult = VERSION < v"0.5-dev" ? ASCIIString : String
Expand Down
7 changes: 7 additions & 0 deletions test/qml/badqml.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import QtQuick 2.7
import QtQuick.Controls 1.5

ApplicationWindow {
visible: true
fail
}

0 comments on commit b26ae10

Please sign in to comment.