From a426326e99a76a92c8d0c870e19c67311a434483 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 3 Feb 2020 15:49:30 +0100 Subject: Doc: Make snippets Qt Widgets compilable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed mainwindowsnippet.cpp and widgetdelegate.cpp from snippets.pro Task-number: QTBUG-81497 Change-Id: I40d1f34e64d958d2fb857dc8e468b9c40fff527c Reviewed-by: Paul Wicking Reviewed-by: Kai Koehne Reviewed-by: Topi Reiniƶ --- src/widgets/doc/snippets/myscrollarea.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/widgets/doc/snippets/myscrollarea.cpp') diff --git a/src/widgets/doc/snippets/myscrollarea.cpp b/src/widgets/doc/snippets/myscrollarea.cpp index dbf8da1603c..8afe4a68346 100644 --- a/src/widgets/doc/snippets/myscrollarea.cpp +++ b/src/widgets/doc/snippets/myscrollarea.cpp @@ -48,7 +48,7 @@ ** ****************************************************************************/ -#include +#include class MyScrollArea : public QAbstractScrollArea { @@ -97,8 +97,10 @@ void MyScrollArea::updateWidgetPosition() //! [0] } -void MyScrollArea::scrollContentsBy(int /*dx*/, int /*dy*/) +void MyScrollArea::scrollContentsBy(int dx, int dy) { + Q_UNUSED(dx); + Q_UNUSED(dy); updateWidgetPosition(); } @@ -118,21 +120,6 @@ void MyScrollArea::updateArea() void MyScrollArea::resizeEvent(QResizeEvent *event) { + Q_UNUSED(event); updateArea(); } - -int main(int argv, char **args) -{ - QApplication app(argv, args); - - QPixmap pixmap("mypixmap.png"); - QLabel label; - label.setPixmap(pixmap); - MyScrollArea area(&label); - area.resize(300, 300); - area.show(); - - area.setWidget(&label); - - return app.exec(); -} -- cgit v1.2.3