Skip to content

Commit

Permalink
Fixed build issues when using Qt 5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dlangenkamp-avt committed Dec 16, 2022
1 parent e197032 commit 3182b80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Source/CustomGraphicsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ void CustomGraphicsView::wheelEvent(QWheelEvent *event)
{
if (m_bIsZoomAllowed)
{
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
QPointF point = mapToScene(event->position().toPoint());
#else
QPointF point = mapToScene(event->pos());
#endif
centerOn(point);
if (event->angleDelta().y() > 0)
OnZoomIn();
Expand Down
4 changes: 4 additions & 0 deletions Source/Source/V4L2Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,11 @@ void V4L2Viewer::OnSaveImageClicked()
m_LastImageSaveFormat = ".raw";
QPixmap pixmap = m_PixmapItem->pixmap();
QImage image = pixmap.toImage();
#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
int size = image.sizeInBytes();
#else
int size = image.byteCount();
#endif
QByteArray data(reinterpret_cast<const char*>(image.bits()), size);
QFile file(fullPath);
file.open(QIODevice::WriteOnly);
Expand Down

0 comments on commit 3182b80

Please sign in to comment.