Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Merge branch 'shaders' of https://github.com/turtletooth/opentoonz into turtletooth-shaders

shun_iwasawac44e4b48634c
diff --cc toonz/sources/include/toonzqt/glwidget_for_highdpi.h
index e671798ed,4baa80a88..ce53df9c5
--- a/toonz/sources/include/toonzqt/glwidget_for_highdpi.h
+++ b/toonz/sources/include/toonzqt/glwidget_for_highdpi.h
@@@ -3,23 -3,29 +3,23 @@@
#ifndef GLWIDGET_FOR_HIGHDPI_H
#define GLWIDGET_FOR_HIGHDPI_H
- #include <QGLWidget>
+ #include <QOpenGLWidget>
#include <QApplication>
#include <QDesktopWidget>
+#include "toonzqt/gutil.h"
// use obsolete QGLWidget instead of QOpenGLWidget for now...
// TODO: replace with the "modern" OpenGL source and transfer to QOpenGLWidget
- class GLWidgetForHighDpi : public QGLWidget {
+ class GLWidgetForHighDpi : public QOpenGLWidget {
public:
GLWidgetForHighDpi(QWidget *parent = Q_NULLPTR,
- const QGLWidget *shareWidget = Q_NULLPTR,
+ const QOpenGLWidget *shareWidget = Q_NULLPTR,
Qt::WindowFlags f = Qt::WindowFlags())
- : QGLWidget(parent, shareWidget, f) {}
+ : QOpenGLWidget(parent, f) {}
- // returns device-pixel ratio. It is 1 for normal monitors and 2 (or higher
- // ratio) for high DPI monitors. Setting "Display > Set custom text size(DPI)"
- // for Windows corresponds to this ratio.
- int getDevPixRatio() const {
- static int devPixRatio = QApplication::desktop()->devicePixelRatio();
- return devPixRatio;
- }
// modify sizes for high DPI monitors
- int width() const { return QGLWidget::width() * getDevPixRatio(); }
- int height() const { return QGLWidget::height() * getDevPixRatio(); }
+ int width() const { return QOpenGLWidget::width() * getDevPixRatio(); }
+ int height() const { return QOpenGLWidget::height() * getDevPixRatio(); }
QRect rect() const { return QRect(0, 0, width(), height()); }
};