Commit e2814a3c authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use more qobject_cast with QObject subclasses

parent 2b8a45fd
...@@ -75,7 +75,7 @@ void JobPlan::parseJobCreated(ParseJob* job) ...@@ -75,7 +75,7 @@ void JobPlan::parseJobCreated(ParseJob* job)
return; return;
} }
auto* testJob = dynamic_cast<TestParseJob*>(job); auto* testJob = qobject_cast<TestParseJob*>(job);
Q_ASSERT(testJob); Q_ASSERT(testJob);
qDebug() << "assigning propierties for created job" << testJob->document().toUrl(); qDebug() << "assigning propierties for created job" << testJob->document().toUrl();
......
...@@ -626,7 +626,7 @@ void CodeHighlighting::aboutToRemoveText(const KTextEditor::Range& range) ...@@ -626,7 +626,7 @@ void CodeHighlighting::aboutToRemoveText(const KTextEditor::Range& range)
VERIFY_FOREGROUND_LOCKED VERIFY_FOREGROUND_LOCKED
QMutexLocker lock(&m_dataMutex); QMutexLocker lock(&m_dataMutex);
Q_ASSERT(dynamic_cast<KTextEditor::Document*>(sender())); Q_ASSERT(qobject_cast<KTextEditor::Document*>(sender()));
auto* doc = static_cast<KTextEditor::Document*>(sender()); auto* doc = static_cast<KTextEditor::Document*>(sender());
DocumentChangeTracker* tracker = ICore::self()->languageController()->backgroundParser() DocumentChangeTracker* tracker = ICore::self()->languageController()->backgroundParser()
......
...@@ -413,7 +413,7 @@ int ExpandingWidgetModel::basicRowHeight(const QModelIndex& idx_) const ...@@ -413,7 +413,7 @@ int ExpandingWidgetModel::basicRowHeight(const QModelIndex& idx_) const
QModelIndex idx(firstColumn(idx_)); QModelIndex idx(firstColumn(idx_));
auto* delegate = dynamic_cast<ExpandingDelegate*>(treeView()->itemDelegate(idx)); auto* delegate = qobject_cast<ExpandingDelegate*>(treeView()->itemDelegate(idx));
if (!delegate || !idx.isValid()) { if (!delegate || !idx.isValid()) {
qCDebug(PLUGIN_QUICKOPEN) << "ExpandingWidgetModel::basicRowHeight: Could not get delegate"; qCDebug(PLUGIN_QUICKOPEN) << "ExpandingWidgetModel::basicRowHeight: Could not get delegate";
return 15; return 15;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment