diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-29 01:11:01 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-29 01:11:01 +0000 |
commit | 7a526711a50aa5241de65a6d3cdd5880d00fa90c (patch) | |
tree | b6e394b212dd856561d1b0ff1326d98dca8e4a4b | |
parent | fix crash and enable printing of help pages (diff) | |
download | gpg4usb-7a526711a50aa5241de65a6d3cdd5880d00fa90c.tar.gz gpg4usb-7a526711a50aa5241de65a6d3cdd5880d00fa90c.zip |
method for curHelpPage
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@718 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | textedit.cpp | 18 | ||||
-rw-r--r-- | textedit.h | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/textedit.cpp b/textedit.cpp index 6c5cb3b..97c13ad 100644 --- a/textedit.cpp +++ b/textedit.cpp @@ -321,6 +321,14 @@ QTextEdit* TextEdit::curTextPage() } } +QTextBrowser* TextEdit::curHelpPage() { + HelpPage *curHelpPage = qobject_cast<HelpPage *>(tabWidget->currentWidget()); + if(curHelpPage != 0) { + return curHelpPage->getBrowser(); + } else { + return 0; + } +} int TextEdit::tabCount() { @@ -394,12 +402,10 @@ void TextEdit::print() return; } - #ifndef QT_NO_PRINTER QTextDocument *document; if(curTextPage() == 0) { - HelpPage *curPage = qobject_cast<HelpPage *>(tabWidget->currentWidget()); - document = curPage->getBrowser()->document(); + document = curHelpPage()->document(); } else { document = curTextPage()->document(); } @@ -470,10 +476,14 @@ void TextEdit::cut() void TextEdit::copy() { - if (tabWidget->count() == 0 || curTextPage() == 0) { + if (tabWidget->count() == 0) { return; } + if(curTextPage() == 0) { + + } + curTextPage()->copy(); } @@ -82,6 +82,8 @@ public: */ QTextEdit* curTextPage(); + QTextBrowser* curHelpPage(); + /** * @details List of currently unsaved tabs. * @returns QHash<int, QString> Hash of tabindexes and title of unsaved tabs. |