summaryrefslogtreecommitdiffstats
path: root/examples/opengl/qopenglwidget/glwidget.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-06-01 11:44:37 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-06-01 13:38:14 +0000
commit78e335408303380310dd59fab421e495cf517ead (patch)
tree2c76bdaccd566792a23e766569043fc2800b2c2c /examples/opengl/qopenglwidget/glwidget.cpp
parent069be1654359ab93f89d339775795508d106153a (diff)
Clip QOpenGLWidget and QQuickWidget correctly
Introduce support for the widgets' clipRect(). Right now render-to-texture widgets in scroll areas placed close to each other result in broken (non-existent) clipping. Similarly, stack-on-top widgets fail to clip when placed inside a scroll area. This is now corrected and the qopenglwidget example is enhanced to utilize a scroll area. Task-number: QTBUG-45860 Change-Id: I859a63d61a50d64ba9e87244f83c5969dce12337 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'examples/opengl/qopenglwidget/glwidget.cpp')
-rw-r--r--examples/opengl/qopenglwidget/glwidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp
index f93e667615..df52e3efbf 100644
--- a/examples/opengl/qopenglwidget/glwidget.cpp
+++ b/examples/opengl/qopenglwidget/glwidget.cpp
@@ -537,14 +537,14 @@ void GLWidget::setTransparent(bool transparent)
window()->update();
}
-void GLWidget::resizeGL(int w, int h)
+void GLWidget::resizeGL(int, int)
{
if (m_hasButton) {
if (!m_btn) {
- m_btn = new QPushButton("A widget on top.\nPress me!", this);
+ m_btn = new QPushButton("A widget on top.\nPress for more widgets.", this);
connect(m_btn, &QPushButton::clicked, this, &GLWidget::handleButtonPress);
}
- m_btn->move(w / 2, h / 2);
+ m_btn->move(20, 80);
}
}