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"
QtWS25 Last Chance

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 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();
    }
    
    JonBJ 1 Reply Last reply
    0
    • D deleted286

      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();
      }
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #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
      0
      • JonBJ JonB

        @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 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

        JonBJ 1 Reply Last reply
        0
        • D deleted286

          @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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #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
          0
          • JonBJ JonB

            @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 last edited by
            #5

            @JonB I have been solve it.

            JonBJ 1 Reply Last reply
            0
            • D deleted286

              @JonB I have been solve it.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on 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
              0
              • JonBJ JonB

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

                D Offline
                D Offline
                deleted286
                wrote on last edited by
                #7

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

                1 Reply Last reply
                0
                • JonBJ JonB

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

                  D Offline
                  D Offline
                  deleted286
                  wrote on 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.

                  JonBJ 1 Reply Last reply
                  0
                  • D deleted286

                    @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.

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #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

                    • Login

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