diff options
author | Laszlo Papp <lpapp@kde.org> | 2012-04-04 20:22:56 +0300 |
---|---|---|
committer | Denis Shienkov <scapig@yandex.ru> | 2012-04-05 08:32:53 +0200 |
commit | 80c1fb9cf6be2a45b730cc7be62fc6b5627d2b5f (patch) | |
tree | fc34f23da0e60fdf01b44da19595ca1b2431dbc8 /examples | |
parent | 1ba2004b9333d3f308de896aa2a0d10222f73287 (diff) | |
download | qtserialport-80c1fb9cf6be2a45b730cc7be62fc6b5627d2b5f.tar.gz |
Make the enumerator example work with Qt4 and Qt5 as well
* Do not use QtWidgets module name in the include statement, otherwise it needs
conditional Qt4/Qt5 including.
* Check against the availability of QT serialport, and if not present, include
the Qt4 style serialport.prf file which takes care of the INCLUDEPATH and LIBS
variables
Change-Id: I4cf174324ce4382cbfb2eff6c9624142d74cb53a
Reviewed-by: Denis Shienkov <scapig@yandex.ru>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/enumerator/enumerator.pro | 9 | ||||
-rw-r--r-- | examples/enumerator/main.cpp | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/examples/enumerator/enumerator.pro b/examples/enumerator/enumerator.pro index a6e1d8d..92ecb5e 100644 --- a/examples/enumerator/enumerator.pro +++ b/examples/enumerator/enumerator.pro @@ -1,8 +1,11 @@ -QT += widgets serialport +greaterThan(QT_MAJOR_VERSION, 4) { + QT += widgets serialport +} else { + include($$SERIALPORT_PROJECT_ROOT/src/qt4support/serialport.prf) +} TARGET = enumerator TEMPLATE = app - SOURCES += \ - main.cpp
\ No newline at end of file + main.cpp diff --git a/examples/enumerator/main.cpp b/examples/enumerator/main.cpp index 96183ed..b5d8459 100644 --- a/examples/enumerator/main.cpp +++ b/examples/enumerator/main.cpp @@ -1,7 +1,7 @@ -#include <QtWidgets/QApplication> -#include <QtWidgets/QWidget> -#include <QtWidgets/QVBoxLayout> -#include <QtWidgets/QLabel> +#include <QApplication> +#include <QWidget> +#include <QVBoxLayout> +#include <QLabel> #include <QtAddOnSerialPort/serialportinfo.h> QT_USE_NAMESPACE_SERIALPORT |