From 8eb4b281d9449ebf6d03e5460173719e68cce7d9 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Thu, 11 Dec 2014 14:17:20 +0100 Subject: Change bugreports.qt-project.org -> bugreports.qt.io The Qt bug tracker URL changes as part of the qt.io transition Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459 Reviewed-by: Kai Koehne --- tests/auto/widgets/util/qscroller/tst_qscroller.cpp | 6 +++--- tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp index 5c299bab42..03b748c0dd 100644 --- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp +++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp @@ -356,7 +356,7 @@ void tst_QScroller::scrollerProperties() void tst_QScroller::scrollTo() { #ifdef Q_OS_MAC - QSKIP("Flakey test - https://bugreports.qt-project.org/browse/QTBUG-29950"); + QSKIP("Flakey test - QTBUG-29950"); #endif { tst_QScrollerWidget *sw = new tst_QScrollerWidget(); @@ -385,7 +385,7 @@ void tst_QScroller::scrollTo() void tst_QScroller::scroll() { #ifdef Q_OS_MAC - QSKIP("Flakey test - https://bugreports.qt-project.org/browse/QTBUG-30133"); + QSKIP("Flakey test - QTBUG-30133"); #endif #ifndef QT_NO_GESTURES // -- good case. normal scroll @@ -430,7 +430,7 @@ void tst_QScroller::scroll() void tst_QScroller::overshoot() { #ifdef Q_OS_MAC - QSKIP("Flakey test - https://bugreports.qt-project.org/browse/QTBUG-29950"); + QSKIP("Flakey test - QTBUG-29950"); #endif #ifndef QT_NO_GESTURES tst_QScrollerWidget *sw = new tst_QScrollerWidget(); diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index 78f30f4e42..cb0383c398 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -151,7 +151,7 @@ void tst_QScrollBar::task_209492() #define WHEEL_DELTA 120 // copied from tst_QAbstractSlider / tst_QComboBox void tst_QScrollBar::QTBUG_27308() { - // https://bugreports.qt-project.org/browse/QTBUG-27308 + // QTBUG-27308 // Check that a disabled scrollbar doesn't react on wheel events anymore QScrollBar testWidget(Qt::Horizontal); -- cgit v1.2.3 From 6c2da36c22e25e626a9812419332ad379e854133 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 12 Dec 2014 12:59:43 +0100 Subject: Prevent continuous painting with viewport QOpenGLWidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the source widget to the texture list (may be null for custom compositor implementations that add textures not belonging to actual widgets). This allows us to do proper checks with the dirtyRenderToTextureWidgets list. As a result paint events are only sent to a QOpenGLWidget if (1) there was an update() for it or (2) it was actually marked dirty. (2) was previously behaving differently: the widget got a paint event when anything in the window has changed. This is fine for naive animating OpenGL code but less ideal for QGraphicsView. Bool properties like stacksOnTop are now stored in a flags value to prevent future explosion of texture list fields and parameters. Task-number: QTBUG-43178 Change-Id: I48cbcf93df72ac682c9b5d64982a8b648fe21ef3 Reviewed-by: Jørgen Lind Reviewed-by: Paul Olav Tvete --- .../widgets/qopenglwidget/tst_qopenglwidget.cpp | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index d309b0840e..2ac31bfe1b 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -34,6 +34,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include @@ -49,6 +54,7 @@ private slots: void painter(); void reparentToAlreadyCreated(); void reparentToNotYetCreated(); + void asViewport(); }; void tst_QOpenGLWidget::create() @@ -253,6 +259,52 @@ void tst_QOpenGLWidget::reparentToNotYetCreated() QVERIFY(image.pixel(20, 10) == qRgb(0, 0, 255)); } +class CountingGraphicsView : public QGraphicsView +{ +public: + CountingGraphicsView(): m_count(0) { } + int paintCount() const { return m_count; } + void resetPaintCount() { m_count = 0; } + +protected: + void drawForeground(QPainter *, const QRectF &) Q_DECL_OVERRIDE; + int m_count; +}; + +void CountingGraphicsView::drawForeground(QPainter *, const QRectF &) +{ + ++m_count; +} + +void tst_QOpenGLWidget::asViewport() +{ + // Have a QGraphicsView with a QOpenGLWidget as its viewport. + QGraphicsScene scene; + scene.addItem(new QGraphicsRectItem(10, 10, 100, 100)); + CountingGraphicsView *view = new CountingGraphicsView; + view->setScene(&scene); + view->setViewport(new QOpenGLWidget); + QWidget widget; + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(view); + QPushButton *btn = new QPushButton("Test"); + layout->addWidget(btn); + widget.setLayout(layout); + widget.show(); + QTest::qWaitForWindowExposed(&widget); + + QVERIFY(view->paintCount() > 0); + view->resetPaintCount(); + + // And now trigger a repaint on the push button. We must not + // receive paint events for the graphics view. If we do, that's a + // side effect of QOpenGLWidget's special behavior and handling in + // the widget stack. + btn->update(); + qApp->processEvents(); + QVERIFY(view->paintCount() == 0); +} + QTEST_MAIN(tst_QOpenGLWidget) #include "tst_qopenglwidget.moc" -- cgit v1.2.3