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. Good initializer but incomplete type error
Forum Updated to NodeBB v4.3 + New Features

Good initializer but incomplete type error

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 2.7k Views 3 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
    TMahoney1979
    wrote on last edited by
    #1

    Does anyone see a problem with this code, because I do not. Thanks.

    #include <QtGui>

    int main(int argv, char **args)
    {
    QApplication app(args, argv);

    return app.exec();
    

    }

    JKSHJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Change:

      #include <QtGui> by #include <QApplication>

      In any case, if you are using Qt 5, QApplication is in the QtWidget module.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      T 1 Reply Last reply
      4
      • T TMahoney1979

        Does anyone see a problem with this code, because I do not. Thanks.

        #include <QtGui>

        int main(int argv, char **args)
        {
        QApplication app(args, argv);

        return app.exec();
        

        }

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @TMahoney1979 said in Good initializer but incomplete type error:

        Does anyone see a problem with this code, because I do not. Thanks.

        ...

        int main(int argv, char **args)
        {
        QApplication app(args, argv);

        @SGaist has identified the main problem.

        However, the code you wrote won't compile either, because argv and args are the wrong way round in your QApplication constructor. (Moreover, they are conventionally int argc and char **argv)

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

        1 Reply Last reply
        5
        • SGaistS SGaist

          Hi and welcome to devnet,

          Change:

          #include <QtGui> by #include <QApplication>

          In any case, if you are using Qt 5, QApplication is in the QtWidget module.

          T Offline
          T Offline
          TMahoney1979
          wrote on last edited by
          #4

          Thanks, guys. Do you mean use <QApplication> instead of <QtGui> or include both. Thanks again.

          1 Reply Last reply
          0
          • Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @SGaist said in Good initializer but incomplete type error:
            Change #include <QtGui> by #include <QApplication>

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            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