Skip to content

Commit d279d68

Browse files
committed
Wrapped QtQuick (just the library, no QML support yet) and QtMultimedia.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 5750b55 commit d279d68

File tree

6 files changed

+56
-2
lines changed

6 files changed

+56
-2
lines changed

CHANGELOG

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
0.0.6 - 11.12.2015
2+
Added:
3+
- Bindings for QtQuick (just the library, no QtQuick/QML support yet) and QtMultimedia.
4+
5+
0.0.5 - 19.11.2015
6+
Added:
7+
- A binding for QtQml (just the library, no QtQuick/QML support yet).
8+
19
0.0.4 - 18.11.2015
210
Added:
311
- A binding for QtNetwork.

QtSharp.CLI/Program.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ public static int Main(string[] args)
109109
"Qt5ScriptTools",
110110
"Qt5Sensors",
111111
"Qt5SerialPort",
112-
"Qt5Svg"
112+
"Qt5Svg",
113+
"Qt5Multimedia",
114+
"Qt5Quick"
113115
};
114116
if (debug)
115117
{

QtSharp/GenerateSignalEventsPass.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ public override bool VisitClassDecl(Class @class)
139139
return false;
140140
}
141141
foreach (var method in from method in @class.Methods
142-
where method.Access != AccessSpecifier.Private && method.AccessDecl != null
142+
where method.Access != AccessSpecifier.Private && method.AccessDecl != null &&
143+
// HACK: work around https://llvm.org/bugs/show_bug.cgi?id=24655
144+
!method.IsConstructor && !method.IsDestructor && !method.IsOperator
143145
select method)
144146
{
145147
this.HandleQSignal(@class, method);

QtSharp/IQQmlParserStatus.cs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
namespace QtQml
2+
{ /// <summary>
3+
/// <para>The QQmlParserStatus class provides updates on the QML parser state.</para>
4+
/// </summary>
5+
/// <remarks>
6+
/// <para>QQmlParserStatus provides a mechanism for classes instantiated by a QQmlEngine to receive notification at key points in their creation.</para>
7+
/// <para>This class is often used for optimization purposes, as it allows you to defer an expensive operation until after all the properties have been set on an object. For example, QML's Text element uses the parser status to defer text layout until all of its properties have been set (we don't want to layout when the text is assigned, and then relayout when the font is assigned, and relayout again when the width is assigned, and so on).</para>
8+
/// <para>Be aware that QQmlParserStatus methods are only called when a class is instantiated by a QQmlEngine. If you create the same class directly from C++, these methods will not be called automatically. To avoid this problem, it is recommended that you start deferring operations from classBegin instead of from the initial creation of your class. This will still prevent multiple revaluations during initial binding assignment in QML, but will not defer operations invoked from C++.</para>
9+
/// <para>To use QQmlParserStatus, you must inherit both a QObject-derived class and QQmlParserStatus, and use the Q_INTERFACES() macro.</para>
10+
/// <para>class MyObject : public QObject, public QQmlParserStatus</para>
11+
/// <para>{</para>
12+
/// <para> Q_OBJECT</para>
13+
/// <para> Q_INTERFACES(QQmlParserStatus)</para>
14+
/// <para></para>
15+
/// <para>public:</para>
16+
/// <para> MyObject(QObject *parent = 0);</para>
17+
/// <para> ...</para>
18+
/// <para> void classBegin();</para>
19+
/// <para> void componentComplete();</para>
20+
/// <para>}</para>
21+
/// <para>The Qt Quick 1 version of this class is named QDeclarativeParserStatus.</para>
22+
/// </remarks>
23+
public unsafe partial interface IQQmlParserStatus
24+
{
25+
/// <summary>
26+
/// <para>Invoked after class creation, but before any properties have been set.</para>
27+
/// </summary>
28+
void ClassBegin();
29+
30+
/// <summary>
31+
/// <para>Invoked after the root component that caused this instantiation has completed construction. At this point all static values and binding values have been assigned to the class.</para>
32+
/// </summary>
33+
void ComponentComplete();
34+
}
35+
}

QtSharp/QtSharp.cs

+4
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ public void Setup(Driver driver)
195195
// HACK: work around https://github.com/mono/CppSharp/issues/582
196196
driver.Options.CodeFiles.Add(Path.Combine(dir, "IQAccessibleActionInterface.cs"));
197197
break;
198+
case "Qml":
199+
// HACK: work around https://github.com/mono/CppSharp/issues/582
200+
driver.Options.CodeFiles.Add(Path.Combine(dir, "IQQmlParserStatus.cs"));
201+
break;
198202
}
199203
var extension = Path.GetExtension(this.library);
200204
this.LibraryName = driver.Options.LibraryName + extension;

QtSharp/QtSharp.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
<None Include="IQAccessibleActionInterface.cs">
7373
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7474
</None>
75+
<None Include="IQQmlParserStatus.cs">
76+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
77+
</None>
7578
<Compile Include="Properties\AssemblyInfo.cs" />
7679
<Compile Include="ProcessHelper.cs" />
7780
<None Include="packages.config" />

0 commit comments

Comments
 (0)