Fix Qt deprectation warnings

This commit is contained in:
Dušan Poizl 2023-12-18 16:03:04 +01:00
parent 2134f13b06
commit aef41f5f6b
3 changed files with 5 additions and 4 deletions

@ -201,7 +201,8 @@ void FITSFileModel::prepareQuery()
if(lastError().type() != QSqlError::NoError)
qDebug() << "Database error" << lastError();
m_markedFiles = m_database->getMarkedFiles().toSet();
QStringList list = m_database->getMarkedFiles();
m_markedFiles = QSet<QString>(list.begin(), list.end());
}
DatabaseTableView::DatabaseTableView(QWidget *parent) : QTableView(parent)

@ -106,7 +106,7 @@ void ImageScrollArea::wheelEvent(QWheelEvent *event)
m_scale = (float)size().width()/m_pixmap.size().width();
QPointF top(horizontalScrollBar()->value(), verticalScrollBar()->value());
QPointF mousePos = (top + event->posF()) / m_scale;
QPointF mousePos = (top + event->position()) / m_scale;
QPoint delta = event->angleDelta();
if(delta.y() > 0)
@ -115,7 +115,7 @@ void ImageScrollArea::wheelEvent(QWheelEvent *event)
setScale(m_scale - 0.1);
mousePos *= m_scale;
top = mousePos - event->posF();
top = mousePos - event->position();
horizontalScrollBar()->setValue(top.x());
verticalScrollBar()->setValue(top.y());
}

@ -637,7 +637,7 @@ void ImageWidget::wheelEvent(QWheelEvent *event)
else
{
if(std::abs(event->angleDelta().y()) > 15)
zoom(event->angleDelta().y(), event->modifiers() & Qt::ShiftModifier ? QPointF() : event->posF());
zoom(event->angleDelta().y(), event->modifiers() & Qt::ShiftModifier ? QPointF() : event->position());
}
}