From 6c3f864ec00c4e20a05f60032048e9fe2c7e116c Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 15 Jan 2018 08:59:09 +0100 Subject: examples: Fix notepad example for configurations without printsupport Task-number: QTBUG-65735 Change-Id: I7e0d19de4ac92603f2fd033007343f20a408618a Reviewed-by: Nico Vertriest --- examples/widgets/tutorials/notepad/notepad.cpp | 11 +++++++++++ examples/widgets/tutorials/notepad/notepad.pro | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'examples') 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 #include #include +#if defined(QT_PRINTSUPPORT_LIB) +#include +#if QT_CONFIG(printer) +#if QT_CONFIG(printdialog) #include +#endif // QT_CONFIG(printdialog) #include +#endif // QT_CONFIG(printer) +#endif // QT_PRINTSUPPORT_LIB #include #include @@ -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 += \ -- cgit v1.2.3 From b0310ddd163847beabf7da66c2190d0b9b5e6afb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 26 Jan 2018 09:46:24 +0100 Subject: hellogles3 example: Fix start-up crash when using dynamic GL Move the instantiation of QGuiApplication to the top since it is required by QOpenGLContext::openGLModuleType(). Task-number: QTBUG-55671 Change-Id: I506cee193fe2ba48400851588a8ef079848bc2f4 Reviewed-by: Laszlo Agocs --- examples/opengl/hellogles3/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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(); -- cgit v1.2.3 From 5a05348fb6c3940449a9c2950bb65bdea2112a15 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Tue, 23 Jan 2018 14:06:53 +0100 Subject: examples: Add localserver feature check for localfortune examples Change-Id: I536645ddf0a5ead31a2658d03984c1226a7c39c8 Reviewed-by: Oswald Buddenhagen --- examples/corelib/ipc/ipc.pro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') 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 +} -- cgit v1.2.3 From 11f6c646967c61e3eac6302a2d4ea8f30a41beff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 24 Jan 2018 12:35:29 +0100 Subject: rasterwindow: End painting on device before ending on backingstore Change-Id: Ib42de1d7ad0d14e2e2d2ff75606e6cfd7e584c2a Reviewed-by: Simon Hausmann --- examples/gui/rasterwindow/rasterwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'examples') 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); -- cgit v1.2.3 From 2908a13a789c9217be312e51066df326028a418d Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Wed, 7 Feb 2018 12:24:53 +0100 Subject: Doc: Remove Validators example from highlighted widgets examples Contains several bugs. Task-number: QTBUG-60635 Change-Id: I64d7431ebab2e3f7776e7d2a94e301d677c1bb1e Reviewed-by: Frederik Gladhorn --- examples/widgets/doc/src/validators.qdoc | 1 - 1 file changed, 1 deletion(-) (limited to 'examples') 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. -- cgit v1.2.3