Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Is this intentional?
Qt 6.11 is out! See what's new in the release blog

Is this intentional?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
3 Posts 3 Posters 1.6k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    digital_light
    wrote on last edited by
    #1

    so I made a new qt desktop project and noticed that the qt editor generated this in the loadscreen.h file 0_1535998257430_6b125bd4-78bf-4fcc-bc42-e7cbaec6ef08-image.png
    Why are we defining Ui::LoadScreen and ::LoadScreen? Doesn't that defeat the purpose of the namespace? Is it autogenerating a class that I don't have the defination of?

    JKSHJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      That's because you asked for a new Designer based widget. This means that you also have a loadscreen.ui file that will be processed by the uic application. It will generate C++ code with a class stored in the Ui namespace based on the content of the .ui file.

      For more information see:

      • The Designer Manual
      • The uic documentation

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • D digital_light

        so I made a new qt desktop project and noticed that the qt editor generated this in the loadscreen.h file 0_1535998257430_6b125bd4-78bf-4fcc-bc42-e7cbaec6ef08-image.png
        Why are we defining Ui::LoadScreen and ::LoadScreen? Doesn't that defeat the purpose of the namespace? Is it autogenerating a class that I don't have the defination of?

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @digital_light said in Is this intentional?:

        Why are we defining Ui::LoadScreen and ::LoadScreen? Doesn't that defeat the purpose of the namespace?

        They are 2 separate classes.

        • ::LoadScreen is your "actual" class where you write your code
        • Ui::LoadScreen is a fully auto-generated class that's embedded inside ::LoadScreen.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        3

        • Login

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