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. Stuck in this Error :::invalid use of incomplete type ‘class Ui::Dialog’ ui(new Ui::Dialog) ^~~~~~

Stuck in this Error :::invalid use of incomplete type ‘class Ui::Dialog’ ui(new Ui::Dialog) ^~~~~~

Scheduled Pinned Locked Moved Solved General and Desktop
27 Posts 5 Posters 3.5k 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.
  • J jsulm
    31 Oct 2019, 09:48

    @sankarapandiyan Sorry I will stop here as I'm tired to explain that you simply need to copy text from ui_dialog.h and paste it here...

    S Offline
    S Offline
    sankarapandiyan
    wrote on 31 Oct 2019, 10:03 last edited by
    #21

    @jsulm i didnt have a content of ui dialog . h , And i am having dialog.h file only is there thats why i have uploaded repeatedly

    J 1 Reply Last reply 31 Oct 2019, 10:05
    0
    • S sankarapandiyan
      31 Oct 2019, 10:03

      @jsulm i didnt have a content of ui dialog . h , And i am having dialog.h file only is there thats why i have uploaded repeatedly

      J Online
      J Online
      J.Hilk
      Moderators
      wrote on 31 Oct 2019, 10:05 last edited by
      #22

      @sankarapandiyan
      it will not be inside QtCreator as it is a automatically created file.

      But you will find in in your build directory, if you use a normal file explorer, the one that comes with your operating system


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      S 1 Reply Last reply 31 Oct 2019, 10:37
      3
      • J J.Hilk
        31 Oct 2019, 10:05

        @sankarapandiyan
        it will not be inside QtCreator as it is a automatically created file.

        But you will find in in your build directory, if you use a normal file explorer, the one that comes with your operating system

        S Offline
        S Offline
        sankarapandiyan
        wrote on 31 Oct 2019, 10:37 last edited by
        #23
        This post is deleted!
        M 1 Reply Last reply 31 Oct 2019, 10:50
        0
        • S sankarapandiyan
          31 Oct 2019, 10:37

          This post is deleted!

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 31 Oct 2019, 10:50 last edited by
          #24

          @sankarapandiyan
          Nope thats the actual UI file
          its
          ui_dialog.h
          we are after to see if its broken somehow.
          Its auto generated file and lives in the build folder
          not in project folder.

          1 Reply Last reply
          2
          • S Offline
            S Offline
            sankarapandiyan
            wrote on 31 Oct 2019, 11:13 last edited by
            #25

            Thanks a lot ... @mrjj ... Finally ,Here there is a code of ui.dialog.h file , @J-Hilk @jsulm

            ** Form generated from reading UI file 'dialog.ui'
            **
            ** Created by: Qt User Interface Compiler version 5.10.1
            **
            ** WARNING! All changes made in this file will be lost when recompiling UI file!
            ********************************************************************************/
            
            #ifndef UI_DIALOG_H
            #define UI_DIALOG_H
            
            #include <QtCore/QVariant>
            #include <QtWidgets/QAction>
            #include <QtWidgets/QApplication>
            #include <QtWidgets/QButtonGroup>
            #include <QtWidgets/QDialog>
            #include <QtWidgets/QGridLayout>
            #include <QtWidgets/QHeaderView>
            #include <QtWidgets/QPushButton>
            #include <QtWidgets/QSpacerItem>
            
            QT_BEGIN_NAMESPACE
            
            class Ui_Dialog
            {
            public:
                QGridLayout *gridLayout;
                QPushButton *pushButton;
                QPushButton *modelessButton;
                QPushButton *modalButton;
                QSpacerItem *verticalSpacer;
            
                void setupUi(QDialog *Dialog)
                {
                    if (Dialog->objectName().isEmpty())
                        Dialog->setObjectName(QStringLiteral("Dialog"));
                    Dialog->resize(304, 95);
                    gridLayout = new QGridLayout(Dialog);
                    gridLayout->setSpacing(6);
                    gridLayout->setContentsMargins(11, 11, 11, 11);
                    gridLayout->setObjectName(QStringLiteral("gridLayout"));
                    pushButton = new QPushButton(Dialog);
                    pushButton->setObjectName(QStringLiteral("pushButton"));
            
                    gridLayout->addWidget(pushButton, 2, 1, 1, 1);
            
                    modelessButton = new QPushButton(Dialog);
                    modelessButton->setObjectName(QStringLiteral("modelessButton"));
            
                    gridLayout->addWidget(modelessButton, 0, 1, 1, 1);
            
                    modalButton = new QPushButton(Dialog);
                    modalButton->setObjectName(QStringLiteral("modalButton"));
            
                    gridLayout->addWidget(modalButton, 0, 0, 1, 1);
            
                    verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
            
                    gridLayout->addItem(verticalSpacer, 1, 1, 1, 1);
            
            
                    retranslateUi(Dialog);
                    QObject::connect(pushButton, SIGNAL(clicked()), Dialog, SLOT(close()));
            
                    QMetaObject::connectSlotsByName(Dialog);
                } // setupUi
            
                void retranslateUi(QDialog *Dialog)
                {
                    Dialog->setWindowTitle(QApplication::translate("Dialog", "QProgressDialog Launcher", nullptr));
                    pushButton->setText(QApplication::translate("Dialog", "Cancel", nullptr));
                    modelessButton->setText(QApplication::translate("Dialog", "Modeless", nullptr));
                    modalButton->setText(QApplication::translate("Dialog", "Modal", nullptr));
                } // retranslateUi
            
            };
            
            namespace Ui {
                class Dialog: public Ui_Dialog {};
            } // namespace Ui
            
            QT_END_NAMESPACE
            
            #endif // UI_DIALOG_H
            code_text
            
            J 1 Reply Last reply 31 Oct 2019, 11:32
            0
            • S sankarapandiyan
              31 Oct 2019, 11:13

              Thanks a lot ... @mrjj ... Finally ,Here there is a code of ui.dialog.h file , @J-Hilk @jsulm

              ** Form generated from reading UI file 'dialog.ui'
              **
              ** Created by: Qt User Interface Compiler version 5.10.1
              **
              ** WARNING! All changes made in this file will be lost when recompiling UI file!
              ********************************************************************************/
              
              #ifndef UI_DIALOG_H
              #define UI_DIALOG_H
              
              #include <QtCore/QVariant>
              #include <QtWidgets/QAction>
              #include <QtWidgets/QApplication>
              #include <QtWidgets/QButtonGroup>
              #include <QtWidgets/QDialog>
              #include <QtWidgets/QGridLayout>
              #include <QtWidgets/QHeaderView>
              #include <QtWidgets/QPushButton>
              #include <QtWidgets/QSpacerItem>
              
              QT_BEGIN_NAMESPACE
              
              class Ui_Dialog
              {
              public:
                  QGridLayout *gridLayout;
                  QPushButton *pushButton;
                  QPushButton *modelessButton;
                  QPushButton *modalButton;
                  QSpacerItem *verticalSpacer;
              
                  void setupUi(QDialog *Dialog)
                  {
                      if (Dialog->objectName().isEmpty())
                          Dialog->setObjectName(QStringLiteral("Dialog"));
                      Dialog->resize(304, 95);
                      gridLayout = new QGridLayout(Dialog);
                      gridLayout->setSpacing(6);
                      gridLayout->setContentsMargins(11, 11, 11, 11);
                      gridLayout->setObjectName(QStringLiteral("gridLayout"));
                      pushButton = new QPushButton(Dialog);
                      pushButton->setObjectName(QStringLiteral("pushButton"));
              
                      gridLayout->addWidget(pushButton, 2, 1, 1, 1);
              
                      modelessButton = new QPushButton(Dialog);
                      modelessButton->setObjectName(QStringLiteral("modelessButton"));
              
                      gridLayout->addWidget(modelessButton, 0, 1, 1, 1);
              
                      modalButton = new QPushButton(Dialog);
                      modalButton->setObjectName(QStringLiteral("modalButton"));
              
                      gridLayout->addWidget(modalButton, 0, 0, 1, 1);
              
                      verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
              
                      gridLayout->addItem(verticalSpacer, 1, 1, 1, 1);
              
              
                      retranslateUi(Dialog);
                      QObject::connect(pushButton, SIGNAL(clicked()), Dialog, SLOT(close()));
              
                      QMetaObject::connectSlotsByName(Dialog);
                  } // setupUi
              
                  void retranslateUi(QDialog *Dialog)
                  {
                      Dialog->setWindowTitle(QApplication::translate("Dialog", "QProgressDialog Launcher", nullptr));
                      pushButton->setText(QApplication::translate("Dialog", "Cancel", nullptr));
                      modelessButton->setText(QApplication::translate("Dialog", "Modeless", nullptr));
                      modalButton->setText(QApplication::translate("Dialog", "Modal", nullptr));
                  } // retranslateUi
              
              };
              
              namespace Ui {
                  class Dialog: public Ui_Dialog {};
              } // namespace Ui
              
              QT_END_NAMESPACE
              
              #endif // UI_DIALOG_H
              code_text
              
              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 31 Oct 2019, 11:32 last edited by jsulm
              #26

              @sankarapandiyan OK, the file looks good.
              Try to do a complete rebuild:

              • Delete the content of the build directory
              • Run qmake
              • And build

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              5
              • S Offline
                S Offline
                sankarapandiyan
                wrote on 1 Nov 2019, 06:03 last edited by
                #27

                Yes it Run Thanks a Lot ..

                1 Reply Last reply
                0

                21/27

                31 Oct 2019, 10:03

                • Login

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