diff options
-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. |