Skip to content

Commit

Permalink
Released bindings for Qt 5.7.0.
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Sep 13, 2016
1 parent fc165fa commit 78e975d
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 23 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
0.6.0 - 14.9.2016
BREAKING: The bindings are now named according to the pattern:
Qt<module>.Sharp
instead of:
Qt<module>Sharp
All users are asked to update their project files.
Added:
- Bindings for the new modules in Qt 5.7 - Charts, Data Visualization, Purchasing.
Fixed:
- Passing pointers as their secondary bases, such as QPainter(QPaintDevice).

0.5.1 - 12.6.2016
Fixed:
- Regression - Qt events did not work at all. Also restored the ability to handle them.
Expand Down
13 changes: 12 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
Copyright 2013-2014 Dimitar Dobrev
Copyright 2013-2016 Dimitar Dobrev

IMPORTANT: The Apache License below does not include the
following bindings:
- QtCharts.Sharp;
- QtDataVisualization.Sharp;
They are licensed under GPLv3 instead as they link GPLv3 code.
You may obtain a copy of GPLv3 at

https://www.gnu.org/licenses/gpl-3.0.en.html



Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
14 changes: 9 additions & 5 deletions QtSharp.CLI/QtSharp.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.AST.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Generator.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Parser.CLI.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.5.2\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion QtSharp.CLI/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
<package id="CppSharp" version="0.7.0" targetFramework="net451" developmentDependency="true" />
<package id="CppSharp" version="0.7.1" targetFramework="net451" developmentDependency="true" />
</packages>
10 changes: 9 additions & 1 deletion QtSharp/GenerateEventEventsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ where this.events.Contains(block.Declaration)
foreach (var block in blocks)
{
var method = (Function) block.Declaration;
var @event = char.ToUpperInvariant(method.OriginalName[0]) + method.OriginalName.Substring(1);
string @event;
if (((Class) method.Namespace).Methods.Any(m => m != method && m.OriginalName == method.OriginalName))
{
@event = method.OriginalName;
}
else
{
@event = char.ToUpperInvariant(method.OriginalName[0]) + method.OriginalName.Substring(1);
}
var blockIndex = block.Parent.Blocks.IndexOf(block);
var eventBlock = new Block(CSharpBlockKind.Event);
eventBlock.WriteLine("public event global::System.Action<object, {0}> {1};",
Expand Down
8 changes: 2 additions & 6 deletions QtSharp/GenerateSignalEventsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,10 @@ private void HandleQSignal(Class @class, Method method)
for (int i = 0; i < @class.Specifiers.Count; i++)
{
var accessSpecifierDecl = @class.Specifiers[i];
if (accessSpecifierDecl.LineNumberStart <= method.LineNumberStart &&
if (accessSpecifierDecl.DebugText == "Q_SIGNALS:" &&
accessSpecifierDecl.LineNumberStart < method.LineNumberStart &&
(i == @class.Specifiers.Count - 1 || method.LineNumberEnd <= @class.Specifiers[i + 1].LineNumberStart))
{
var expansions = accessSpecifierDecl.PreprocessedEntities.OfType<MacroExpansion>();
if (expansions.All(e => e.Text != "Q_SIGNALS"))
{
return;
}
if (method.Parameters.Any())
{
Class decl;
Expand Down
15 changes: 13 additions & 2 deletions QtSharp/QtSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Preprocess(Driver driver, ASTContext lib)
foreach (var unit in lib.TranslationUnits.Where(u => u.IsValid))
{
// HACK: work around https://github.com/mono/CppSharp/issues/677
if (unit.FileName == "locale_classes.tcc")
if (unit.FileName == "locale_classes.tcc" || unit.FileName == "locale_facets.tcc")
{
unit.ExplicitlyIgnore();
}
Expand Down Expand Up @@ -260,9 +260,20 @@ public void Setup(Driver driver)
string qtModule = GetModuleNameFromLibFile(libFile);
var module = new CppSharp.AST.Module();
module.LibraryName = string.Format("{0}.Sharp", qtModule);
module.OutputNamespace = qtModule;
module.Headers.Add(qtModule);
var moduleName = qtModule.Substring(qt.Length);
// some Qt modules have their own name-spaces
if (moduleName == "Charts" || moduleName == "QtDataVisualization" ||
moduleName.StartsWith("3D", System.StringComparison.Ordinal))
{
module.OutputNamespace = string.Empty;
module.InlinesLibraryName = string.Format("{0}-inlines", qtModule);
module.TemplatesLibraryName = string.Format("{0}-templates", qtModule);
}
else
{
module.OutputNamespace = qtModule;
}
if (Platform.IsMacOS)
{
var framework = string.Format("{0}.framework", qtModule);
Expand Down
12 changes: 6 additions & 6 deletions QtSharp/QtSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.AST.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Generator.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Parser.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Parser.CLI.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.0\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.7.1\lib\CppSharp.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion QtSharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
<package id="CppSharp" version="0.7.0" targetFramework="net451" developmentDependency="true" />
<package id="CppSharp" version="0.7.1" targetFramework="net451" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net451" />
<package id="zlib.net" version="1.0.4" targetFramework="net451" />
</packages>

0 comments on commit 78e975d

Please sign in to comment.