From 3c5ca80a244b152de29ff3f8375aec893586c547 Mon Sep 17 00:00:00 2001 From: ubbo Date: Thu, 29 Dec 2011 01:10:56 +0000 Subject: fix crash and enable printing of help pages git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@717 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- textedit.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'textedit.cpp') diff --git a/textedit.cpp b/textedit.cpp index b3b9f58..6c5cb3b 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -394,8 +394,15 @@ void TextEdit::print() return; } + #ifndef QT_NO_PRINTER - QTextDocument *document = curTextPage()->document(); + QTextDocument *document; + if(curTextPage() == 0) { + HelpPage *curPage = qobject_cast(tabWidget->currentWidget()); + document = curPage->getBrowser()->document(); + } else { + document = curTextPage()->document(); + } QPrinter printer; QPrintDialog *dlg = new QPrintDialog(&printer, this); -- cgit v1.2.3