aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-10-02 12:42:39 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-10-09 19:01:19 +0200
commitaa02de3c2a3a41e897814b751ec810074f250893 (patch)
tree7897c278aecf3dd6b902e994dcfa88684e8656a7
parent2d9cf3ef0fc09254b1a63ab04b86d9beb52e71bc (diff)
Prepare for QTextBlockFormat::MarkerType to be an enum class
Use it in fully scoped form, and treat it as int in qDebug. Unfortunately since QTextBlockFormat is not a QObject, we can't easily use Q_ENUM to have moc translate the enum values to strings. Change-Id: I2eb605e8f2756ce62dcbaffa6bfed237ada4021d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/quick/items/qquicktextcontrol.cpp6
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 127b3c3516..3c392be751 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -1212,8 +1212,8 @@ void QQuickTextControlPrivate::mouseReleaseEvent(QMouseEvent *e, const QPointF &
QTextBlock block = q->blockWithMarkerAt(pos);
if (block == blockWithMarkerUnderMousePress) {
auto fmt = block.blockFormat();
- fmt.setMarker(fmt.marker() == QTextBlockFormat::Unchecked ?
- QTextBlockFormat::Checked : QTextBlockFormat::Unchecked);
+ fmt.setMarker(fmt.marker() == QTextBlockFormat::MarkerType::Unchecked ?
+ QTextBlockFormat::MarkerType::Checked : QTextBlockFormat::MarkerType::Unchecked);
cursor.setBlockFormat(fmt);
}
}
@@ -1507,7 +1507,7 @@ void QQuickTextControlPrivate::hoverEvent(QHoverEvent *e, const QPointF &pos)
emit q->markerHovered(block.isValid());
hoveredMarker = block.isValid();
if (hoveredMarker)
- qCDebug(DBG_HOVER_TRACE) << q << e->type() << pos << "hovered marker" << block.blockFormat().marker() << block.text();
+ qCDebug(DBG_HOVER_TRACE) << q << e->type() << pos << "hovered marker" << int(block.blockFormat().marker()) << block.text();
}
}
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index f8ebf13a1d..a0ae4e5f97 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -1012,13 +1012,13 @@ void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QText
};
switch (block.blockFormat().marker()) {
- case QTextBlockFormat::Checked:
+ case QTextBlockFormat::MarkerType::Checked:
listItemBullet = QChar(0x2612); // Checked checkbox
break;
- case QTextBlockFormat::Unchecked:
+ case QTextBlockFormat::MarkerType::Unchecked:
listItemBullet = QChar(0x2610); // Unchecked checkbox
break;
- case QTextBlockFormat::NoMarker:
+ case QTextBlockFormat::MarkerType::NoMarker:
break;
}