diff options
| author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-05-30 16:51:34 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-31 10:45:23 +0200 |
| commit | 8beda08087effd684cfcb325855c9f4b47186135 (patch) | |
| tree | 4d529ea10892e2840110e6fd3527cc8459e0bb5a /examples/quick/controls/text/src | |
| parent | 9490e1161817ad74d5441db79bd8bde5c8c8db91 (diff) | |
Cleaning up some examples and removing clutter
We want to use more layouts in our examples as it is the
recommended way to create tool bars etc.
Change-Id: Ib3b1e8e907cc5277d522557a19d2c294a7d251b1
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'examples/quick/controls/text/src')
| -rw-r--r-- | examples/quick/controls/text/src/documenthandler.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/quick/controls/text/src/documenthandler.cpp b/examples/quick/controls/text/src/documenthandler.cpp index 48b6d033c..81eb744b6 100644 --- a/examples/quick/controls/text/src/documenthandler.cpp +++ b/examples/quick/controls/text/src/documenthandler.cpp @@ -166,13 +166,11 @@ void DocumentHandler::mergeFormatOnWordOrSelection(const QTextCharFormat &format void DocumentHandler::setSelectionStart(int position) { m_selectionStart = position; -// emit selectionStartChanged(); } void DocumentHandler::setSelectionEnd(int position) { m_selectionEnd = position; -// emit selectionEndChanged(); } void DocumentHandler::setAlignment(Qt::Alignment a) @@ -188,10 +186,8 @@ void DocumentHandler::setAlignment(Qt::Alignment a) Qt::Alignment DocumentHandler::alignment() const { -// if (!m_doc || m_doc->isEmpty() || m_cursorPosition < 0) -// return Qt::AlignLeft; QTextCursor cursor = textCursor(); - if (cursor.isNull() || cursor.blockNumber() == 0) + if (cursor.isNull()) return Qt::AlignLeft; return textCursor().blockFormat().alignment(); } @@ -199,7 +195,7 @@ Qt::Alignment DocumentHandler::alignment() const bool DocumentHandler::bold() const { QTextCursor cursor = textCursor(); - if (cursor.isNull() || cursor.blockNumber() == 0) + if (cursor.isNull()) return false; return textCursor().charFormat().fontWeight() == QFont::Bold; } @@ -207,7 +203,7 @@ bool DocumentHandler::bold() const bool DocumentHandler::italic() const { QTextCursor cursor = textCursor(); - if (cursor.isNull() || cursor.blockNumber() == 0) + if (cursor.isNull()) return false; return textCursor().charFormat().fontItalic(); } @@ -215,7 +211,7 @@ bool DocumentHandler::italic() const bool DocumentHandler::underline() const { QTextCursor cursor = textCursor(); - if (cursor.isNull() || cursor.blockNumber() == 0) + if (cursor.isNull()) return false; return textCursor().charFormat().fontUnderline(); } |
