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. Getting started with problems
Forum Updated to NodeBB v4.3 + New Features

Getting started with problems

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

    Hi all
    Just started programming QT, but faced with some problems. Trying to create an empty project i got an error:
    in my source file:
    @#include <QtGui>

    int main(int argc, char** argv)
    {
    QApplication a(argc, argv);
    return a.exec();
    }
    @
    in my project file:
    @QT += core gui

    TEMPLATE = app

    SOURCES +=
    main.cpp
    CONFIG += qt warn_on
    @
    D:\Qt\Projects\EmptyOne\main.cpp:5: ошибка: variable 'QApplication a' has initializer but incomplete type
    QApplication a(argc, argv);
    whats wrong?
    my book says that QtGui already included definitions of class QApplication... Qt 5.1

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guziemic
      wrote on last edited by
      #2

      Hi,

      Please refer to "Thread ":http://qt-project.org/forums/viewthread/18766 that tackles problem of includes and gives information about problems of including whole modules.

      Best regards,
      guziemic

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        Your book is based on Qt4, but you are using Qt5. QApplication is no longer found in QtGui module, it now resides in QtWidgets.

        (Z(:^

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tzi0
          wrote on last edited by
          #4

          [quote author="sierdzio" date="1379479065"]Your book is based on Qt4, but you are using Qt5. QApplication is no longer found in QtGui module, it now resides in QtWidgets.[/quote]

          Oh thanks

          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