From f775f6dd887e1744816d1320fd50092df93f0371 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sun, 2 Dec 2012 22:53:25 +0100 Subject: Fix compile with -DQT_NO_WHEELEVENT Change-Id: Icc345e2a361fc233d7debfa88bef2a3a8375fa8f Reviewed-by: David Faure --- examples/widgets/painting/affine/xform.cpp | 2 ++ examples/widgets/painting/affine/xform.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp index a873ba7af8..d4485df0b3 100644 --- a/examples/widgets/painting/affine/xform.cpp +++ b/examples/widgets/painting/affine/xform.cpp @@ -251,12 +251,14 @@ void XFormView::timerEvent(QTimerEvent *e) } } +#ifndef QT_NO_WHEELEVENT void XFormView::wheelEvent(QWheelEvent *e) { m_scale += e->delta() / qreal(600); m_scale = qMax(qreal(0.1), qMin(qreal(4), m_scale)); emit scaleChanged(int(m_scale*1000)); } +#endif void XFormView::reset() { diff --git a/examples/widgets/painting/affine/xform.h b/examples/widgets/painting/affine/xform.h index fff92733a0..a04381165d 100644 --- a/examples/widgets/painting/affine/xform.h +++ b/examples/widgets/painting/affine/xform.h @@ -116,7 +116,9 @@ signals: protected: void timerEvent(QTimerEvent *e); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *); +#endif private: QPolygonF ctrlPoints; -- cgit v1.2.3 From 6c88c7db638618402db06fb0e57c60a3ed8e1064 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2012 21:12:53 +0100 Subject: remove QT+=widgets from SUBDIRS projects it makes no sense whatsoever Change-Id: Ica7c764575079a12512ee2eb62a995ebbefa09a0 Reviewed-by: Joerg Bornemann --- examples/widgets/painting/painting.pro | 2 -- 1 file changed, 2 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/painting.pro b/examples/widgets/painting/painting.pro index 145fcdd383..7459dd3e94 100644 --- a/examples/widgets/painting/painting.pro +++ b/examples/widgets/painting/painting.pro @@ -12,8 +12,6 @@ SUBDIRS = basicdrawing \ transformations \ fontsampler -QT += widgets - examples_affine.subdir = affine examples_composition.subdir = composition examples_deform.subdir = deform -- cgit v1.2.3 From 2ac3f92296d16432f2ed3af916271d6848547f36 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2012 21:13:33 +0100 Subject: clean up example project files, mostly wrt QT+=widgets move QT+=widgets (and printsupport) statements before the install statements, and de-duplicate some cases. also move some TARGET assignments to a more conventional place. Change-Id: I6140d8611680f66c24490e5894e4eb90cae95635 Reviewed-by: Joerg Bornemann --- examples/widgets/painting/basicdrawing/basicdrawing.pro | 4 ++-- examples/widgets/painting/concentriccircles/concentriccircles.pro | 5 ++--- examples/widgets/painting/fontsampler/fontsampler.pro | 6 +++--- examples/widgets/painting/imagecomposition/imagecomposition.pro | 5 ++--- examples/widgets/painting/painterpaths/painterpaths.pro | 5 ++--- examples/widgets/painting/shared/shared.pro | 4 ++-- examples/widgets/painting/transformations/transformations.pro | 4 ++-- 7 files changed, 15 insertions(+), 18 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/basicdrawing/basicdrawing.pro b/examples/widgets/painting/basicdrawing/basicdrawing.pro index 52ee0d4402..a7b3cff9cd 100644 --- a/examples/widgets/painting/basicdrawing/basicdrawing.pro +++ b/examples/widgets/painting/basicdrawing/basicdrawing.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = renderarea.h \ window.h SOURCES = main.cpp \ @@ -8,5 +10,3 @@ RESOURCES = basicdrawing.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/basicdrawing INSTALLS += target - -QT += widgets diff --git a/examples/widgets/painting/concentriccircles/concentriccircles.pro b/examples/widgets/painting/concentriccircles/concentriccircles.pro index 9690465d46..844c01a9c2 100644 --- a/examples/widgets/painting/concentriccircles/concentriccircles.pro +++ b/examples/widgets/painting/concentriccircles/concentriccircles.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = circlewidget.h \ window.h SOURCES = circlewidget.cpp \ @@ -7,6 +9,3 @@ SOURCES = circlewidget.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/concentriccircles INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/painting/fontsampler/fontsampler.pro b/examples/widgets/painting/fontsampler/fontsampler.pro index c32fc40572..8325da0175 100644 --- a/examples/widgets/painting/fontsampler/fontsampler.pro +++ b/examples/widgets/painting/fontsampler/fontsampler.pro @@ -1,3 +1,6 @@ +QT += widgets +!isEmpty(QT.printsupport.name): QT += printsupport + FORMS = mainwindowbase.ui HEADERS = mainwindow.h SOURCES = main.cpp \ @@ -6,6 +9,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/fontsampler INSTALLS += target - -QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport diff --git a/examples/widgets/painting/imagecomposition/imagecomposition.pro b/examples/widgets/painting/imagecomposition/imagecomposition.pro index ce23c601f5..42c70471c1 100644 --- a/examples/widgets/painting/imagecomposition/imagecomposition.pro +++ b/examples/widgets/painting/imagecomposition/imagecomposition.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = imagecomposer.h SOURCES = imagecomposer.cpp \ main.cpp @@ -6,6 +8,3 @@ RESOURCES = imagecomposition.qrc # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/imagecomposition INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/painting/painterpaths/painterpaths.pro b/examples/widgets/painting/painterpaths/painterpaths.pro index 560e84a267..2d2db30739 100644 --- a/examples/widgets/painting/painterpaths/painterpaths.pro +++ b/examples/widgets/painting/painterpaths/painterpaths.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = renderarea.h \ window.h SOURCES = main.cpp \ @@ -8,6 +10,3 @@ unix:!mac:!vxworks:!integrity:LIBS += -lm # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/painterpaths INSTALLS += target - -QT += widgets - diff --git a/examples/widgets/painting/shared/shared.pro b/examples/widgets/painting/shared/shared.pro index 2a71c7d487..42b474a946 100644 --- a/examples/widgets/painting/shared/shared.pro +++ b/examples/widgets/painting/shared/shared.pro @@ -3,15 +3,15 @@ CONFIG += static contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { DEFINES += QT_OPENGL_SUPPORT - QT += opengl widgets + QT += opengl } +QT += widgets build_all:!build_pass { CONFIG -= build_all CONFIG += release } TARGET = demo_shared -QT += widgets SOURCES += \ arthurstyle.cpp\ diff --git a/examples/widgets/painting/transformations/transformations.pro b/examples/widgets/painting/transformations/transformations.pro index 72f42046db..3f5398a228 100644 --- a/examples/widgets/painting/transformations/transformations.pro +++ b/examples/widgets/painting/transformations/transformations.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = renderarea.h \ window.h SOURCES = main.cpp \ @@ -7,5 +9,3 @@ SOURCES = main.cpp \ # install target.path = $$[QT_INSTALL_EXAMPLES]/widgets/painting/transformations INSTALLS += target - -QT += widgets -- cgit v1.2.3 From 5a2fc03ef40d9b2a8384abffe3f1cb9d943b9acc Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 14 Dec 2012 14:55:20 +0100 Subject: Fix building of the painting examples that use shared code Task-number: QTCREATORBUG-8437 Change-Id: I66031184a009f3b26ad4af36b1975204e8fa80dc Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 2dc6ad8adf7f98d55aca5def8ee3f9c12934fb7b) --- examples/widgets/painting/shared/shared.pri | 31 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri index 2d6b3c78f9..6aef1bdd5b 100644 --- a/examples/widgets/painting/shared/shared.pri +++ b/examples/widgets/painting/shared/shared.pri @@ -1,20 +1,19 @@ -INCLUDEPATH += $$SHARED_FOLDER +INCLUDEPATH += $$PWD -build_all:!build_pass { - CONFIG -= build_all - CONFIG += release -} -contains(CONFIG, debug_and_release_target) { - CONFIG(debug, debug|release) { - QMAKE_LIBDIR += $$SHARED_FOLDER/debug - } else { - QMAKE_LIBDIR += $$SHARED_FOLDER/release - } -} else { - QMAKE_LIBDIR += $$SHARED_FOLDER +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { + DEFINES += QT_OPENGL_SUPPORT + QT += opengl widgets } -hpux-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a -hpuxi-acc*:LIBS += $$SHARED_FOLDER/libdemo_shared.a -!hpuxi-acc*:!hpux-acc*:LIBS += -ldemo_shared +SOURCES += \ + $$PWD/arthurstyle.cpp\ + $$PWD/arthurwidgets.cpp \ + $$PWD/hoverpoints.cpp + +HEADERS += \ + $$PWD/arthurstyle.h \ + $$PWD/arthurwidgets.h \ + $$PWD/hoverpoints.h + +RESOURCES += $$PWD/shared.qrc -- cgit v1.2.3 From 586adeabe4d58a7c8a71bbb1be79c3533ab858ff Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 21 Dec 2012 12:09:56 +0100 Subject: add and use qtHaveModule() function this is much more elegant than the so far propagated !isEmpty(QT.foo.name). also replace feature-specific tests (no-gui and no-widgets) and the obsolete contains(QT_CONFIG, foo) syntax. Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b Reviewed-by: Sergio Ahumada Reviewed-by: Tasuku Suzuki Reviewed-by: Oswald Buddenhagen --- examples/widgets/painting/affine/affine.pro | 2 +- examples/widgets/painting/composition/composition.pro | 2 +- examples/widgets/painting/deform/deform.pro | 2 +- examples/widgets/painting/fontsampler/fontsampler.pro | 2 +- examples/widgets/painting/gradients/gradients.pro | 2 +- examples/widgets/painting/pathstroke/pathstroke.pro | 2 +- examples/widgets/painting/shared/shared.pri | 2 +- examples/widgets/painting/shared/shared.pro | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/affine/affine.pro b/examples/widgets/painting/affine/affine.pro index e94f4d12fb..1f2f8df87f 100644 --- a/examples/widgets/painting/affine/affine.pro +++ b/examples/widgets/painting/affine/affine.pro @@ -1,7 +1,7 @@ SOURCES += main.cpp xform.cpp HEADERS += xform.h -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/composition/composition.pro b/examples/widgets/painting/composition/composition.pro index 7ff82d789a..0269945ac8 100644 --- a/examples/widgets/painting/composition/composition.pro +++ b/examples/widgets/painting/composition/composition.pro @@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared include($$SHARED_FOLDER/shared.pri) RESOURCES += composition.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/deform/deform.pro b/examples/widgets/painting/deform/deform.pro index 01dc0a869c..6409aaed96 100644 --- a/examples/widgets/painting/deform/deform.pro +++ b/examples/widgets/painting/deform/deform.pro @@ -7,7 +7,7 @@ include($$SHARED_FOLDER/shared.pri) RESOURCES += deform.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/fontsampler/fontsampler.pro b/examples/widgets/painting/fontsampler/fontsampler.pro index 8325da0175..08dd07bc08 100644 --- a/examples/widgets/painting/fontsampler/fontsampler.pro +++ b/examples/widgets/painting/fontsampler/fontsampler.pro @@ -1,5 +1,5 @@ QT += widgets -!isEmpty(QT.printsupport.name): QT += printsupport +qtHaveModule(printsupport): QT += printsupport FORMS = mainwindowbase.ui HEADERS = mainwindow.h diff --git a/examples/widgets/painting/gradients/gradients.pro b/examples/widgets/painting/gradients/gradients.pro index a7d6ae68d1..73f3974c62 100644 --- a/examples/widgets/painting/gradients/gradients.pro +++ b/examples/widgets/painting/gradients/gradients.pro @@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared include($$SHARED_FOLDER/shared.pri) RESOURCES += gradients.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/pathstroke/pathstroke.pro b/examples/widgets/painting/pathstroke/pathstroke.pro index 197fe22024..8ab3cb9244 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.pro +++ b/examples/widgets/painting/pathstroke/pathstroke.pro @@ -7,7 +7,7 @@ include($$SHARED_FOLDER/shared.pri) RESOURCES += pathstroke.qrc -contains(QT_CONFIG, opengl) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri index 6aef1bdd5b..1b8be82d03 100644 --- a/examples/widgets/painting/shared/shared.pri +++ b/examples/widgets/painting/shared/shared.pri @@ -1,6 +1,6 @@ INCLUDEPATH += $$PWD -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl widgets } diff --git a/examples/widgets/painting/shared/shared.pro b/examples/widgets/painting/shared/shared.pro index 42b474a946..2756bf75ca 100644 --- a/examples/widgets/painting/shared/shared.pro +++ b/examples/widgets/painting/shared/shared.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += static -contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { +qtHaveModule(opengl) { DEFINES += QT_OPENGL_SUPPORT QT += opengl } -- cgit v1.2.3