Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. Problem with Qt empty projet
QtWS25 Last Chance

Problem with Qt empty projet

Scheduled Pinned Locked Moved Qt in Education
3 Posts 3 Posters 1.9k 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.
  • N Offline
    N Offline
    Nabil
    wrote on last edited by
    #1

    Hello every body,

    i have a little problem with Qt. when i open a new project, i choose empty project Qt.
    i then when it is open i can't include QApplication i don't know why ? can you help me please.

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

      Hi,

      I recommend starting with a "Qt Gui Application" or a "Qt Console Application" instead of a blank project. If you choose those, Qt Creator will help you set up some important parts.

      But to answer your question:

      Your .pro file is empty. You need to add the modules you want. All Qt projects automatically include the Qt Core and Qt GUI modules, but you'll need to add other modules yourself.

      QApplication belongs in the Qt Widgets module. To include that, add the line "QT += widgets" to your .pro file.

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

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lex
        wrote on last edited by
        #3

        The solution is adding this

         QT += widgets
        

        line to your *.pro file, as JKSH said. Don't forget to save it and you'll be able now to include <QApplication> module to your main.cpp

        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