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. Qt 5 beta include files not found
Forum Updated to NodeBB v4.3 + New Features

Qt 5 beta include files not found

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 6.6k 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.
  • M Offline
    M Offline
    muhahaa
    wrote on last edited by
    #1

    #include <QMainWindow>
    Cannot open include file: 'QMainWindow': No such file or directory

    I get these errors in projects which were originally 4.8. If I make a completely new project with new sources, it works correctly. Any solutions?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      In Qt 4.8, widgets were in the Qt GUI module. In Qt 5, they have moved to their own Qt Widgets module.

      Add this to your .pro file to load the Qt Widgets module (where QMainWindow now lives):

      @
      QT += widgets
      @

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on last edited by
        #3

        All the modules moved from QtGui to QtWidgets.

        So you most likely need to add Qt += widgets into your .pro-file.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          valdomiromorais
          wrote on last edited by
          #4

          thanks youuuuuu!!!

          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