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. namespace "Ui" has no member "xxxxx"
Forum Updated to NodeBB v4.3 + New Features

namespace "Ui" has no member "xxxxx"

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 1.1k 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.
  • A Offline
    A Offline
    aftershocker1
    wrote on last edited by
    #1

    Hello, first post on here and looking for some guidance. I am using Qt in VS2019. I am just making a wee test application to try and learn what I am doing and come across an error message. In the ItemAddDialog.h file I have a red error line under

    private:

    Ui::ItemAddDialog ui; //error under "ItemAddDialog"

    The error message says "namespace "Ui" has no member "itemAddDialog".

    These are the error messages when I run in VS.

    1>C:\Users\gh185103\source\repos\QtStoreInvApp\QtStoreInvApp\itemadddialog.h(15,6): error C2039: 'ItemAddDialog': is not a member of 'Ui'

    1>C:\Users\gh185103\source\repos\QtStoreInvApp\QtStoreInvApp\x64\Debug\uic\ui_itemadddialog.h(99): message : see declaration of 'Ui'

    1>C:\Users\gh185103\source\repos\QtStoreInvApp\QtStoreInvApp\itemadddialog.h(15,20): error C2460: 'ItemAddDialog::ui': uses 'ItemAddDialog', which is being defined

    1>C:\Users\gh185103\source\repos\QtStoreInvApp\QtStoreInvApp\itemadddialog.h(6): message : see declaration of 'ItemAddDialog'

    Any help would be fantastic! Thanks

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      So look into the ui class and you will see that the compiler is correct.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to the forums

        But what is ItemAddDialog ?

        Did you make a custom widget you called ItemAddDialog ?

        it should generate a file called ui_ItemAddDialog.h ?

        Do you use the plugin for Qt for Vs ?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aftershocker1
          wrote on last edited by
          #4

          ItemAddDialog is a Qt Widgets class so has an itemadddialog.cpp, itemadddialog.h & itemadddialog.ui.

          I used the plugin for Qt for VS2019.

          I can see a file called ui_ItemAddDialog.h in the x64 ->debug folder.

          The code for the problamatic .h file is....

          #pragma once

          #include <QWidget>
          #include "ui_itemadddialog.h"

          class ItemAddDialog : public QWidget
          {
          Q_OBJECT

          public:
          ItemAddDialog(QWidget *parent = Q_NULLPTR);
          ~ItemAddDialog();

          private:
          Ui::ItemAddDialog ui; //red error in ItemAddDialog
          };

          Hope that can help you help me!

          JonBJ 1 Reply Last reply
          0
          • A aftershocker1

            ItemAddDialog is a Qt Widgets class so has an itemadddialog.cpp, itemadddialog.h & itemadddialog.ui.

            I used the plugin for Qt for VS2019.

            I can see a file called ui_ItemAddDialog.h in the x64 ->debug folder.

            The code for the problamatic .h file is....

            #pragma once

            #include <QWidget>
            #include "ui_itemadddialog.h"

            class ItemAddDialog : public QWidget
            {
            Q_OBJECT

            public:
            ItemAddDialog(QWidget *parent = Q_NULLPTR);
            ~ItemAddDialog();

            private:
            Ui::ItemAddDialog ui; //red error in ItemAddDialog
            };

            Hope that can help you help me!

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @aftershocker1 said in namespace "Ui" has no member "xxxxx":

            #include "ui_itemadddialog.h"
            Ui::ItemAddDialog ui; //red error in ItemAddDialog

            So what is in ui_itemadddialog.h? It dsoes not sound like it defines Ui::ItemAddDialog.

            M 1 Reply Last reply
            0
            • JonBJ JonB

              @aftershocker1 said in namespace "Ui" has no member "xxxxx":

              #include "ui_itemadddialog.h"
              Ui::ItemAddDialog ui; //red error in ItemAddDialog

              So what is in ui_itemadddialog.h? It dsoes not sound like it defines Ui::ItemAddDialog.

              M Offline
              M Offline
              mazen030
              wrote on last edited by
              #6

              @JonB I have same problem also hope that you can help

              Christian EhrlicherC 1 Reply Last reply
              0
              • M mazen030

                @JonB I have same problem also hope that you can help

                Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @mazen030 said in namespace "Ui" has no member "xxxxx":

                I have same problem also hope that you can help

                Then do what @JonB suggested...

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                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