[TD] Gui: remove some superfluous nullptr checks

This commit is contained in:
Uwe
2022-07-19 02:49:46 +02:00
parent 003757176c
commit 2e5e4dced8
38 changed files with 154 additions and 160 deletions

View File

@@ -59,7 +59,7 @@ QGTracker::QGTracker(QGSPage* inScene, TrackerMode m):
m_lastClick(QPointF(FLT_MAX,FLT_MAX))
{
setTrackerMode(m);
if (inScene != nullptr) {
if (inScene) {
inScene->addItem(this);
} else {
throw Base::ValueError("QGT::QGT() - passed scene is NULL\n");
@@ -321,13 +321,13 @@ void QGTracker::getPickedQGIV(QPointF pos)
QGraphicsView* ourView = views.front(); //only 1 view / 1 scene / 1 mdipage
QTransform viewXForm = ourView->transform();
QGraphicsItem* pickedItem = scene()->itemAt(pos,viewXForm);
if (pickedItem != nullptr) {
if (pickedItem) {
QGraphicsItem* topItem = pickedItem->topLevelItem();
if (topItem != pickedItem) {
pickedItem = topItem;
} //pickedItem sb a QGIV
QGIView* qgParent = dynamic_cast<QGIView*>(pickedItem);
if (qgParent != nullptr) {
if (qgParent) {
m_qgParent = qgParent;
}
}