Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ddobrev/QtSharp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.6.1
Choose a base ref
...
head repository: ddobrev/QtSharp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Sep 24, 2016

  1. Added links to examples and instructions for getting started.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Sep 24, 2016
    Copy the full SHA
    9b45c07 View commit details

Commits on Oct 1, 2016

  1. Compiled all inlines into a single library thus decreasing their size…

    … from 58 to 4 MB.
    
    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Oct 1, 2016
    Copy the full SHA
    e5a240a View commit details
  2. Removed sealed overrides from the bindings by updating C++#.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Oct 1, 2016
    Copy the full SHA
    f3f5b1c View commit details
  3. Moved the inlines for GPL-only/commercial-only modules to a separate …

    …library.
    
    This way people who don't want to use GPL-ed code can safely do so.
    
    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Oct 1, 2016
    Copy the full SHA
    d91f99c View commit details
  4. Revert "Compiled all inlines into a single library thus decreasing th…

    …eir size from 58 to 4 MB."
    
    This reverts commit e5a240a.
    
    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Oct 1, 2016
    Copy the full SHA
    06dc367 View commit details

Commits on Oct 25, 2016

  1. Updated to the latest C++#.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Oct 25, 2016
    Copy the full SHA
    c87bf12 View commit details

Commits on Nov 1, 2016

  1. Updated to the latest C++#.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Nov 1, 2016
    Copy the full SHA
    00f3329 View commit details

Commits on Nov 2, 2016

  1. Updated to the latest C++# to fix regressions with secondary bases.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Nov 2, 2016
    Copy the full SHA
    c8118c3 View commit details

Commits on Nov 17, 2016

  1. Updated C++# in order not to manually ignore functions which use exte…

    …rnal types.
    
    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Nov 17, 2016
    Copy the full SHA
    b9a9295 View commit details

Commits on Dec 18, 2016

  1. Fixes to ProcessHelper

    Hecatron committed Dec 18, 2016
    Copy the full SHA
    58ace37 View commit details
  2. Merge pull request #49 from grbd/master

    Thank you.
    ddobrev authored Dec 18, 2016
    Copy the full SHA
    669bf4a View commit details

Commits on Jan 22, 2017

  1. Updated to the latest C++#.

    ddobrev committed Jan 22, 2017
    Copy the full SHA
    12a701c View commit details

Commits on Feb 5, 2017

  1. Copy the full SHA
    887a8c3 View commit details
  2. Copy the full SHA
    36cf51b View commit details
  3. Copy the full SHA
    5dc69ae View commit details

Commits on Feb 10, 2017

  1. Fixed crashes when calling inlined constructors and destructors.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Feb 10, 2017
    Copy the full SHA
    3a1df3e View commit details

Commits on Feb 12, 2017

  1. Simplified the process helper and removed redundant code.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Feb 12, 2017
    Copy the full SHA
    8836d7a View commit details

Commits on Mar 4, 2017

  1. Updated to the latest C++# in order to reduce the code for compiling …

    …inlines.
    
    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Mar 4, 2017
    Copy the full SHA
    829e3a5 View commit details

Commits on Jul 18, 2017

  1. Updated to the latest C++#.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Jul 18, 2017
    Copy the full SHA
    e50d94f View commit details

Commits on Sep 17, 2017

  1. Updated to the latest C++# to use the handling of array parameters.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Sep 17, 2017
    Copy the full SHA
    d509ac6 View commit details

Commits on Sep 19, 2017

  1. Fixed a crash when creating an object while handling a Qt meta-call.

    Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
    ddobrev committed Sep 19, 2017
    Copy the full SHA
    e231735 View commit details

Commits on Jun 26, 2019

  1. Update README.md

    ddobrev authored Jun 26, 2019
    Copy the full SHA
    b055d89 View commit details
19 changes: 19 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
0.7.3 - 19.9.2017
Fixed:
- Crash when creating an object while handling a Qt meta-call.

0.7.2 - 18.9.2017
Added:
- Bindings for the constructors of QImage and QPixmap taking arrays;
- Bindings for QGraphicsScene::drawItems, QGraphicsView::drawItems and QAbstractVideoBuffer::mapPlanes.

0.7.1 - 10.2.2017
Fixed:
- Crashes when calling certain constructors and destructors.

0.7.0 - 5.2.2017
Added:
- Bindings for Qt 5.8.
Fixed:
- Decreased the size of inlines 24 times, from 60 to 2,5 total size.

0.6.1 - 17.9.2016
Fixed:
- Removed all mappings to C# structures because their empty constructors are not correctly wrapped yet.
50 changes: 15 additions & 35 deletions QtSharp.CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -4,8 +4,10 @@
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using CppSharp;
using CppSharp.Utils;

namespace QtSharp.CLI
{
@@ -87,18 +89,19 @@ static bool QueryQt(QtInfo qt, bool debug)
path = Path.GetDirectoryName(qt.Make) + Path.PathSeparator + path;
Environment.SetEnvironmentVariable("Path", path, EnvironmentVariableTarget.Process);

string error;
qt.Bins = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_BINS", out error);
if (!string.IsNullOrEmpty(error))
int error;
string errorMessage;
qt.Bins = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_BINS", out error, out errorMessage);
if (!string.IsNullOrEmpty(errorMessage))
{
Console.WriteLine(error);
Console.WriteLine(errorMessage);
return false;
}

qt.Libs = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_LIBS", out error);
if (!string.IsNullOrEmpty(error))
qt.Libs = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_LIBS", out error, out errorMessage);
if (!string.IsNullOrEmpty(errorMessage))
{
Console.WriteLine(error);
Console.WriteLine(errorMessage);
return false;
}

@@ -111,10 +114,10 @@ static bool QueryQt(QtInfo qt, bool debug)
return false;
}
qt.LibFiles = GetLibFiles(libsInfo, debug);
qt.Headers = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_HEADERS", out error);
if (!string.IsNullOrEmpty(error))
qt.Headers = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_HEADERS", out error, out errorMessage);
if (!string.IsNullOrEmpty(errorMessage))
{
Console.WriteLine(error);
Console.WriteLine(errorMessage);
return false;
}
DirectoryInfo headersInfo = new DirectoryInfo(qt.Headers);
@@ -125,11 +128,11 @@ static bool QueryQt(QtInfo qt, bool debug)
headersInfo.Name);
return false;
}
qt.Docs = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_DOCS", out error);
qt.Docs = ProcessHelper.Run(qt.QMake, "-query QT_INSTALL_DOCS", out error, out errorMessage);

string emptyFile = Platform.IsWindows ? "NUL" : "/dev/null";
string output;
ProcessHelper.Run("gcc", string.Format("-v -E -x c++ {0}", emptyFile), out output, waitForExit: !Platform.IsWindows);
ProcessHelper.Run("gcc", $"-v -E -x c++ {emptyFile}", out error, out output);
qt.Target = Regex.Match(output, @"Target:\s*(?<target>[^\r\n]+)").Groups["target"].Value;

const string includeDirsRegex = @"#include <\.\.\.> search starts here:(?<includes>.+)End of search list";
@@ -138,7 +141,6 @@ static bool QueryQt(QtInfo qt, bool debug)
.Select(s => s.Trim()).ToList();

const string frameworkDirectory = "(framework directory)";

qt.SystemIncludeDirs = includeDirs.Where(s => !s.Contains(frameworkDirectory))
.Select(Path.GetFullPath);

@@ -149,24 +151,6 @@ static bool QueryQt(QtInfo qt, bool debug)
return true;
}

static void ProcessGeneratedInlines ()
{
if (!Platform.IsWindows)
return;

#if DEBUG
if (File.Exists("../../../QtSharp.Tests/bin/Debug/QtCore-inlines.dll"))
File.Delete("../../../QtSharp.Tests/bin/Debug/QtCore-inlines.dll");

File.Copy("release/QtCore-inlines.dll", "../../../QtSharp.Tests/bin/Debug/QtCore-inlines.dll");
#else
if (File.Exists("../../../QtSharp.Tests/bin/Release/QtCore-inlines.dll"))
File.Delete("../../../QtSharp.Tests/bin/Release/QtCore-inlines.dll");

File.Copy ("release/QtCore-inlines.dll", "../../../QtSharp.Tests/bin/Release/QtCore-inlines.dll");
#endif
}

public static int Main(string[] args)
{
Stopwatch s = Stopwatch.StartNew();
@@ -202,8 +186,6 @@ public static int Main(string[] args)
var libFile = qt.LibFiles[i];
var libFileName = Path.GetFileNameWithoutExtension(libFile);
if (Path.GetExtension(libFile) == ".exe" ||
// QtDeclarative is obsolete and at the same time its headers cause conflicts with its successor of QtQuick
libFileName == "QtDeclarative" || libFileName == "Qt5Declarative" ||
// QtQuickTest is a QML module but has 3 main C++ functions and is not auto-ignored
libFileName == "QtQuickTest" || libFileName == "Qt5QuickTest")
{
@@ -214,8 +196,6 @@ public static int Main(string[] args)
ConsoleDriver.Run(qtSharp);
var wrappedModules = qtSharp.GetVerifiedWrappedModules();

ProcessGeneratedInlines();

if (wrappedModules.Count == 0)
{
Console.WriteLine("Generation failed.");
40 changes: 25 additions & 15 deletions QtSharp.CLI/QtSharp.CLI.csproj
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>QtSharp.CLI</RootNamespace>
<AssemblyName>QtSharp.CLI</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
@@ -63,27 +63,37 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\CppSharp.0.8.14\lib\CppSharp.dll</HintPath>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\CppSharp.0.8.14\lib\CppSharp.AST.dll</HintPath>
</Reference>
<Reference Include="CppSharp.Generator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
<Reference Include="CppSharp.Generator, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.14\lib\CppSharp.Generator.dll</HintPath>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\CppSharp.0.8.14\lib\CppSharp.Parser.dll</HintPath>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\CppSharp.0.8.14\lib\CppSharp.Parser.CLI.dll</HintPath>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.7.2\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.14\lib\CppSharp.Runtime.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
@@ -111,12 +121,12 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" />
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Baseclass.Contrib.Nuget.Output.2.1.0\build\net40\Baseclass.Contrib.Nuget.Output.targets'))" />
<Error Condition="!Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Baseclass.Contrib.Nuget.Output.2.3.0\build\net40\Baseclass.Contrib.Nuget.Output.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
2 changes: 1 addition & 1 deletion QtSharp.CLI/app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
5 changes: 3 additions & 2 deletions QtSharp.CLI/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?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.2" targetFramework="net451" developmentDependency="true" />
<package id="Baseclass.Contrib.Nuget.Output" version="2.3.0" targetFramework="net461" />
<package id="CppSharp" version="0.8.14" targetFramework="net461" developmentDependency="true" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net461" />
</packages>
18 changes: 14 additions & 4 deletions QtSharp.Tests/Manual/QtCore/IO/QFileInfoTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
using QtCore;

@@ -8,11 +9,20 @@ namespace QtSharp.Tests.Manual.QtCore.IO
[TestFixture]
public class QFileInfoTests
{
private readonly FileInfo _testFilePath1 = new FileInfo("./TestData/TextFile1.txt");
private readonly FileInfo _testFilePath2 = new FileInfo("./TestData/TextFile2_1000words.txt");
private readonly FileInfo _testFilePath3 = new FileInfo("./TestData/TextFile3_50bytes.txt");
private readonly FileInfo _testFilePath4 = new FileInfo("./TestData/DoubleExtension.ext.txt");
private readonly FileInfo _testFilePath1;
private readonly FileInfo _testFilePath2;
private readonly FileInfo _testFilePath3;
private readonly FileInfo _testFilePath4;

public QFileInfoTests()
{
var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Directory.SetCurrentDirectory(dir);
_testFilePath1 = new FileInfo($"./TestData/TextFile1.txt");
_testFilePath2 = new FileInfo($"./TestData/TextFile2_1000words.txt");
_testFilePath3 = new FileInfo($"./TestData/TextFile3_50bytes.txt");
_testFilePath4 = new FileInfo($"./TestData/DoubleExtension.ext.txt");
}

private QFileInfo _fileInfo;

4 changes: 2 additions & 2 deletions QtSharp.Tests/Manual/QtCore/IO/QUrlTests.cs
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ public void TestAuthority()
QUrl.ComponentFormattingOption formatting in Enum.GetValues(typeof(QUrl.ComponentFormattingOption)))
{
var s = this.qUrl.Authority(formatting);
Assert.IsNotNullOrEmpty(s, "Problem in enum: " + formatting.ToString());
Assert.That(s, Is.Not.Null.Or.Empty, "Problem in enum: " + formatting.ToString());
}
}

@@ -95,7 +95,7 @@ public void TestFragment()
{
var s = this.qUrl.Fragment();

Assert.IsNotNullOrEmpty(s);
Assert.That(s, Is.Not.Null.Or.Empty);
}

[Test]
2 changes: 1 addition & 1 deletion QtSharp.Tests/Manual/QtCore/Kernel/QObjectTests.cs
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ public void TestObjectName()
{
var isW = _qObject.ObjectName;

Assert.IsNullOrEmpty(isW);
Assert.That(isW, Is.Not.Null.Or.Empty);

_qObject.ObjectName = "MyObject";

10 changes: 4 additions & 6 deletions QtSharp.Tests/Manual/QtCore/QSysInfoTests.cs
Original file line number Diff line number Diff line change
@@ -11,20 +11,18 @@ public class QSysInfoTests
[Test]
public void TestWinVersion()
{
var s = QSysInfo.WindowsVersion;
var s = QSysInfo.windowsVersion;

Assert.IsNotNullOrEmpty(s.ToString());
Assert.That(s.ToString(), Is.Not.Null.Or.Empty);
}

[Platform(Exclude = "Win,Linux")]
[Test]
public void TestMacintoshVersion()
{
throw new NotImplementedException("Add in QtCore");
var s = QSysInfo.macVersion;

//var s = QSysInfo.MacintoshVersion;

//Assert.IsNotNullOrEmpty(s.ToString());
Assert.That(s.ToString(), Is.Not.Null.Or.Empty);
}
}
}
Loading