aboutsummaryrefslogtreecommitdiffstats
path: root/textedit.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-29 01:10:56 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-29 01:10:56 +0000
commit3c5ca80a244b152de29ff3f8375aec893586c547 (patch)
tree69e80bceb8330ef3f65e065f8e5c130106ece998 /textedit.cpp
parentadd method to access helpbrowser (diff)
downloadgpg4usb-3c5ca80a244b152de29ff3f8375aec893586c547.tar.gz
gpg4usb-3c5ca80a244b152de29ff3f8375aec893586c547.zip
fix crash and enable printing of help pages
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@717 34ebc366-c3a9-4b3c-9f84-69acf7962910
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);