Thanks wysota.
I did it, so my project file looks like this:
QT += widgets
SOURCES += \
main.cpp
QT += widgets
SOURCES += \
main.cpp
To copy to clipboard, switch view to plain text mode
I tryed to compile without modifying the main.cpp and I got the exact same error.
I figured out that I actually had to write:
#include <QtWidgets/QApplication>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QApplication>
#include <QtWidgets/QPushButton>
To copy to clipboard, switch view to plain text mode
instead of:
#include <QApplication>
#include <QPushButton>
#include <QApplication>
#include <QPushButton>
To copy to clipboard, switch view to plain text mode
for it to work.
What I still don't understand is that the examples given in Qt creator use
#include <QApplication>
#include <QApplication>
To copy to clipboard, switch view to plain text mode
and they compile without complaining.
Bookmarks