diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-09-03 14:36:15 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-09-03 14:36:15 (GMT) |
commit | f0844f9da7a834c282f6f04b2676f28de444e9dc (patch) | |
tree | 8e121429e25959043cc04c4364adbe8239e44a67 /demos | |
parent | fe763ef6cd255ccb54d0de1894c1a772f959585e (diff) | |
parent | f360180890298618ef3284c08789c2a243e1ba9d (diff) | |
download | Qt-f0844f9da7a834c282f6f04b2676f28de444e9dc.zip Qt-f0844f9da7a834c282f6f04b2676f28de444e9dc.tar.gz Qt-f0844f9da7a834c282f6f04b2676f28de444e9dc.tar.bz2 |
Merge commit 'qt/4.6' into kinetic-declarativeui
Diffstat (limited to 'demos')
-rw-r--r-- | demos/boxes/qtbox.cpp | 4 | ||||
-rw-r--r-- | demos/boxes/scene.cpp | 3 | ||||
-rw-r--r-- | demos/boxes/scene.h | 2 | ||||
-rw-r--r-- | demos/composition/composition.cpp | 14 | ||||
-rw-r--r-- | demos/embedded/digiflip/digiflip.pro | 6 | ||||
-rw-r--r-- | demos/embedded/embedded.pro | 10 | ||||
-rw-r--r-- | demos/embedded/flickable/flickable.pro | 5 | ||||
-rw-r--r-- | demos/embedded/flightinfo/flightinfo.pro | 2 | ||||
-rw-r--r-- | demos/embedded/fluidlauncher/fluidlauncher.pro | 93 | ||||
-rw-r--r-- | demos/embedded/lightmaps/lightmaps.pro | 2 | ||||
-rw-r--r-- | demos/embedded/raycasting/raycasting.pro | 5 | ||||
-rw-r--r-- | demos/embedded/weatherinfo/weatherinfo.pro | 2 | ||||
-rw-r--r-- | demos/qtdemo/xml/examples.xml | 1 | ||||
-rw-r--r-- | demos/textedit/textedit.doc | 18 | ||||
-rw-r--r-- | demos/textedit/textedit.qdoc | 59 |
15 files changed, 166 insertions, 60 deletions
diff --git a/demos/boxes/qtbox.cpp b/demos/boxes/qtbox.cpp index 54882fb..7134d63 100644 --- a/demos/boxes/qtbox.cpp +++ b/demos/boxes/qtbox.cpp @@ -319,6 +319,8 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi 0.5f * (right + left), 0.5f * (bottom + top), 0.0f, 1.0f }; + painter->beginNativePainting(); + glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadMatrixf(moveToRectMatrix); @@ -392,6 +394,8 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi glMatrixMode(GL_PROJECTION); glPopMatrix(); + painter->endNativePainting(); + ItemBase::paint(painter, option, widget); } diff --git a/demos/boxes/scene.cpp b/demos/boxes/scene.cpp index 016ba17..2a7ca0e 100644 --- a/demos/boxes/scene.cpp +++ b/demos/boxes/scene.cpp @@ -894,6 +894,7 @@ void Scene::drawBackground(QPainter *painter, const QRectF &) float width = float(painter->device()->width()); float height = float(painter->device()->height()); + painter->beginNativePainting(); setStates(); if (m_dynamicCubemap) @@ -913,6 +914,8 @@ void Scene::drawBackground(QPainter *painter, const QRectF &) defaultStates(); ++m_frame; + + painter->endNativePainting(); } QPointF Scene::pixelPosToViewPos(const QPointF& p) diff --git a/demos/boxes/scene.h b/demos/boxes/scene.h index efe1e3f..23f17e5 100644 --- a/demos/boxes/scene.h +++ b/demos/boxes/scene.h @@ -108,6 +108,8 @@ private: class GraphicsWidget : public QGraphicsProxyWidget { +public: + GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {} protected: virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); virtual void resizeEvent(QGraphicsSceneResizeEvent *event); diff --git a/demos/composition/composition.cpp b/demos/composition/composition.cpp index bb8a02c..8061908 100644 --- a/demos/composition/composition.cpp +++ b/demos/composition/composition.cpp @@ -377,7 +377,9 @@ void CompositionRenderer::paint(QPainter *painter) p.setCompositionMode(QPainter::CompositionMode_Source); p.fillRect(QRect(0, 0, m_pbuffer->width(), m_pbuffer->height()), Qt::transparent); - p.save(); + p.save(); // Needed when using the GL1 engine + p.beginNativePainting(); // Needed when using the GL2 engine + glBindTexture(GL_TEXTURE_2D, m_base_tex); glEnable(GL_TEXTURE_2D); glColor4f(1.,1.,1.,1.); @@ -399,16 +401,21 @@ void CompositionRenderer::paint(QPainter *painter) glEnd(); glDisable(GL_TEXTURE_2D); - p.restore(); + + p.endNativePainting(); // Needed when using the GL2 engine + p.restore(); // Needed when using the GL1 engine drawSource(p); p.end(); m_pbuffer->updateDynamicTexture(m_compositing_tex); } - glWidget()->makeCurrent(); + painter->beginNativePainting(); // Needed when using the GL2 engine + glWidget()->makeCurrent(); // Needed when using the GL1 engine glBindTexture(GL_TEXTURE_2D, m_compositing_tex); glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glColor4f(1.,1.,1.,1.); glBegin(GL_QUADS); { @@ -426,6 +433,7 @@ void CompositionRenderer::paint(QPainter *painter) } glEnd(); glDisable(GL_TEXTURE_2D); + painter->endNativePainting(); // Needed when using the GL2 engine } else #endif { diff --git a/demos/embedded/digiflip/digiflip.pro b/demos/embedded/digiflip/digiflip.pro index 6654088..4db5171 100644 --- a/demos/embedded/digiflip/digiflip.pro +++ b/demos/embedded/digiflip/digiflip.pro @@ -1 +1,7 @@ SOURCES = digiflip.cpp + +symbian { + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF72 +} + diff --git a/demos/embedded/embedded.pro b/demos/embedded/embedded.pro index 3d814f7..5bd3276 100644 --- a/demos/embedded/embedded.pro +++ b/demos/embedded/embedded.pro @@ -7,12 +7,10 @@ contains(QT_CONFIG, svg) { !vxworks:!qnx:SUBDIRS += fluidlauncher } -contains(QT_CONFIG, network) { - SUBDIRS += lightmaps - SUBDIRS += flightinfo - contains(QT_CONFIG, svg) { - SUBDIRS += weatherinfo - } +SUBDIRS += lightmaps +SUBDIRS += flightinfo +contains(QT_CONFIG, svg) { + SUBDIRS += weatherinfo } contains(QT_CONFIG, webkit) { diff --git a/demos/embedded/flickable/flickable.pro b/demos/embedded/flickable/flickable.pro index 3c021dd..02e88aa 100644 --- a/demos/embedded/flickable/flickable.pro +++ b/demos/embedded/flickable/flickable.pro @@ -1,2 +1,7 @@ SOURCES = flickable.cpp main.cpp HEADERS = flickable.h + +symbian { + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF73 +} diff --git a/demos/embedded/flightinfo/flightinfo.pro b/demos/embedded/flightinfo/flightinfo.pro index 5edb175..461c701 100644 --- a/demos/embedded/flightinfo/flightinfo.pro +++ b/demos/embedded/flightinfo/flightinfo.pro @@ -6,6 +6,8 @@ RESOURCES = flightinfo.qrc QT += network symbian { + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF74 HEADERS += $$QT_SOURCE_TREE/examples/network/ftp/sym_iap_util.h LIBS += -lesock -lconnmon TARGET.CAPABILITY = NetworkServices diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 522ccf3..3ed4f31 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -61,7 +61,6 @@ symbian { TARGET.UID3 = 0xA000A641 executables.sources = \ - embeddedsvgviewer.exe \ styledemo.exe \ deform.exe \ pathstroke.exe \ @@ -71,48 +70,78 @@ symbian { desktopservices.exe \ fridgemagnets.exe \ drilldown.exe \ - softkeys.exe - - contains(QT_CONFIG, webkit): executables.sources += anomaly.exe - contains(QT_CONFIG, script): executables.sources += context2d.exe + softkeys.exe \ + raycasting.exe \ + flickable.exe \ + digiflip.exe \ + lightmaps.exe \ + flightinfo.exe executables.path = /sys/bin reg_resource.sources = \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/ftp_reg.rsc\ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc - - contains(QT_CONFIG, webkit): reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc - contains(QT_CONFIG, script): reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/ftp_reg.rsc\ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/raycasting_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flickable_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/digiflip_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/lightmaps_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flightinfo_reg.rsc reg_resource.path = $$REG_RESOURCE_IMPORT_DIR resource.sources = \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/ftp.rsc\ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc - contains(QT_CONFIG, webkit): resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc - contains(QT_CONFIG, script): resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/ftp.rsc\ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/digiflip.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.rsc + resource.path = $$APP_RESOURCE_DIR + contains(QT_CONFIG, svg) { + executables.sources += \ + embeddedsvgviewer.exe \ + weatherinfo.exe + + reg_resource.sources += \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/weatherinfo_reg.rsc + + resource.sources += \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.rsc + } + contains(QT_CONFIG, webkit) { + executables.sources += anomaly.exe + reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc + resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc + } + contains(QT_CONFIG, script) { + executables.sources += context2d.exe + reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc + resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc + } + mifs.sources = \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif mifs.path = $$APP_RESOURCE_DIR diff --git a/demos/embedded/lightmaps/lightmaps.pro b/demos/embedded/lightmaps/lightmaps.pro index e57d15d..137183a 100644 --- a/demos/embedded/lightmaps/lightmaps.pro +++ b/demos/embedded/lightmaps/lightmaps.pro @@ -3,6 +3,8 @@ SOURCES = lightmaps.cpp QT += network symbian { + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF75 HEADERS += $$QT_SOURCE_TREE/examples/network/ftp/sym_iap_util.h LIBS += -lesock -lconnmon TARGET.CAPABILITY = NetworkServices diff --git a/demos/embedded/raycasting/raycasting.pro b/demos/embedded/raycasting/raycasting.pro index dae9412..19e0212 100644 --- a/demos/embedded/raycasting/raycasting.pro +++ b/demos/embedded/raycasting/raycasting.pro @@ -1,3 +1,8 @@ TEMPLATE = app SOURCES = raycasting.cpp RESOURCES += raycasting.qrc + +symbian { + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF76 +} diff --git a/demos/embedded/weatherinfo/weatherinfo.pro b/demos/embedded/weatherinfo/weatherinfo.pro index a89acba..0a579b0 100644 --- a/demos/embedded/weatherinfo/weatherinfo.pro +++ b/demos/embedded/weatherinfo/weatherinfo.pro @@ -5,6 +5,8 @@ RESOURCES = weatherinfo.qrc QT += network svg symbian { + include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) + TARGET.UID3 = 0xA000CF77 HEADERS += $$QT_SOURCE_TREE/examples/network/ftp/sym_iap_util.h LIBS += -lesock -lconnmon TARGET.CAPABILITY = NetworkServices diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index f598780..77006c2 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -184,7 +184,6 @@ <category dirname="statemachine" name="State Machine"> <example filename="eventtransitions" name="Event Transitions" /> <example filename="rogue" name="Rogue" /> - <example filename="tankgame" name="Tank Game" /> <example filename="trafficlight" name="Traffic Light" /> <example filename="twowaybutton" name="Two-way Button" /> </category> diff --git a/demos/textedit/textedit.doc b/demos/textedit/textedit.doc deleted file mode 100644 index 53279b9..0000000 --- a/demos/textedit/textedit.doc +++ /dev/null @@ -1,18 +0,0 @@ -/*! \page textedit-example.html - - \ingroup examples - \title Text Edit Example - - This example displays a text editor with the user interface written - in pure C++. - - A similar example which uses \link designer-manual.book Qt - Designer\endlink to produce the user interface is in the \link - designer-manual.book Qt Designer manual\endlink. - - - See \c{$QTDIR/examples/textedit} for the source code. - -*/ - - diff --git a/demos/textedit/textedit.qdoc b/demos/textedit/textedit.qdoc new file mode 100644 index 0000000..c9b06e8 --- /dev/null +++ b/demos/textedit/textedit.qdoc @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! \page textedit-example.html + + \ingroup examples + \title Text Edit Example + + This example displays a text editor with the user interface written + in pure C++. + + A similar example which uses \link designer-manual.book Qt + Designer\endlink to produce the user interface is in the \link + designer-manual.book Qt Designer manual\endlink. + + + See \c{$QTDIR/examples/textedit} for the source code. + +*/ + + |