[Kde-bindings] Can I define a custom namespace for UICS?

Arno Rehn arno at arnorehn.de
Sat Jan 23 15:47:15 UTC 2010


On Saturday 23 January 2010 15:54:03 IBBoard wrote:
> I'm scripting up a build command for MonoDevelop so that it will compile
> my .ui files to C# using uics whenever I build the project (not quite as
> good as auto-build on change, but better than nothing :) ).
You could implement an md5sum check, so it will only recompile when the ui 
file was changed. AFAIK the framework has an implementation of md5.

> Using the default Qt and Qyoto packages from openSUSE gives me classes
> that compile to UiFormName and Ui.FormName (empty namespace with "Ui"
> prefix, or no prefix and "Ui" namespace). From a bit of research it
> looks like it should be possible to change the prefix [1], but a) it
> looks like C++ rather than C#, so I don't know how applicable it is and
> b) it seems to imply that you need to do a complete recompile, which
> seems excessive.
QT_BEGIN_NAMESPACE and QT_END_NAMESPACE are only applicable in C++ and they 
require a full rebuild of Qt.

> So, is it possible to change the namespace that UICS compiles to, or
> should I add a feature request for a command-line parameter?
No, currently the namespace is hardcoded in uics. We can add it as a command 
line option, if you require that. Please file a wishlist bug, then.
Another possibility would be to create an alias in C# with

using Foo = Ui;

You can then access your user interfaces with Foo.MyForm.

What's the problem with the Ui namespace? Do you already have a Ui namespace?

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list