uic and namespace
-
wrote on 18 Jul 2016, 06:52 last edited by koahnig
Hello, developers. Now I have another question. Is it possible to add extra namespace in the uic-generated class?
-
Hello, developers. Now I have another question. Is it possible to add extra namespace in the uic-generated class?
wrote on 18 Jul 2016, 09:42 last edited byWhat do you have in mind by this?
uic-generated classes are based on ui files which you basically edit with Qt designer. All this is helping you in streamlining your implementation. You can handle all of the work done by Qt designer by yourself as some developers prefer to do. On the other hand Qt designer is also meant to take this coding away and assist the programmer with wysiwyg feature.
AFAIK there is no way to add something from outside to the generated classes and in my opinion this perfect, because otherwise it might get really messy. If you like to use Qt creator for part of your coding, but you need to extend, it is the better way to inherit from generated classes rather than trying to push more into it.
-
Hello, developers. Now I have another question. Is it possible to add extra namespace in the uic-generated class?
@trialuser
Hi,
This is follow up for your previous question, right?
No, sadly you can't makeuic
generate the classes in a different namespace, and you can't instruct it to (not-)export them. I had a similar, although not quite severe, problem as you and ultimately I haven't found any satisfactory solution.AFAIK there is no way to add something from outside to the generated classes and in my opinion this perfect, because otherwise it might get really messy.
The problem is on Linux the exported symbols are a real mess and there's no good way to hide the things generated by
uic
that shouldn't be visible in the first place.Kind regards.
-
@trialuser
Hi,
This is follow up for your previous question, right?
No, sadly you can't makeuic
generate the classes in a different namespace, and you can't instruct it to (not-)export them. I had a similar, although not quite severe, problem as you and ultimately I haven't found any satisfactory solution.AFAIK there is no way to add something from outside to the generated classes and in my opinion this perfect, because otherwise it might get really messy.
The problem is on Linux the exported symbols are a real mess and there's no good way to hide the things generated by
uic
that shouldn't be visible in the first place.Kind regards.
wrote on 19 Jul 2016, 09:42 last edited by@kshegunov
Without knowing the possible history behind the question, it reads simpler. ;) -
wrote on 22 Jul 2016, 06:14 last edited by
Ok, I found solution. I renamed class name (via Qt designer) from "MyClass" to "MyNamespace::MyClass". And now uic generates ui_*.h with required namespace. According changelog this feature was added in Qt 4.1, but still undocumented. Should I create bugreport?
-
Ok, I found solution. I renamed class name (via Qt designer) from "MyClass" to "MyNamespace::MyClass". And now uic generates ui_*.h with required namespace. According changelog this feature was added in Qt 4.1, but still undocumented. Should I create bugreport?
wrote on 22 Jul 2016, 08:30 last edited byIMHO it is a good idea to check for and write, if required, a bug report on JIRA
Place a link here for others to find it more easily and vote for its importance.
You can also write a short guide of your solution on wiki.
-
wrote on 22 Jul 2016, 10:40 last edited by
Here is bugreport: https://bugreports.qt.io/browse/QTBUG-54903
7/7