diff --git a/piqt_utils/piconnedit/piconnedit_main.cpp b/piqt_utils/piconnedit/piconnedit_main.cpp index 7a77c5e..c14edea 100644 --- a/piqt_utils/piconnedit/piconnedit_main.cpp +++ b/piqt_utils/piconnedit/piconnedit_main.cpp @@ -6,6 +6,9 @@ int main(int argc, char * argv[]) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif ConnectionEdit w; if (a.arguments().size() > 1) { QPIConfig cfg(a.arguments()[1]); diff --git a/piqt_utils/pidumper/pidumper_main.cpp b/piqt_utils/pidumper/pidumper_main.cpp index f7ad863..5f2a368 100644 --- a/piqt_utils/pidumper/pidumper_main.cpp +++ b/piqt_utils/pidumper/pidumper_main.cpp @@ -4,6 +4,9 @@ int main(int argc, char * argv[]) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif PIDumper w; w.show(); return a.exec(); diff --git a/piqt_utils/piintrospector/piintrospector_main.cpp b/piqt_utils/piintrospector/piintrospector_main.cpp index b94783d..3d25393 100644 --- a/piqt_utils/piintrospector/piintrospector_main.cpp +++ b/piqt_utils/piintrospector/piintrospector_main.cpp @@ -4,6 +4,9 @@ int main(int argc, char * argv[]) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif QPIIntrospector w; w.show(); return a.exec(); diff --git a/qad/blockview/blockeditor/blockeditor_main.cpp b/qad/blockview/blockeditor/blockeditor_main.cpp index 645ec0b..0a6a3a7 100644 --- a/qad/blockview/blockeditor/blockeditor_main.cpp +++ b/qad/blockview/blockeditor/blockeditor_main.cpp @@ -4,6 +4,9 @@ int main(int argc, char * argv[]) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif a.setWindowIcon(QIcon(":/icons/blockview.png")); BlockEditor w; if (a.arguments().size() > 1) diff --git a/qad/graphic/qpicalculator/main.cpp b/qad/graphic/qpicalculator/main.cpp index 2e6cafd..afb41cf 100644 --- a/qad/graphic/qpicalculator/main.cpp +++ b/qad/graphic/qpicalculator/main.cpp @@ -4,6 +4,9 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif MainWindow w; w.show(); return a.exec(); diff --git a/qcd_utils/pult/main.cpp b/qcd_utils/pult/main.cpp index 1ebd6bf..ea3d182 100644 --- a/qcd_utils/pult/main.cpp +++ b/qcd_utils/pult/main.cpp @@ -4,6 +4,9 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif CDPultWindow w; w.show(); if (a.arguments().size() > 1) diff --git a/qglview/gltypes.cpp b/qglview/gltypes.cpp index 4d7f37f..5d5bc1b 100644 --- a/qglview/gltypes.cpp +++ b/qglview/gltypes.cpp @@ -143,7 +143,7 @@ void createGLTexture(GLuint & tex, const QImage & image, const GLenum & format, glGenTextures(1, &tex); glBindTexture(target, tex); } - QImage im = image;///__GLWidget__::convertToGLFormat(image); + QImage im = image.mirrored(false, true);///__GLWidget__::convertToGLFormat(image); //const QImage & cim(im); //glClearError(); //glPixelStorei(GL_UNPACK_ALIGNMENT, 1); diff --git a/qglview/qglview.cpp b/qglview/qglview.cpp index 9b231d9..cb65199 100644 --- a/qglview/qglview.cpp +++ b/qglview/qglview.cpp @@ -499,7 +499,10 @@ void QGLView::collectGraphicItems(QList & list, QGraphicsItem void QGLView::collectObjectLights(GLObjectBase * o) { - if (o->type_ == GLObjectBase::glLight) lights_ << globject_cast(o); + if (o->type_ == GLObjectBase::glLight) { + lights_ << globject_cast(o); + o->view_ = this; + } foreach (GLObjectBase * i, o->children()) collectObjectLights(i); } diff --git a/qglview/qglview_test/main.cpp b/qglview/qglview_test/main.cpp index b38298a..46f4a6b 100644 --- a/qglview/qglview_test/main.cpp +++ b/qglview/qglview_test/main.cpp @@ -23,6 +23,9 @@ int main(int argc, char ** argv) { QApplication a(argc, argv); +#if QT_VERSION >= 0x050000 + a.setAttribute(Qt::AA_UseHighDpiPixmaps, true); +#endif QGLViewWindow w; w.show(); QStringList al(a.arguments()); diff --git a/qglview/qglview_test/qglview_window.cpp b/qglview/qglview_test/qglview_window.cpp index f9c61a5..aa5b029 100644 --- a/qglview/qglview_test/qglview_window.cpp +++ b/qglview/qglview_test/qglview_window.cpp @@ -29,6 +29,8 @@ QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLViewWindow() { setupUi(this); + session.setFile("session_qglview_test.conf"); + session.addEntry(this); icon_geo = QIcon(":/icons/type-geo.png"); icon_camera = QIcon(":/icons/type-camera.png"); icon_light = QIcon(":/icons/type-light.png"); @@ -113,10 +115,12 @@ QGLViewWindow::QGLViewWindow(QWidget * parent): QMainWindow(parent), Ui::QGLView //view->addObject(&partsys); partsys.material().color_diffuse = Qt::red; treeProps->assignObject(&partsys); + session.load(); } QGLViewWindow::~QGLViewWindow() { + session.save(); //delete ps; } @@ -132,7 +136,8 @@ void QGLViewWindow::changeEvent(QEvent * e) { void QGLViewWindow::timerEvent(QTimerEvent * ) { //static double t = 0.; - cam_light->intensity = checkCameraLight->isChecked() ? 0.5 : 0.; + //cam_light->intensity = checkCameraLight->isChecked() ? 0.5 : 0.; + cam_light->setVisible(checkCameraLight->isChecked()); //((RendererSimple*)(view->renderer()))->mpos = view->mapFromGlobal(QCursor::pos()); statusBar()->showMessage(QString("FPS: %1").arg(QString::number(view->currentFPS(), 'f', 2))); } @@ -215,7 +220,7 @@ void QGLViewWindow::selectionChanged(GLObjectBase * cur, GLObjectBase * prev) { objectEditor->setObject(sel_obj); if (sel_obj == 0) return; matEditor->setMaterial(sel_obj->material()); - qDebug() << sel_obj->boundingBox(); + //qDebug() << sel_obj->boundingBox(); } @@ -315,6 +320,7 @@ void QGLViewWindow::on_view_keyEvent(Qt::Key k, Qt::KeyboardModifiers m) { void QGLViewWindow::on_treeObjects_itemClicked(QTreeWidgetItem * ti, int col) { ((GLObjectBase*)(ti->data(0, Qt::UserRole).toULongLong()))->select(); + //qDebug() << ((GLObjectBase*)(ti->data(0, Qt::UserRole).toULongLong()))->type(); if (sel_obj->type() == GLObjectBase::glCamera) view->setCamera(*(Camera*)sel_obj); } diff --git a/qglview/qglview_test/qglview_window.h b/qglview/qglview_test/qglview_window.h index d8384fe..49ceb2f 100644 --- a/qglview/qglview_test/qglview_window.h +++ b/qglview/qglview_test/qglview_window.h @@ -35,6 +35,7 @@ #include "loader_ase.h" #include "renderer_simple.h" #include "renderer_deferred_shading.h" +#include "session_manager.h" //#include "renderer_rt.h" #include "glparticles_system.h" @@ -63,6 +64,7 @@ private: Light * cam_light; GLPrimitiveCube * box; Material m; + SessionManager session; bool isChanged; GLParticlesSystem partsys;