From 0883940b2aafa56b0af85970be9a5f14aeeda4c1 Mon Sep 17 00:00:00 2001 From: laurentgom Date: Mon, 4 May 2009 07:41:39 +0000 Subject: [PATCH] FS#108 - Updated the Qt sample and tutorial to work with Qt 4.5 git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1082 4e206d99-4929-0410-ac5d-dfc041789085 --- samples/qt/QSFMLCanvas.cpp | 10 ++++++++++ samples/qt/QSFMLCanvas.hpp | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/samples/qt/QSFMLCanvas.cpp b/samples/qt/QSFMLCanvas.cpp index 3baa0466..f4302ee2 100644 --- a/samples/qt/QSFMLCanvas.cpp +++ b/samples/qt/QSFMLCanvas.cpp @@ -20,6 +20,7 @@ myInitialized (false) { // Setup some states to allow direct rendering into the widget setAttribute(Qt::WA_PaintOnScreen); + setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_NoSystemBackground); // Set strong focus to enable keyboard events to be received @@ -63,6 +64,15 @@ void QSFMLCanvas::OnUpdate() } +//////////////////////////////////////////////////////////// +/// Return the paint engine used by the widget to draw itself +//////////////////////////////////////////////////////////// +QPaintEngine* QSFMLCanvas::paintEngine() const +{ + return 0; +} + + //////////////////////////////////////////////////////////// /// Called when the widget is shown ; /// we use it to initialize our SFML window diff --git a/samples/qt/QSFMLCanvas.hpp b/samples/qt/QSFMLCanvas.hpp index a129e014..e02f0263 100644 --- a/samples/qt/QSFMLCanvas.hpp +++ b/samples/qt/QSFMLCanvas.hpp @@ -50,6 +50,12 @@ private : //////////////////////////////////////////////////////////// virtual void OnUpdate(); + //////////////////////////////////////////////////////////// + /// Return the paint engine used by the widget to draw itself + /// + //////////////////////////////////////////////////////////// + virtual QPaintEngine* paintEngine() const; + //////////////////////////////////////////////////////////// /// Called when the widget is shown ; /// we use it to initialize our SFML window