aboutsummaryrefslogtreecommitdiffstats
path: root/textedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'textedit.cpp')
-rw-r--r--textedit.cpp9
1 files changed, 8 insertions, 1 deletions
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<HelpPage *>(tabWidget->currentWidget());
+ document = curPage->getBrowser()->document();
+ } else {
+ document = curTextPage()->document();
+ }
QPrinter printer;
QPrintDialog *dlg = new QPrintDialog(&printer, this);