Skip to content

Commit d97fbc5

Browse files
committed
Merge pull request #430 from kylelutz/fix-qt5-error
Only call QWidget::windowHandle() for Qt >= 5.0
2 parents 0843b61 + 9a930e6 commit d97fbc5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

example/mandelbrot.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ void MandelbrotWidget::initializeGL()
127127

128128
void MandelbrotWidget::resizeGL(int width, int height)
129129
{
130+
#if QT_VERSION >= 0x050000
130131
// scale height/width based on device pixel ratio
131132
width /= windowHandle()->devicePixelRatio();
132133
height /= windowHandle()->devicePixelRatio();
134+
#endif
133135

134136
// resize viewport
135137
glViewport(0, 0, width, height);

example/resize_image.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ void ImageWidget::initializeGL()
127127

128128
void ImageWidget::resizeGL(int width, int height)
129129
{
130+
#if QT_VERSION >= 0x050000
130131
// scale height/width based on device pixel ratio
131132
width /= windowHandle()->devicePixelRatio();
132133
height /= windowHandle()->devicePixelRatio();
134+
#endif
133135

134136
// resize viewport
135137
glViewport(0, 0, width, height);

0 commit comments

Comments
 (0)