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
QtWS25 Last Chance

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.
  • trialuserT Offline
    trialuserT Offline
    trialuser
    wrote on 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 kshegunovK 2 Replies Last reply
    0
    • trialuserT trialuser

      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 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
      • trialuserT trialuser

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

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on 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
        0
        • kshegunovK kshegunov

          @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 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
          • trialuserT Offline
            trialuserT Offline
            trialuser
            wrote on 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
            0
            • trialuserT trialuser

              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 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
              • trialuserT Offline
                trialuserT Offline
                trialuser
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0

                • Login

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