aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--textedit.cpp18
-rw-r--r--textedit.h2
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();
}
diff --git a/textedit.h b/textedit.h
index 4b5a1b3..dfe5d4a 100644
--- a/textedit.h
+++ b/textedit.h
@@ -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.