aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-29 01:11:01 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-29 01:11:01 +0000
commit7a526711a50aa5241de65a6d3cdd5880d00fa90c (patch)
treeb6e394b212dd856561d1b0ff1326d98dca8e4a4b
parentfix crash and enable printing of help pages (diff)
downloadgpg4usb-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.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.