Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. uic and namespace
Forum Update on Monday, May 27th 2025

uic and namespace

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
qtbug-54903uicnamespace chang
7 Posts 3 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    trialuser
    wrote on 18 Jul 2016, 06:52 last edited by koahnig
    #1

    Hello, developers. Now I have another question. Is it possible to add extra namespace in the uic-generated class?

    K K 2 Replies Last reply 18 Jul 2016, 09:42
    0
    • T trialuser
      18 Jul 2016, 06:52

      Hello, developers. Now I have another question. Is it possible to add extra namespace in the uic-generated class?

      K Offline
      K Offline
      koahnig
      wrote on 18 Jul 2016, 09:42 last edited by
      #2

      @trialuser

      What 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.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • T trialuser
        18 Jul 2016, 06:52

        Hello, developers. Now I have another question. Is it possible to add extra namespace in the uic-generated class?

        K Offline
        K Offline
        kshegunov
        Moderators
        wrote on 18 Jul 2016, 21:35 last edited by
        #3

        @trialuser
        Hi,
        This is follow up for your previous question, right?
        No, sadly you can't make uic 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.

        @koahnig

        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.

        Read and abide by the Qt Code of Conduct

        K 1 Reply Last reply 19 Jul 2016, 09:42
        0
        • K kshegunov
          18 Jul 2016, 21:35

          @trialuser
          Hi,
          This is follow up for your previous question, right?
          No, sadly you can't make uic 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.

          @koahnig

          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.

          K Offline
          K Offline
          koahnig
          wrote on 19 Jul 2016, 09:42 last edited by
          #4

          @kshegunov
          Without knowing the possible history behind the question, it reads simpler. ;)

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          1
          • T Offline
            T Offline
            trialuser
            wrote on 22 Jul 2016, 06:14 last edited by
            #5

            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?

            K 1 Reply Last reply 22 Jul 2016, 08:30
            0
            • T trialuser
              22 Jul 2016, 06:14

              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?

              K Offline
              K Offline
              koahnig
              wrote on 22 Jul 2016, 08:30 last edited by
              #6

              @trialuser

              IMHO 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.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • T Offline
                T Offline
                trialuser
                wrote on 22 Jul 2016, 10:40 last edited by
                #7

                Here is bugreport: https://bugreports.qt.io/browse/QTBUG-54903

                1 Reply Last reply
                0

                3/7

                18 Jul 2016, 21:35

                • Login

                • Login or register to search.
                3 out of 7
                • First post
                  3/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved