diff options
author | Liang Qi <liang.qi@qt.io> | 2018-02-16 08:54:58 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-02-16 08:54:58 +0100 |
commit | 942ab490724fcc9544e786e5783718e1a07aa50b (patch) | |
tree | feb7d3ff716edb37b2ca60e33c05adf8777bd964 /examples | |
parent | 0fb8271a467202990c90321066e40faed640a7a8 (diff) | |
parent | 24adaa9a742e6f95ff897d0eb9a2bce0527dd042 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/corelib/tools/tools.pri
Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9
Diffstat (limited to 'examples')
-rw-r--r-- | examples/corelib/ipc/ipc.pro | 6 | ||||
-rw-r--r-- | examples/gui/rasterwindow/rasterwindow.cpp | 1 | ||||
-rw-r--r-- | examples/opengl/hellogles3/main.cpp | 4 | ||||
-rw-r--r-- | examples/widgets/doc/src/validators.qdoc | 1 | ||||
-rw-r--r-- | examples/widgets/tutorials/notepad/notepad.cpp | 11 | ||||
-rw-r--r-- | examples/widgets/tutorials/notepad/notepad.pro | 2 |
6 files changed, 20 insertions, 5 deletions
diff --git a/examples/corelib/ipc/ipc.pro b/examples/corelib/ipc/ipc.pro index 101552cea9..68c88d75aa 100644 --- a/examples/corelib/ipc/ipc.pro +++ b/examples/corelib/ipc/ipc.pro @@ -3,4 +3,8 @@ requires(qtHaveModule(widgets)) TEMPLATE = subdirs qtConfig(sharedmemory): SUBDIRS = sharedmemory -qtHaveModule(network): SUBDIRS += localfortuneserver localfortuneclient +qtHaveModule(network) { + QT_FOR_CONFIG += network + + qtConfig(localserver): SUBDIRS += localfortuneserver localfortuneclient +} diff --git a/examples/gui/rasterwindow/rasterwindow.cpp b/examples/gui/rasterwindow/rasterwindow.cpp index 68d1d7f524..3eacd20145 100644 --- a/examples/gui/rasterwindow/rasterwindow.cpp +++ b/examples/gui/rasterwindow/rasterwindow.cpp @@ -111,6 +111,7 @@ void RasterWindow::renderNow() painter.fillRect(0, 0, width(), height(), Qt::white); render(&painter); + painter.end(); m_backingStore->endPaint(); m_backingStore->flush(rect); diff --git a/examples/opengl/hellogles3/main.cpp b/examples/opengl/hellogles3/main.cpp index a6c6398628..29b3b9617a 100644 --- a/examples/opengl/hellogles3/main.cpp +++ b/examples/opengl/hellogles3/main.cpp @@ -64,6 +64,8 @@ int main(int argc, char *argv[]) { + QGuiApplication app(argc, argv); + QSurfaceFormat fmt; fmt.setDepthBufferSize(24); @@ -79,8 +81,6 @@ int main(int argc, char *argv[]) QSurfaceFormat::setDefaultFormat(fmt); - QGuiApplication app(argc, argv); - GLWindow glWindow; glWindow.showMaximized(); diff --git a/examples/widgets/doc/src/validators.qdoc b/examples/widgets/doc/src/validators.qdoc index bbb2e5f7b6..9d82f3f575 100644 --- a/examples/widgets/doc/src/validators.qdoc +++ b/examples/widgets/doc/src/validators.qdoc @@ -28,7 +28,6 @@ /*! \example widgets/validators \title Validators Example - \ingroup examples-widgets \brief The Validators example shows the signal emission behavior of input validators. diff --git a/examples/widgets/tutorials/notepad/notepad.cpp b/examples/widgets/tutorials/notepad/notepad.cpp index b4f6cf7f8f..44d8597cb7 100644 --- a/examples/widgets/tutorials/notepad/notepad.cpp +++ b/examples/widgets/tutorials/notepad/notepad.cpp @@ -52,8 +52,15 @@ #include <QFileDialog> #include <QTextStream> #include <QMessageBox> +#if defined(QT_PRINTSUPPORT_LIB) +#include <QtPrintSupport/qtprintsupportglobal.h> +#if QT_CONFIG(printer) +#if QT_CONFIG(printdialog) #include <QPrintDialog> +#endif // QT_CONFIG(printdialog) #include <QPrinter> +#endif // QT_CONFIG(printer) +#endif // QT_PRINTSUPPORT_LIB #include <QFont> #include <QFontDialog> @@ -136,11 +143,15 @@ void Notepad::on_actionSave_as_triggered() void Notepad::on_actionPrint_triggered() { +#if QT_CONFIG(printer) QPrinter printDev; +#if QT_CONFIG(printdialog) QPrintDialog dialog(&printDev, this); if (dialog.exec() == QDialog::Rejected) return; +#endif // QT_CONFIG(printdialog) ui->textEdit->print(&printDev); +#endif // QT_CONFIG(printer) } void Notepad::on_actionExit_triggered() diff --git a/examples/widgets/tutorials/notepad/notepad.pro b/examples/widgets/tutorials/notepad/notepad.pro index a552dacf00..6451f22735 100644 --- a/examples/widgets/tutorials/notepad/notepad.pro +++ b/examples/widgets/tutorials/notepad/notepad.pro @@ -1,7 +1,7 @@ TEMPLATE = app TARGET = notepad -QT += printsupport +qtHaveModule(printsupport): QT += printsupport requires(qtConfig(fontdialog)) SOURCES += \ |