Qt 6 works on Windows host
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
if (((DEFINED QGLVIEW) AND QGLVIEW) OR (NOT DEFINED QGLVIEW))
|
||||
find_package(OpenGL REQUIRED)
|
||||
shstk_qad_project(qglview FALSE "qad" "Gui;OpenGL;Xml" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
|
||||
shstk_qad_project(qglview FALSE "qad" "Gui;OpenGL;OpenGLWidgets;Xml" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
|
||||
shstk_qad_install("qad" FALSE qglview "${out_HDR}" "${out_QM}")
|
||||
|
||||
qad_sources(test_SRC DIR "qglview_test")
|
||||
|
||||
@@ -135,7 +135,7 @@ void GLParticlesSystem::draw(QOpenGLShaderProgram * prog, bool) {
|
||||
for (int i = 0; i < particles.size(); ++i)
|
||||
//particles[i].pos_h.setZ((particles[i].pos - apos).lengthSquared());
|
||||
particles[i].pos_h.setZ(particles[i].pos.distanceToPlane(apos, dir));
|
||||
qSort(particles.begin(), particles.end());
|
||||
std::sort(particles.begin(), particles.end());
|
||||
glBegin(GL_POINTS);
|
||||
foreach (const Particle & i, particles) {
|
||||
//glVertex3f(i.pos.x(), i.pos.y(), i.pos.z());
|
||||
|
||||
@@ -223,15 +223,12 @@ GLObjectBase * loadFromDAEFile(const QString & filepath, float scale) {
|
||||
qDebug() << "[Loader DAE] Error: can`t open \"" + filepath + "\"";
|
||||
return nullptr;
|
||||
}
|
||||
QTime tm;
|
||||
tm.restart();
|
||||
QDomDocument dom(filepath);
|
||||
if (!dom.setContent(&f)) {
|
||||
qDebug() << "[Loader DAE] Error: can`t parse \"" + filepath + "\"";
|
||||
return nullptr;
|
||||
}
|
||||
//qDebug() << "parse" << tm.elapsed();
|
||||
tm.restart();
|
||||
QDomElement maine = dom.firstChildElement("COLLADA");
|
||||
bool fbx = maine.firstChildElement("asset").firstChildElement("contributor").firstChildElement("authoring_tool").firstChild().nodeValue().startsWith("FBX");
|
||||
QVector<Material> materials = LoaderDAE::readMaterials(maine.firstChildElement("library_effects"),
|
||||
|
||||
@@ -43,7 +43,10 @@ private slots:
|
||||
|
||||
typedef QPair<QMetaProperty, QVariant> PropertyValuePair;
|
||||
Q_DECLARE_METATYPE (PropertyValuePair)
|
||||
Q_DECLARE_METATYPE (QMetaProperty)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
Q_DECLARE_METATYPE (QMetaProperty)
|
||||
#endif
|
||||
|
||||
|
||||
class PropertyEditor: public QTreeWidget {
|
||||
Q_OBJECT
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "glprimitives.h"
|
||||
#include "glparticles_system.h"
|
||||
#include "glrendererbase.h"
|
||||
#include <QElapsedTimer>
|
||||
#include <QTime>
|
||||
|
||||
|
||||
@@ -225,7 +226,7 @@ private:
|
||||
QSet<int> keys_;
|
||||
FogMode fogMode_;
|
||||
QColor backColor_, fogColor_, ambientColor_, hoverHaloColor_, selectionHaloColor_;
|
||||
QTime time, ktm_;
|
||||
QElapsedTimer time, ktm_;
|
||||
GLint max_anisotropic, max_texture_chanels;
|
||||
GLObjectBase::RenderMode rmode;
|
||||
GLObjectBase * sel_obj, * hov_obj;
|
||||
|
||||
Reference in New Issue
Block a user