diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-29 01:10:56 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-29 01:10:56 +0000 |
commit | 3c5ca80a244b152de29ff3f8375aec893586c547 (patch) | |
tree | 69e80bceb8330ef3f65e065f8e5c130106ece998 /textedit.cpp | |
parent | add method to access helpbrowser (diff) | |
download | gpg4usb-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.cpp | 9 |
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); |