Skip to content

Commit 78e975d

Browse files
committed
Released bindings for Qt 5.7.0.
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent fc165fa commit 78e975d

9 files changed

+64
-23
lines changed

CHANGELOG

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
0.6.0 - 14.9.2016
2+
BREAKING: The bindings are now named according to the pattern:
3+
Qt<module>.Sharp
4+
instead of:
5+
Qt<module>Sharp
6+
All users are asked to update their project files.
7+
Added:
8+
- Bindings for the new modules in Qt 5.7 - Charts, Data Visualization, Purchasing.
9+
Fixed:
10+
- Passing pointers as their secondary bases, such as QPainter(QPaintDevice).
11+
112
0.5.1 - 12.6.2016
213
Fixed:
314
- Regression - Qt events did not work at all. Also restored the ability to handle them.

LICENSE

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
Copyright 2013-2014 Dimitar Dobrev
1+
Copyright 2013-2016 Dimitar Dobrev
22

3+
IMPORTANT: The Apache License below does not include the
4+
following bindings:
5+
- QtCharts.Sharp;
6+
- QtDataVisualization.Sharp;
7+
They are licensed under GPLv3 instead as they link GPLv3 code.
8+
You may obtain a copy of GPLv3 at
9+
10+
https://www.gnu.org/licenses/gpl-3.0.en.html
11+
12+
13+
314
Licensed under the Apache License, Version 2.0 (the "License");
415
you may not use this file except in compliance with the License.
516
You may obtain a copy of the License at

QtSharp.CLI/QtSharp.CLI.csproj

+9-5
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,27 @@
6363
</PropertyGroup>
6464
<ItemGroup>
6565
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
66-
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.dll</HintPath>
66+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.dll</HintPath>
6767
<Private>True</Private>
6868
</Reference>
6969
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
70-
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.AST.dll</HintPath>
70+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.AST.dll</HintPath>
7171
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
74-
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Generator.dll</HintPath>
74+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Generator.dll</HintPath>
75+
<Private>True</Private>
76+
</Reference>
77+
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
78+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.dll</HintPath>
7579
<Private>True</Private>
7680
</Reference>
7781
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
78-
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Parser.CLI.dll</HintPath>
82+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.CLI.dll</HintPath>
7983
<Private>True</Private>
8084
</Reference>
8185
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
82-
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Runtime.dll</HintPath>
86+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Runtime.dll</HintPath>
8387
<Private>True</Private>
8488
</Reference>
8589
<Reference Include="System" />

QtSharp.CLI/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
4-
<package id="CppSharp" version="0.7.0" targetFramework="net451" developmentDependency="true" />
4+
<package id="CppSharp" version="0.7.1" targetFramework="net451" developmentDependency="true" />
55
</packages>

QtSharp/GenerateEventEventsPass.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ where this.events.Contains(block.Declaration)
3535
foreach (var block in blocks)
3636
{
3737
var method = (Function) block.Declaration;
38-
var @event = char.ToUpperInvariant(method.OriginalName[0]) + method.OriginalName.Substring(1);
38+
string @event;
39+
if (((Class) method.Namespace).Methods.Any(m => m != method && m.OriginalName == method.OriginalName))
40+
{
41+
@event = method.OriginalName;
42+
}
43+
else
44+
{
45+
@event = char.ToUpperInvariant(method.OriginalName[0]) + method.OriginalName.Substring(1);
46+
}
3947
var blockIndex = block.Parent.Blocks.IndexOf(block);
4048
var eventBlock = new Block(CSharpBlockKind.Event);
4149
eventBlock.WriteLine("public event global::System.Action<object, {0}> {1};",

QtSharp/GenerateSignalEventsPass.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,10 @@ private void HandleQSignal(Class @class, Method method)
163163
for (int i = 0; i < @class.Specifiers.Count; i++)
164164
{
165165
var accessSpecifierDecl = @class.Specifiers[i];
166-
if (accessSpecifierDecl.LineNumberStart <= method.LineNumberStart &&
166+
if (accessSpecifierDecl.DebugText == "Q_SIGNALS:" &&
167+
accessSpecifierDecl.LineNumberStart < method.LineNumberStart &&
167168
(i == @class.Specifiers.Count - 1 || method.LineNumberEnd <= @class.Specifiers[i + 1].LineNumberStart))
168169
{
169-
var expansions = accessSpecifierDecl.PreprocessedEntities.OfType<MacroExpansion>();
170-
if (expansions.All(e => e.Text != "Q_SIGNALS"))
171-
{
172-
return;
173-
}
174170
if (method.Parameters.Any())
175171
{
176172
Class decl;

QtSharp/QtSharp.cs

+13-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Preprocess(Driver driver, ASTContext lib)
3636
foreach (var unit in lib.TranslationUnits.Where(u => u.IsValid))
3737
{
3838
// HACK: work around https://github.com/mono/CppSharp/issues/677
39-
if (unit.FileName == "locale_classes.tcc")
39+
if (unit.FileName == "locale_classes.tcc" || unit.FileName == "locale_facets.tcc")
4040
{
4141
unit.ExplicitlyIgnore();
4242
}
@@ -260,9 +260,20 @@ public void Setup(Driver driver)
260260
string qtModule = GetModuleNameFromLibFile(libFile);
261261
var module = new CppSharp.AST.Module();
262262
module.LibraryName = string.Format("{0}.Sharp", qtModule);
263-
module.OutputNamespace = qtModule;
264263
module.Headers.Add(qtModule);
265264
var moduleName = qtModule.Substring(qt.Length);
265+
// some Qt modules have their own name-spaces
266+
if (moduleName == "Charts" || moduleName == "QtDataVisualization" ||
267+
moduleName.StartsWith("3D", System.StringComparison.Ordinal))
268+
{
269+
module.OutputNamespace = string.Empty;
270+
module.InlinesLibraryName = string.Format("{0}-inlines", qtModule);
271+
module.TemplatesLibraryName = string.Format("{0}-templates", qtModule);
272+
}
273+
else
274+
{
275+
module.OutputNamespace = qtModule;
276+
}
266277
if (Platform.IsMacOS)
267278
{
268279
var framework = string.Format("{0}.framework", qtModule);

QtSharp/QtSharp.csproj

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,27 @@
3838
</PropertyGroup>
3939
<ItemGroup>
4040
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.dll</HintPath>
41+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.dll</HintPath>
4242
<Private>True</Private>
4343
</Reference>
4444
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
45-
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.AST.dll</HintPath>
45+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.AST.dll</HintPath>
4646
<Private>True</Private>
4747
</Reference>
4848
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
49-
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Generator.dll</HintPath>
49+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Generator.dll</HintPath>
5050
<Private>True</Private>
5151
</Reference>
5252
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
53-
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Parser.dll</HintPath>
53+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.dll</HintPath>
5454
<Private>True</Private>
5555
</Reference>
5656
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
57-
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Parser.CLI.dll</HintPath>
57+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.CLI.dll</HintPath>
5858
<Private>True</Private>
5959
</Reference>
6060
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
61-
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Runtime.dll</HintPath>
61+
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Runtime.dll</HintPath>
6262
<Private>True</Private>
6363
</Reference>
6464
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">

QtSharp/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
4-
<package id="CppSharp" version="0.7.0" targetFramework="net451" developmentDependency="true" />
4+
<package id="CppSharp" version="0.7.1" targetFramework="net451" developmentDependency="true" />
55
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net451" />
66
<package id="zlib.net" version="1.0.4" targetFramework="net451" />
77
</packages>

0 commit comments

Comments
 (0)