Qt World Summit: Register Today!

My <QtGui> file is not working

  • 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.

    #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.

  • Moderators

    try #include <QtWidgets> ;)

  • 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:


Log in to reply