Qt 6 works on Windows host

This commit is contained in:
2022-01-23 12:59:57 +03:00
parent fcdc142991
commit bdb2acb414
14 changed files with 139 additions and 34 deletions

View File

@@ -17,6 +17,7 @@
*/
#include "qglview.h"
#include <qad_types.h>
#include <QApplication>
#include <QKeyEvent>
@@ -747,8 +748,14 @@ void QGLView::mouseMoveEvent(QMouseEvent * e) {
void QGLView::wheelEvent(QWheelEvent * e) {
if (mouseRotate_) {
if (e->delta() > 0) camera()->flyCloser(0.1f); //camera().pos.setZ(camera().pos.z() - 0.1 * camera().pos.z());
if (e->delta() < 0) camera()->flyFarer(0.1f); //camera().pos.setZ(camera().pos.z() + 0.1 * camera().pos.z());
double ang =
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
e->delta();
#else
e->angleDelta().y();
#endif
if (ang > 0) camera()->flyCloser(0.1f); //camera().pos.setZ(camera().pos.z() - 0.1 * camera().pos.z());
if (ang < 0) camera()->flyFarer(0.1f); //camera().pos.setZ(camera().pos.z() + 0.1 * camera().pos.z());
emit cameraPosChanged(camera()->pos());
}
emit glWheelEvent(e);
@@ -782,7 +789,7 @@ void QGLView::focusOutEvent(QFocusEvent *) {
void QGLView::mouseDoubleClickEvent(QMouseEvent * e) {
if (e->buttons().testFlag(Qt::MidButton))
if (e->buttons().testFlag(QT_MID_BUTTON))
emit doubleClick();
}