[Kde-bindings] Building latest qyoto under Windows and Linux

Steven Boswell II ulatekh at yahoo.com
Sun May 13 19:26:52 UTC 2012


The QColor-containing QVariant was for my override of QAbstractItemModel, in the method "public override QVariant Data (QModelIndex a_rIndex, int a_iRole)", when the role was Qt.ItemDataRole.BackgroundRole, i.e. so I could give my tree-items a background color.  I can't use GlobalColor because I use different colors, and some of them have transparency.  I'll look into QVariant.FromValue<T>.

Enclosed is my initial .spec file.  This works under Fedora Core 16, and does everything I want except install the cmake files with the "devel" package.  The enclosed patch causes the key.snk file to get installed so that it can become part of the "devel" package.

In the standard "qyoto" package, cmake/CMakeLists.txt contained this section for installing the cmake files:

install(FILES CMakeCSharpCompiler.cmake.in
            CMakeCSharpInformation.cmake
            CMakeDetermineCSharpCompiler.cmake
            CMakeTestCSharpCompiler.cmake
            FindMono.cmake
            ${CMAKE_CURRENT_BINARY_DIR}/QyotoConfig.cmake
        DESTINATION share/qyoto/cmake )

But I'm not sure where to put the equivalent of that in the assemblygen project.

At some point I'll update the assembly versions to read 4.8.3.  Probably around the time I attempt the .NET 3.5 backport.

Steven Boswell


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 11:58 AM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

I checked it and I actually find it strange that there ever was a constructor of QVariant taking a QColor, see this excerpt from the Qt 4.8.0 docs on QVariant: "A Note on GUI Types
Because QVariant is part of the QtCore library, it cannot provide conversion functions to data types defined in QtGui, such as QColor, QImage, and QPixmap. In other words, there is no toColor() function."

What you have is a constructor that takes a Qt.GlobalColor, an enum of built-in colours. If it doesn't work for you you can simply use QVariant.FromValue<T>.
About event raising methods: come to think of it, they do not seem to depend on the event handler type so I'll try them tomorrow.

I think it's most clear if the Qyoto RPM bears the version of Qyoto, and the version of Qyoto is most clear to bear the version of the wrapped Qt version so basically I agree with you.



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 9:38 PM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

OK, I'll attempt the .NET 3.5 backport, hopefully today.  (I really need to do some non-Qyoto things this weekend...like cook next week's lunch. :-)

Will you be able to implement QVariant<QColor> and OnDataChanged() relatively soon?  Then I can start testing my project under the newest Qyoto.

I was working on an RPM spec file for the latest qyoto (i.e. so that it can be installed with Linux's package manager), and noticed that all the assembly versions are set to 2.0.0.  Should we upgrade them to match the version number of the Qt library that we're compiling them against (in my case, 4.8.3)?  Or are they supposed to match the version of .NET that they run with?  I'm not really sure what the standard is, but it seems like they should be upgraded past 2.0.0.

Steven Boswell


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 11:28 AM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

Well, in short, right now nobody cares about Kimono. :)

About .NET 3.5, the following needs to be done:
1. Define all Qyoto.Action overloads (for example, in assemblies/qyoto-qtcore/Qyoto.cs);
2. Change src/plugins/qyoto/QyotoHooks.cs, method PostMembersHook; you'll see where I use System.Action; as you won't have a reference to Qyoto.Action you'd need to change the Windows case to use only strings for generation, not very hard a task.

And you're done.

About Emit.DataChanged: I think now that even though that calling the signal didn't help you it'd be nice to have an event raising method (OnDataChanged, as you said), it's both good practice and, I'd say, a .NET/Mono library "standard". I'll think about adding such but after the migration (if any) to Qyoto.Action because it'd have to be tested twice otherwise.



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 9:03 PM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

I was converting the patch format while you were sending the second e-mail, so it was just timing. :-)  There's no problem at all submitting future patches in the git format -- I will do that.

Emit.DataChanged is an event now, so I can't call it as a function.  I also didn't see an OnDataChanged() method.  I'm sure there's some way to post an event to an object directly in C#, I just don't know what it is.  I can look it up.  But like I said, for the short term, the problem is moot -- it never did what I wanted anyway.  Some day I'll have to get better with Qt and figure out how to use tree-views better.

Re: the Kimono port, I just didn't know if it contained the "latest" Kimono the way the assemblygen project contains the "latest" Qyoto.  I don't use Kimono personally.  I was just wondering if anyone cared if assemblygen's Kimono wasn't building.

Re: .NET 3.5, if I can figure out how to make the change I'm talking about, I will.  Where I work, they're still using .NET 3.5 under Windows Vista, which is my entire motivation for caring about .NET 3.5.  They're talking about finally upgrading to Windows 7, but it hasn't happened yet.  Presumably we'll upgrade to .NET 4 at the same time.  (And before you say anything...yes, my workplace is a time warp.  It's just one of my crosses to bear. :-)

Steven Boswell


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 10:53 AM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

I've already been able to successfully apply all your patches (you may've missed my second e-mail) but the new format you've sent me (assemblygen-patches-git.zip, no need for the other one) allows me to use Tortoise Git! So it'd be great if you could send all of your future patches in this one.

Thanks for your kind words about my changes. :)

I haven't deleted any constructors from QVariant, I don't know how that happened. Will check it right now. About Emit.DataChanged, what is the difference now - is it not accessible (private), is it missing or sth else?



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 8:40 PM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

It looks like the output of "diff -ur" and "git diff" are slightly different.  Either that's the problem, or it's an issue of Windows-style line-endings (i.e. CR/LF) versus Linux-style line endings (i.e. LF).
Enclosed are two archives with patches generated by "git diff".  One has Linux line endings, the other has Windows line endings.  One or both should work for you.

I was able to run uics under Windows, and I made a bunch of little changes to adapt to the new API.  Very slick!  All the set/get methods have been replaced with properties, the enum values allow the "bitwise or" operator, and the Qt events are now C# events!

I have two API changes I haven't resolved yet.  One, QVariant no longer has a constructor that takes a QColor.  I need this to color my tree-view items.  Also, I can no longer call "Emit.DataChanged" from within my QAbstractItemModel subclass.  I was using that to force the update of the display of my tree-view when I modified items.  But I never got that to work anyway; I ended up having to call Collapse() on the parent item and have the user re-open that item in order to force the update.  So maybe this second one isn't a big deal.  But I'll definitely need a QVariant constructor that takes a QColor.

Steven Boswell


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 9:30 AM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

They all look great but I cannot apply them. I use the "Review/apply single patch" menu item of TortoiseGit but it cannot recognise the format. Could you advise me what program to use?



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 6:31 PM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

OK, I separated out all my patches.  Enclosed is an archive with all of them.  They are meant to be applied in order, but if they're not, or one is skipped, they should work, but patch will report "fuzz", i.e. that the target line numbers had to be adjusted.

Patch 1 allows MONO_EXECUTABLE to be undefined, i.e. so that the Windows version can be built with Microsoft's C# compiler.

Patch 2 modifies output-destinations, so that executables, libraries, and assemblies go to the proper location, and it modifies Windows libraries/DLLs so that they don't have a "lib" prefix.
Patch 3 is the patch that detects a missing QtDBus (i.e. under Windows) but allows building anyway.
Patch 4 fixes qyoto-phonon to use DEF_LIST_MARSHALLER instead of DEF_VALUELIST_MARSHALLER.  I hope I did it right.
Patch 5 makes the build look for the .NET 4 compiler under both Windows and Linux.
Patch 6 adds "SMOKE_INCLUDE_DIR" to a few places where it's needed.
Patch 7 builds a native assemblygen under Windows, so that it can load native DLLs.
Patch 8 is the hack that adds a reference for the Error class under QX11EmbedContainer and QX11EmbedWidget.

I noticed that Kimono isn't building under Linux.  Is the Kimono project in the assemblygen git-project being used or maintained?  I started to modify the CMakeLists.txt files to build it, but it looks like it needs more work than that.

One last thing...are there any other dependencies on .NET 4, or is it just the System.Action<> prototypes with more than 4 parameters?  If so, can we just add our own "Qyoto.Action<>" prototypes with the required number of parameters, and use those instead?  Would that cause any headaches that I can't think of?  (In which case, patch 5 can be ignored.)

Steven Boswell


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 5:54 AM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

It seems to me you haven't subscribed to the mailing list because I've been doing quite a bit of shouting here. :) Please consider joining, this way you'll always be up to date with all developments.


Most of the errors you report are my fault, sorry about that:


1. QX11EmbedContainer and QX11EmbedWidget - I removed them because the nested type Error was not generated; I didn't check that as I was after another bug then so seeing they are not that often used I just removed them; obviously I forgot to remove the events that use them; I compiled everything then but apparently these events are new to Qt 4.8.0 as my Linux had 4.7.4;

2. dmcs - I really don't know what happened here; I clearly remember searching for "gmcs" in the whole dir and replacing it; it seems that I didn't commit these changes;

3. DEF_VALUELIST_MARSHALLER - I replaced this everywhere with DEF_LIST_MARSHALLER because of two of the bugs (QPrinterInfo and QModelIndex) I've written about in my recent post called "Qyoto: help needed"; but I have clearly forgotten about Phonon as I don't compile it on my Windows because of some missing dependencies;

4. uics - Arno advised me months ago to move uics to assemblygen but I haven't done it yet; I will complete that today.

You can send me your patches and I'll push them but please try to separate them per feature: that is, one for dmcs, one for DBus, one for MONO_EXECUTABLE, etc.



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Sunday, May 13, 2012 4:12 AM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

OK, I added two lines to src/plugins/qyoto/QyotoTranslator.cs:

{ "QX11EmbedContainer::Error", delegate { throw new NotSupportedException(); } },

{ "QX11EmbedWidget::Error", delegate { throw new NotSupportedException(); } },


I don't know if that was a great idea, but at least it kept compiling.

The next compile error (under Linux) was in qyoto-phonon:

assemblygen/assemblies/qyoto-phonon/native/phononhandlers.cpp:29:25: error: expected constructor, destructor, or type conversion before ‘(’ token


The issue seems to be that DEF_VALUELIST_MARSHALLER isn't defined anywhere.  assemblies/qyoto-qtcore/native/marshall_macros.h has a definition for DEF_LIST_MARSHALLER, so maybe that file is out of date.

As always, help is appreciated.

Steven Boswell


________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Saturday, May 12, 2012 5:33 PM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

I've been here the whole time...you could have just shouted!

I'm still overloaded at work, but decided to take some time today to work on this anyway.  I'm tired of being too tired to work on projects that I want to work on! :-)

If Qyoto has to depend on .NET 4, that's not a big deal -- if it needs to use System.Action<> instances with more than 4 parameters, there's not much of a choice.  The problem was that cmake/modules/CMakeDetermineCSharpCompiler.cmake was still looking for the v3.5 compiler.  So I updated it to look for the v4.0.30319 compiler.  I also updated to look for dmcs (i.e. the .NET 4 version of Mono) instead of gmcs.  How is it that assemblygen ever compiled without these changes?

The next barrier was that the most of the changes I submitted a long time ago had never been applied. I had modified assemblies/qyoto-*/CMakeLists.txt to make them work if  MONO_EXECUTABLE was undefined, and various places to allow QT_QTDBUS_LIBRARY to be undefined.  I put those back.

Now assemblygen builds and links under Windows, but I haven't tried to run it  yet.

Under Linux, I get as far as building qyoto-qtgui, then I get a bunch of errors like "error CS0426: The nested type `Error' does not exist in the type `Qyoto.QX11EmbedContainer'".  One example of a line that causes this problem is:

        [Q_SIGNAL("error(QX11EmbedContainer::Error)")]
        event System.Action<QX11EmbedContainer.Error> Error;

If you know how to get past this, I'd be grateful.  The only reference I see to QX11EmbedContainer is in src/plugins/qyoto/QyotoTranslator.cs, where it throws a NotSupportedException, so I have no idea where to go with this.

Also, I have some vague memory that uics was branched into assemblygen?  If not, what do I use?

Thanks in advance for any help with these issues!

Steven Boswell


________________________________
 From: Dimitar Dobrev <dpldobrev at yahoo.com>
To: Steven Boswell II <ulatekh at yahoo.com>; KDE bindings for other programming languages <kde-bindings at kde.org> 
Sent: Saturday, May 12, 2012 12:13 PM
Subject: Re: [Kde-bindings] Building latest qyoto under Windows and Linux
 

I'm glad you're back, Steven!

Both problems are one and the same: Qyoto now depends on .NET/Mono 4. 

The reason is that I needed the overloads for System.Action as I use them to generate events corresponding to signals. The other thing I need to find the files with parameter names.
If the dependency on .NET 4 is unacceptable for you please say so and we might be able to think of some workaround.



________________________________
 From: Steven Boswell II <ulatekh at yahoo.com>
To: KDE bindings <kde-bindings at kde.org> 
Sent: Saturday, May 12, 2012 9:50 PM
Subject: [Kde-bindings] Building latest qyoto under Windows and Linux
 

Today I decided to try to build latest smokegen/smokeqt/assemblygen under Windows and Linux.
smokegen, i.e. git://anongit.kde.org/smokegen, and smokeqt, i.e. git://anongit.kde.org/smokeqt, built and linked under both Windows 7 and Fedora Core 16 just fine.

But when building assemblygen, i.e.git://gitorious.org/assemblygen/assemblygen.git, "assemblies" branch, I get the same build error immediately, under both OSes:

GeneratorData.cs(220,98): error CS0117: `System.Environment.SpecialFolder' does not contain a definition for `Windows'


Getting that error under Linux didn't surprise me, but getting it under Windows did.

Diking that line out and continuing to build, I get to building qyoto-qtcore.dll.  I get 260 "Won't wrap method" warnings and 65 "Conflicting names" messages, then I get a bunch of errors that say "error CS0305: Using the generic type `System.Action<T1,T2,T3,T4>' requires `4' type argument(s)".  One example of a line that generates such an error is:

        [Q_SIGNAL("rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)")]
        event System.Action<QModelIndex,System.Int32,System.Int32,QModelIndex,System.Int32> RowsAboutToBeMoved;

I'm guessing there's a 'System.Action<T1,T2,T3,T4>' now, but my version of Qt (4.8.1-5) doesn't have that.

So...does anyone know what to do about these?  The first error appears to be real; the second one appears to want a different version of Qt.  What version of Qt should I be using?

Steven Boswell

_______________________________________________
Kde-bindings
 mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings





_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings



_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings





_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings





_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings





_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings





_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20120513/59bf8b9f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qyoto.spec
Type: application/octet-stream
Size: 2841 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20120513/59bf8b9f/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assemblygen-installkeysnk.patch
Type: application/octet-stream
Size: 371 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20120513/59bf8b9f/attachment-0003.obj>


More information about the Kde-bindings mailing list