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. My <QtGui> file is not working
Forum Updated to NodeBB v4.3 + New Features

My <QtGui> file is not working

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

    I think that my <QtGui> file is incomplete or has nothing in it. When I substitute the header file for the many widget classes I need for my project (as per the tutorial instructions), it's supposed to save typing and space in the .cpp file. It will not work. I think that the file is incomplete or has nothing in it.
    This...

    #include <QtGui>

    instead of...

    #include <QWidget>
    #include <QVBoxLayout>
    #include <QHBoxLayout>
    #include <QPushButton>

    Does not work.

    Does anyone have an answer as to how come the <QtGui> header file is not working? Thanks.

    raven-worxR 1 Reply Last reply
    0
    • T TMahoney1979

      I think that my <QtGui> file is incomplete or has nothing in it. When I substitute the header file for the many widget classes I need for my project (as per the tutorial instructions), it's supposed to save typing and space in the .cpp file. It will not work. I think that the file is incomplete or has nothing in it.
      This...

      #include <QtGui>

      instead of...

      #include <QWidget>
      #include <QVBoxLayout>
      #include <QHBoxLayout>
      #include <QPushButton>

      Does not work.

      Does anyone have an answer as to how come the <QtGui> header file is not working? Thanks.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @TMahoney1979
      try #include <QtWidgets> ;)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3
      • mranger90M Offline
        mranger90M Offline
        mranger90
        wrote on last edited by
        #3

        As raven-worx pointed out, you should include QtWidgets.
        This has been necessary since Qt 5.0
        I suspect you are looking at code/examples or a book based on Qt 4.X.
        If so, you should reference:

        https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
        
        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved