diff options
Diffstat (limited to 'examples/serialport/enumerator/main.cpp')
-rw-r--r-- | examples/serialport/enumerator/main.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/serialport/enumerator/main.cpp b/examples/serialport/enumerator/main.cpp index e7564ec..41bfddd 100644 --- a/examples/serialport/enumerator/main.cpp +++ b/examples/serialport/enumerator/main.cpp @@ -36,6 +36,7 @@ #include <QWidget> #include <QVBoxLayout> #include <QLabel> +#include <QScrollArea> #include <QtSerialPort/QSerialPortInfo> QT_USE_NAMESPACE @@ -44,8 +45,6 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); - QWidget w; - w.setWindowTitle(QObject::tr("Info about all available serial ports.")); QVBoxLayout *layout = new QVBoxLayout; foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) { @@ -62,8 +61,13 @@ int main(int argc, char *argv[]) layout->addWidget(label); } - w.setLayout(layout); - w.show(); + QWidget *workPage = new QWidget; + workPage->setLayout(layout); + + QScrollArea area; + area.setWindowTitle(QObject::tr("Info about all available serial ports.")); + area.setWidget(workPage); + area.show(); return a.exec(); } |