ddobrev / QtSharp

Mono/.NET bindings for Qt
Other
571 stars 52 forks source link

Request Qt5Designer.dll support for QFormBuilder.Load #34

Closed Hecatron closed 8 years ago

Hecatron commented 8 years ago

I've noticed it's now possible to build the wrapper for modules Qt5Core, Qt5Gui, Qt5Widgets I'd like to request Qt5Designer as the next one for addition.

It's possible to create .ui files with QtDesigner then load them at runtime as a resource / text file similar to the way Visual Studio allows for editing forms.

Unfortunately using QtUiTools library / QUiLoader class for loading the ui file doesn't seem to be an easy option since QUITools is setup to be a static library instead of a dll. But it is possible to use the Qt5Designer.dll library and QFormBuilder class to load in .ui files instead

http://npg.york.ac.uk/download/pa541/Orsay_April2013/simulation/qt_build/doc/html/qformbuilder.html

I'm currently trying to see if I can get Qt5Designer working at the moment, although there's a bit more to it than just adding it to the modules list

ddobrev commented 8 years ago

Hello @grbd . I am going to have some time in a week or so and I will then check how Qt5Designer works.

Hecatron commented 8 years ago

Thanks for the reply, I had a quick go with Qt5Designer but ran into a couple of problems if cppsharp works with static libs then QtUiTools might be a lot easier to figure out since it has a simpler implementation. under windows it's visible under C:\Qt\Qt5.5.0\5.5\mingw492_32\lib\libQt5UiTools.a, it's just a shame there's no dll equivilent

ddobrev commented 8 years ago

In case there's no DLL, it cannot work unless somebody gets the code of QtUiTools and compiles it to a DLL. C# can only p/invoke DLL-s.

ddobrev commented 8 years ago

@grbd I believe the missing Qt5UiTools DLL is a bug in their installer so I filed it at https://bugreports.qt.io/browse/QTBUG-48383 .

Hecatron commented 8 years ago

I think I saw another bug report mentioning the same thing, it should be interesting to see what happens. I think the expectation might be to use QtDesigner instead of Qt5UiTools if a dll is needed for whatever reasons, since both routes can handle processing a.ui file, Qt5UiTools seems to be a more stripped down version just including what's needed for runtime.

The QT examples seem to work okay with Qt5UiTools so they must be linking against the static lib in order to work. Given there's only a single class and a small set of functions in that module I'm tempted to just manually code it using a manually grafted qmake .pro file / cpp inlines file that links against the static lib as a one off. The other option is to get QtDesigner working, but I don't know as much about how to do that part.

ddobrev commented 8 years ago

QtDesigner is now wrapped.

Hecatron commented 8 years ago

Thanks very much for this I may have gotten Qt5UiTools to work at the same time (I've got everything to compile and build, but just need to test that it actually works) If it works, I'll put in a pull request