Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Ui Namespace
Forum Updated to NodeBB v4.3 + New Features

Ui Namespace

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views 1 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.
  • J Offline
    J Offline
    Jyang772
    wrote on last edited by
    #1

    Are these two namespaces the same? The Ui namespace in Mainwindow.h and Ui_Mainwindow.h.

    If not how does the compiler know that MainWindow in the namespace Ui in MainWindow.h is actually a forward declaration of Ui::MainWindow in Ui_Mainwindow.h

    In MainWindow.h
    @
    namespace Ui {
    class MainWindow; //Forward declaration of MainWindow from ui_MainWindow.h
    }@

    In ui_MainWindow.h
    @
    namespace Ui {
    class MainWindow: public Ui_MainWindow {};
    } // namespace Ui
    @

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Yes, Ui namespace is the same in both files if the files are in the same project.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jyang772
        wrote on last edited by
        #3

        Okay thank you. I know how namespaces work. Just got a bit confused since this is the first time I have used Designer to create a new Form for me.

        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