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. fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h"

fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h"

Scheduled Pinned Locked Moved Solved General and Desktop
qt5ui headermainwindow
9 Posts 2 Posters 4.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.
  • D Offline
    D Offline
    deleted286
    wrote on 8 Jan 2021, 13:15 last edited by
    #1

    I've rebuild several times, run qmake etc. It doesnt solve .

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QtWidgets/QMainWindow>
    #include <QMainWindow>
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
    {
        ui->setupUi(this);
    
        // Initialize the new objects
        myThreadObject = new MyThread();
        myQThread = new QThread();
    
        // Move to new thread
        myThreadObject->moveToThread(myQThread);
    
        // connect signal and slots
        connect(this, &MainWindow::startWriting, myThreadObject, &MyThread::writeData);
        connect(myThreadObject, &MyThread::writingDone, this, &MainWindow::writingDoneByThread);
    
        // Start the new thread
        myQThread->start();
    }
    
    J 1 Reply Last reply 8 Jan 2021, 13:19
    0
    • D deleted286
      8 Jan 2021, 13:15

      I've rebuild several times, run qmake etc. It doesnt solve .

      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      #include <QtWidgets/QMainWindow>
      #include <QMainWindow>
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
      {
          ui->setupUi(this);
      
          // Initialize the new objects
          myThreadObject = new MyThread();
          myQThread = new QThread();
      
          // Move to new thread
          myThreadObject->moveToThread(myQThread);
      
          // connect signal and slots
          connect(this, &MainWindow::startWriting, myThreadObject, &MyThread::writeData);
          connect(myThreadObject, &MyThread::writingDone, this, &MainWindow::writingDoneByThread);
      
          // Start the new thread
          myQThread->start();
      }
      
      J Offline
      J Offline
      JonB
      wrote on 8 Jan 2021, 13:19 last edited by JonB 1 Aug 2021, 13:31
      #2

      @suslucoder
      Please don't delete an existing thread and then raise a new thread with the same question.

      What files do you have in your build/compile output directory? That is where it should be. Are you designing a mainwindow.ui from Qt Designer?

      D 1 Reply Last reply 8 Jan 2021, 13:33
      0
      • J JonB
        8 Jan 2021, 13:19

        @suslucoder
        Please don't delete an existing thread and then raise a new thread with the same question.

        What files do you have in your build/compile output directory? That is where it should be. Are you designing a mainwindow.ui from Qt Designer?

        D Offline
        D Offline
        deleted286
        wrote on 8 Jan 2021, 13:33 last edited by
        #3

        @JonB I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread. I have these:
        Ekran görüntüsü 2021-01-08 163205.png

        J 1 Reply Last reply 8 Jan 2021, 13:35
        0
        • D deleted286
          8 Jan 2021, 13:33

          @JonB I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread. I have these:
          Ekran görüntüsü 2021-01-08 163205.png

          J Offline
          J Offline
          JonB
          wrote on 8 Jan 2021, 13:35 last edited by JonB 1 Aug 2021, 13:36
          #4

          @suslucoder said in fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h":

          I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread.

          Sorry, but that has no relevance at all to a compilation problem.

          [That's a completely separate matter from: given the questions you ask, if I were you I would not dream of doing anything involving threads...]

          And is the missing file not in the debug directory? Assuming you're compiling for Debug, which you don't say.

          D 1 Reply Last reply 8 Jan 2021, 13:36
          0
          • J JonB
            8 Jan 2021, 13:35

            @suslucoder said in fatal error: ui_mainwindow.h: No such file or directory #include "ui_mainwindow.h":

            I'm trying to do that; reading datas from txt in a thread, and write datas to txt in another thread.

            Sorry, but that has no relevance at all to a compilation problem.

            [That's a completely separate matter from: given the questions you ask, if I were you I would not dream of doing anything involving threads...]

            And is the missing file not in the debug directory? Assuming you're compiling for Debug, which you don't say.

            D Offline
            D Offline
            deleted286
            wrote on 8 Jan 2021, 13:36 last edited by
            #5

            @JonB I have been solve it.

            J 1 Reply Last reply 8 Jan 2021, 13:37
            0
            • D deleted286
              8 Jan 2021, 13:36

              @JonB I have been solve it.

              J Offline
              J Offline
              JonB
              wrote on 8 Jan 2021, 13:37 last edited by
              #6

              @suslucoder
              And how did you achieve the solution, given that you've asked so much about this?

              D 2 Replies Last reply 8 Jan 2021, 13:43
              0
              • J JonB
                8 Jan 2021, 13:37

                @suslucoder
                And how did you achieve the solution, given that you've asked so much about this?

                D Offline
                D Offline
                deleted286
                wrote on 8 Jan 2021, 13:43 last edited by
                #7

                @JonB I copied "ui_mainwindow.h" file from another build file

                1 Reply Last reply
                0
                • J JonB
                  8 Jan 2021, 13:37

                  @suslucoder
                  And how did you achieve the solution, given that you've asked so much about this?

                  D Offline
                  D Offline
                  deleted286
                  wrote on 8 Jan 2021, 13:45 last edited by
                  #8

                  @JonB said

                  given that you've asked so much about this?

                  Why do you always make insinuation to me? I dont know lots of the things about Qt and im trying to learn.

                  J 1 Reply Last reply 8 Jan 2021, 13:49
                  0
                  • D deleted286
                    8 Jan 2021, 13:45

                    @JonB said

                    given that you've asked so much about this?

                    Why do you always make insinuation to me? I dont know lots of the things about Qt and im trying to learn.

                    J Offline
                    J Offline
                    JonB
                    wrote on 8 Jan 2021, 13:49 last edited by JonB 1 Aug 2021, 13:53
                    #9

                    @suslucoder
                    I'm sorry if you feel I'm being hard on you. Quite a few of your questions are things you really should be able to solve for yourself, not ask questions of other people. It may not seem like it, but in the long run reading documentation and solving things for yourself is the only way to learn. I will leave it at that now.

                    BTW,

                    I copied "ui_mainwindow.h" file from another build file

                    This may or may not be right, depending on just what you did where. The ui_mainwindow.h has to be regenerated every time you edit in Designer to change the mainwindow.ui file. If you later find that you make changes in Designer and these are not reflected in your code, you will have hit a problem. Just saying.

                    1 Reply Last reply
                    1

                    9/9

                    8 Jan 2021, 13:49

                    • Login

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