From c7f59cad196dae2ee83e2073e546428695f0e1f0 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 29 Jan 2020 19:58:01 +0100 Subject: Examples: fix compile without printsupport Checking for QT_CONFIG(printdialog) is not enough when printsupport is completely disabled since then the macro will throw an error. Therefore add an additional check 'defined(QT_PRINTSUPPORT_LIB)' before using the QT_CONFIG macro. Fixes: QTBUG-81626 Change-Id: Ie9898f057cdd6bf9daf4ba9135987cb6e901e7bf Reviewed-by: Friedemann Kleint --- examples/widgets/tutorials/notepad/notepad.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/widgets/tutorials') diff --git a/examples/widgets/tutorials/notepad/notepad.cpp b/examples/widgets/tutorials/notepad/notepad.cpp index 2ccd6501a1..5fd0d69cea 100644 --- a/examples/widgets/tutorials/notepad/notepad.cpp +++ b/examples/widgets/tutorials/notepad/notepad.cpp @@ -92,7 +92,7 @@ Notepad::Notepad(QWidget *parent) : connect(ui->actionAbout, &QAction::triggered, this, &Notepad::about); // Disable menu actions for unavailable features -#if !QT_CONFIG(printer) +#if !defined(QT_PRINTSUPPORT_LIB) || !QT_CONFIG(printer) ui->actionPrint->setEnabled(false); #endif @@ -171,7 +171,7 @@ void Notepad::saveAs() void Notepad::print() { -#if QT_CONFIG(printer) +#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printer) QPrinter printDev; #if QT_CONFIG(printdialog) QPrintDialog dialog(&printDev, this); -- cgit v1.2.3