aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextcontrol.cpp
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-06-27 16:37:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-04 03:27:34 +0200
commit45d98ceb20c5a45ed3634b7660b81fd8110c7fcd (patch)
treef861786af427edeb22af08ea91967c32c7d204e4 /src/quick/items/qquicktextcontrol.cpp
parentbaee77ef475056e045e2fa41f448a2703e2def07 (diff)
Remove dead code from QQuickTextControl.
Either unused functions, or code paths for signals that aren't connected to anything. Change-Id: Ide24f1263d05f93917a16a3c17cb06a619cd3421 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktextcontrol.cpp')
-rw-r--r--src/quick/items/qquicktextcontrol.cpp70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index b390679a4b..e7b8873fc5 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -108,7 +108,6 @@ QQuickTextControlPrivate::QQuickTextControlPrivate()
acceptRichText(true),
cursorVisible(false),
hasFocus(false),
- isEnabled(true),
hadSelectionOnMousePress(false),
wordSelectionEnabled(false),
hasImState(false),
@@ -737,10 +736,6 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
d->focusEvent(static_cast<QFocusEvent *>(e));
break;
- case QEvent::EnabledChange:
- d->isEnabled = e->isAccepted();
- break;
-
case QEvent::ShortcutOverride:
if (d->interactionFlags & Qt::TextEditable) {
QKeyEvent* ke = static_cast<QKeyEvent *>(e);
@@ -808,11 +803,6 @@ void QQuickTextControl::timerEvent(QTimerEvent *e)
if (e->timerId() == d->cursorBlinkTimer.timerId()) {
d->cursorOn = !d->cursorOn;
- // ###
-// if (d->cursor.hasSelection())
-// d->cursorOn &= (QGuiApplication::style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected)
-// != 0);
-
d->repaintCursor();
} else if (e->timerId() == d->trippleClickTimer.timerId()) {
d->trippleClickTimer.stop();
@@ -1058,47 +1048,6 @@ QRectF QQuickTextControl::selectionRect(const QTextCursor &cursor) const
QTextTable *table = cursor.currentTable();
r = d->doc->documentLayout()->frameBoundingRect(table);
- /*
- int firstRow, numRows, firstColumn, numColumns;
- cursor.selectedTableCells(&firstRow, &numRows, &firstColumn, &numColumns);
-
- const QTextTableCell firstCell = table->cellAt(firstRow, firstColumn);
- const QTextTableCell lastCell = table->cellAt(firstRow + numRows - 1, firstColumn + numColumns - 1);
-
- const QAbstractTextDocumentLayout * const layout = doc->documentLayout();
-
- QRectF tableSelRect = layout->blockBoundingRect(firstCell.firstCursorPosition().block());
-
- for (int col = firstColumn; col < firstColumn + numColumns; ++col) {
- const QTextTableCell cell = table->cellAt(firstRow, col);
- const qreal y = layout->blockBoundingRect(cell.firstCursorPosition().block()).top();
-
- tableSelRect.setTop(qMin(tableSelRect.top(), y));
- }
-
- for (int row = firstRow; row < firstRow + numRows; ++row) {
- const QTextTableCell cell = table->cellAt(row, firstColumn);
- const qreal x = layout->blockBoundingRect(cell.firstCursorPosition().block()).left();
-
- tableSelRect.setLeft(qMin(tableSelRect.left(), x));
- }
-
- for (int col = firstColumn; col < firstColumn + numColumns; ++col) {
- const QTextTableCell cell = table->cellAt(firstRow + numRows - 1, col);
- const qreal y = layout->blockBoundingRect(cell.lastCursorPosition().block()).bottom();
-
- tableSelRect.setBottom(qMax(tableSelRect.bottom(), y));
- }
-
- for (int row = firstRow; row < firstRow + numRows; ++row) {
- const QTextTableCell cell = table->cellAt(row, firstColumn + numColumns - 1);
- const qreal x = layout->blockBoundingRect(cell.lastCursorPosition().block()).right();
-
- tableSelRect.setRight(qMax(tableSelRect.right(), x));
- }
-
- r = tableSelRect.toRect();
- */
} else if (cursor.hasSelection()) {
const int position = cursor.selectionStart();
const int anchor = cursor.selectionEnd();
@@ -1223,14 +1172,6 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
{
Q_Q(QQuickTextControl);
- if (interactionFlags & Qt::LinksAccessibleByMouse) {
- QString anchor = q->anchorAt(mousePos);
- if (anchor != highlightedAnchor) {
- highlightedAnchor = anchor;
- emit q->linkHovered(anchor);
- }
- }
-
if ((e->buttons() & Qt::LeftButton)) {
const bool editable = interactionFlags & Qt::TextEditable;
@@ -1548,17 +1489,6 @@ void QQuickTextControl::setCursorVisible(bool visible)
&& (d->interactionFlags & (Qt::TextEditable | Qt::TextSelectableByKeyboard)));
}
-QTextCursor QQuickTextControl::cursorForPosition(const QPointF &pos) const
-{
- Q_D(const QQuickTextControl);
- int cursorPos = hitTest(pos, Qt::FuzzyHit);
- if (cursorPos == -1)
- cursorPos = 0;
- QTextCursor c(d->doc);
- c.setPosition(cursorPos);
- return c;
-}
-
QRectF QQuickTextControl::cursorRect(const QTextCursor &cursor) const
{
Q_D(const QQuickTextControl);