diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-13 09:17:15 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-13 09:17:15 (GMT) |
commit | e287f1b01dd50106f58967861a1c272b248d450a (patch) | |
tree | 0b1f2d787772fc0c27d9daf368823ea65a1ccaf0 /examples | |
parent | 2e5706eeee2fb9ce543466f469ace2d49ed4be64 (diff) | |
parent | 99b19431e6846a36a65f23d21a95140a081d1f1a (diff) | |
download | Qt-e287f1b01dd50106f58967861a1c272b248d450a.zip Qt-e287f1b01dd50106f58967861a1c272b248d450a.tar.gz Qt-e287f1b01dd50106f58967861a1c272b248d450a.tar.bz2 |
Merge commit 'upstream/4.6' into 4.6
Diffstat (limited to 'examples')
-rw-r--r-- | examples/effects/fademessage/fademessage.cpp | 10 | ||||
-rw-r--r-- | examples/effects/fademessage/fademessage.pro | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/examples/effects/fademessage/fademessage.cpp b/examples/effects/fademessage/fademessage.cpp index 818d00f..28dd3bd 100644 --- a/examples/effects/fademessage/fademessage.cpp +++ b/examples/effects/fademessage/fademessage.cpp @@ -94,13 +94,17 @@ void FadeMessage::setupScene() QFont font; font.setPointSize(font.pointSize() * 2); font.setBold(true); - int fh = QFontMetrics(font).height(); + QFontMetrics fontMetrics(font); + int fh = fontMetrics.height(); - QGraphicsRectItem *block = m_scene.addRect(50, 300, 300, fh + 3); + QString sceneText = "Qt Everywhere!"; + int sceneTextWidth = fontMetrics.width(sceneText); + + QGraphicsRectItem *block = m_scene.addRect(50, 300, sceneTextWidth, fh + 3); block->setPen(Qt::NoPen); block->setBrush(QColor(102, 153, 51)); - QGraphicsTextItem *text = m_scene.addText("Qt Everywhere!", font); + QGraphicsTextItem *text = m_scene.addText(sceneText, font); text->setDefaultTextColor(Qt::white); text->setPos(50, 300); block->setZValue(2); diff --git a/examples/effects/fademessage/fademessage.pro b/examples/effects/fademessage/fademessage.pro index ed9e53d..cb1fda7 100644 --- a/examples/effects/fademessage/fademessage.pro +++ b/examples/effects/fademessage/fademessage.pro @@ -11,3 +11,6 @@ sources.files = $$SOURCES \ $$FORMS \ fademessage.pro sources.path = $$[QT_INSTALL_EXAMPLES]/effects/fademessage + +DEPLOYMENT_PLUGIN += qjpeg + |