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 or MainWindow has not been declared
Qt 6.11 is out! See what's new in the release blog

Ui or MainWindow has not been declared

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.1k 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.
  • B Offline
    B Offline
    BartoszT
    wrote on last edited by
    #1

    QT has not been declared.png
    Hello, I have a problem as seen above, the "mainwindow.h" header file is added, and the Ui :: MainWindow green color confirms this. I don't understand what the problem is.

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

      Hi
      The UI part is declared in
      #include "ui_mainwindow.h"
      The normal.h include forwards it
      namespace Ui { class MainWindow; }
      but its first fully defined in .cpp as it includes the
      #include "ui_mainwindow.h"

      B 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        The UI part is declared in
        #include "ui_mainwindow.h"
        The normal.h include forwards it
        namespace Ui { class MainWindow; }
        but its first fully defined in .cpp as it includes the
        #include "ui_mainwindow.h"

        B Offline
        B Offline
        BartoszT
        wrote on last edited by
        #3

        @mrjj Thanks, it works.

        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