From 75ef5859b6b249726e10a0d407d8d86d2f6e25a1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 2 Sep 2016 15:42:53 +0200 Subject: [PATCH] Fix compilation of findfiles examples with QT_NO_CLIPBOARD Amends change d1a30be5abcc2d5e5340866434b2691275a135a6. Task-number: QTBUG-55661 Change-Id: Ib7b1b4afd71b3c35493c15c8bf3e2570e321c986 Reviewed-by: Marc Mutz --- examples/widgets/dialogs/findfiles/window.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/widgets/dialogs/findfiles/window.cpp b/examples/widgets/dialogs/findfiles/window.cpp index ce53dd8c83..1c59054524 100644 --- a/examples/widgets/dialogs/findfiles/window.cpp +++ b/examples/widgets/dialogs/findfiles/window.cpp @@ -294,15 +294,19 @@ void Window::contextMenu(const QPoint &pos) if (!item) return; QMenu menu; +#ifndef QT_NO_CLIPBOARD QAction *copyAction = menu.addAction("Copy Name"); +#endif QAction *openAction = menu.addAction("Open"); QAction *action = menu.exec(filesTable->mapToGlobal(pos)); if (!action) return; const QString fileName = fileNameOfItem(item); - if (action == copyAction) - QGuiApplication::clipboard()->setText(QDir::toNativeSeparators(fileName)); - else if (action == openAction) + if (action == openAction) openFile(fileName); +#ifndef QT_NO_CLIPBOARD + else if (action == copyAction) + QGuiApplication::clipboard()->setText(QDir::toNativeSeparators(fileName)); +#endif } //! [16]