Sign in to follow this  
Saint Squireen

QT SFML C++

Recommended Posts

I have been trying to figure out how to sync/link SFML and QT together by making a custom widget and following the advice on the tutorials page of

http://www.sfml-dev.org/tutorials/1.3/graphics-qt.php

and I just dont understand it. Ive never tried to make a custom widget before and I apparently cant wrap my mind around whats being shown and what I need to do.

Could somebody please try to help me understand this?

Share this post


Link to post
Share on other sites
You linked to the SFML 1.3 version tutorial. The latest stable version of SFML is 1.6, and the current officially unofficial build is version 2.0.
Which version of SFML are you actually using? Also, which version of Qt are you using? Most likely Qt would be either: 4.6.x, 4.7.x, 4.8.x, or (unofficial) 5.0.x. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
Well i wanted to use SFML version 2.0 but I swapped that idea with the one to download and use SFML 1.6 for windows(64bit) because I think it will be much less riskier. Also I have never used SFML before. The QT that I have downloaded says it is 2.4.0 but thats not one of your acceptable answers so I dont have a clue. I have been working on QT for a very,VERY short amout of time.

Share this post


Link to post
Share on other sites
The Qt you downloaded was probably the QtSDK 2.4.0 which is the version of QtCreator (I think?) but ships with the Qt [i]api[/i] version 4.7.x or there-abouts, so you're fine.

If you are using SFML 1.6, you want to use [url="http://www.sfml-dev.org/tutorials/1.6/graphics-qt.php"]this tutorial[/url] to be up to date.

Essentially, Qt and SFML are both two separate APIs, and gluing them together is definitely possible (my own game does that), but neither is designed with that in mind, which is why it may seem weird to you.

Do you understand C++ inheritance? The class being created in the SFML tutorial is inheriting a QWidget (from the Qt api) to override some virtual functions QWidget provides, so the new class can interact with the Qt API and other Qt widgets. The new class also inherits a sf::RenderWindow (from the SFML api) to allow SFML to control the drawing and input of that class, when Qt tells the class that it has input or that it is ready to draw.

Qt controls the lifetime of the widget, and calls the virtual functions, but SFML handles the virtual functions when called.
The class has to set some Qt-specific attributes to let Qt know that Qt itself won't be handling the drawing, among other things. Qt also uses something called Signals-and-Slots, which is a non-standard addition to C++. SFML takes advantage of that, to tell Qt to re-render the window at a specific framerate (this is the "[i]connect(.., SIGNAL(...), ..., SLOT(...));[/i]" line of code.

Looking at the tutorial, is there a particular piece of code that you have questions about? There are a number of oddities in there, if you've never used Qt before. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
First off, thanks for countinuously responding to my questions!!! And secondly, I do understand inheritance(at least I am pretty sure I do). I know what signal and slot do but from that point on (both in standard addition C++, SFML,QT)I know practically nothing else. Now Im just going to review the link you posted and Ill come back here in a couple minutes to update you. Thanks again!!!!!

Share this post


Link to post
Share on other sites
Using Qt Creator, to start a new project using the Qt API:
[b]File -> New file or project -> Qt Widget Project -> Qt Gui Application[/b]

This will start a wizard to create a project.

First name your project and choose where to place the project, hit "Next" and on the "Target Setup" screen, select just two builds - one for release, and one for debug - using the same MinGW install and the same Qt api version.

The final page of the wizard sets up a Qt main window, and asks you to name it. The defaults are fine, but you can name it something different if you like. Uncheck "Generate form", if your SFML window is going to be your sole Qt window. Hit 'Next', and then the last page can be skipped if you're not using a version control system.

This will create an initial project, which includes your .pro file. Your .pro file is the makefile that QMake uses to compile your project.

It also creates a main.cpp, mainwindow.cpp, and mainwindow.h. Leave main.cpp as it is, but you can modify the 'MainWindow' class to be like the SFML tutorial describes, first changing:
[code]//In the header:
#include <QtGui/QMainWindow>
class MainWindow : public QMainWindow
{
Q_OBJECT

public:
MainWindow(QWidget *parent = 0);
~MainWindow();
};

//In the source file:
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
}
[/code]

To this instead:
[code]//In the header:
#include <QWidget> //I changed <QtGui/QMainWindow> to <QWidget>

class MainWindow : public QWidget //I changed QMainWindow to QWidget
{
Q_OBJECT

public:
MainWindow(QWidget *parent = 0);
~MainWindow();
};

//In the source file:
MainWindow::MainWindow(QWidget *parent)
: QWidget(parent) //I changed QMainWindow to QWidget
{
}
[/code]

Then you can follow the tutorial for the SFML-specific tweaks.
In your .pro file, you need to add some variables: (this is in addition to the other variables already present in the .pro file)
[code]#Location to save your executable:
DESTDIR = "../MyPath"

#Name of your executable:
TARGET = MyGame

#SFML libraries:
LIBS += -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system -lsfml-main

#Path to the linker import files: (sfml-audio.a or whatever)
LIBS += -L"D:/my/path/to/SFML/lib/"

#Path to SFML headers:
INCLUDEPATH = "D:/my/path/to/SFML/include/"[/code] Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
[quote name='Saint Squireen' timestamp='1342810374' post='4961408']
Well i wanted to use SFML version 2.0 but I swapped that idea with the one to download and use SFML 1.6 for windows(64bit) because I think it will be much less riskier.
[/quote]
For what it's worth, using SFML 2.0 is probably less risky than using 1.6, actually. Even though SFML 2.0 isn't technically "done," Laurent himself has said that SFML 1.6 is [url="http://en.sfml-dev.org/forums/index.php?topic=8210.msg54932#msg54932"]deprecated[/url]. It's ok if you go with 1.6 (the world will keep on revolving just fine), but I'd personally recommend upgrading to 2.0.

Share this post


Link to post
Share on other sites
Okay so I have just finished up word for word what you have done and did a bunch of copy and pasting. The only part I did not get, was when you said to look for SFML specific tweaks.... Could you clarify a little bit more? Also in that last picture of the variables that needed to go into my "project".pro class, is it okay if I copied the whole picture and pasted it into my "project".pro?

ps- Thanks so much again!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

pps-Cornstalks-Thanks for the insight but I think I might just stick with 1.6 for now just to get started. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]



ppps-I did nothing else to the project besides copy and paste what you said for me to do and my question now is, "what now?". Do I just save it? Do I just run it? Edited by Saint Squireen

Share this post


Link to post
Share on other sites
Well, did you follow [url="http://www.sfml-dev.org/tutorials/1.6/graphics-qt.php"]the tutorial[/url] yet?

What I explained above was to get you to a starting place from which you can follow the tutorial. By "SFML-specific tweaks", I meant the tutorial SFML provides that walks through how to get SFML running with Qt. When following the tutorial, if you don't understand something, then let us know - but until you follow the tutorial, there's no point in us walking you through the exact same steps the tutorial walks you through, because the tutorial will do a superior job in explaining things. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

You're definitely welcome to copy+paste the .pro settings I showed you. Ofcourse, you have to fill in the details with what works for your environment, because "[i]D:/my/path/to/SFML/lib/[/i]" doesn't actually exist on your computer. You have to replace it with the path to wherever you installed your copy of SFML's .a files. Same with "[i]D:/my/path/to/SFML/include/[/i]" - that location doesn't actually exist, you have to replace it with the real location that is specific to where you installed SFML's header files.

Share this post


Link to post
Share on other sites
Okay so I just fiished up everything and I only have one error left but I dont know what it means or how to solve it. It says:


multiple target patterns. stop.
File not found: Makefile.Debug


Do you know what it means?

Share this post


Link to post
Share on other sites
[quote name='Saint Squireen' timestamp='1342817124' post='4961459']
By any chance would this same setup work for sfml 2.0 too?
[/quote]

It seems to be working fine (I just made the transfer yesterday and this morning).

With SFML 2.0, you probably need to compile it by source, and the tutorials aren't yet available for it. For learning purposes you'll want the tutorials to be exactly accurate. When you do move to SFML 2.0 on a different project, the API is mostly the same, but there are enough changes that you don't want to be following a tutorial and not know whether it's messing up because you did something wrong or because the API changed in that spot.

The transfer to SFML 2.0 for me only took a day, but I already know how to use SFML, and I haven't yet tested to make sure all the code is still working. I've already ran into one "gotcha" where everything compiles but doesn't work (easy to fix but tricky to find), and I'm sure there are a few more hidden away.

I'd recommend waiting for it to 2.0 to become officially release with complete tutorials, if you're trying to learn it at the same time.

On the other hand, SFML 2.0 is pretty much finished, and it's supposedly stable and cross-platform supporting already - it'll probably be official released real soon; a 'release client' was already released, so it'll probablly be officially released in a month or two. It's up to you to decide what makes the most sense for your learning process. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
In QtCreator, go to your .pro file. It'll be named after your project name: [b]myProjectName.pro [/b][size=2](Where 'myProjectName' is replaced with the name of your project)[/size]

Open it, select it all, and copy it. Then paste it here in a post. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
hahahahahahahahahaha whoops sorry haha XD




[color=#008000]#-------------------------------------------------[/color]
[color=#008000]#[/color]
[color=#008000]#[/color][color=#c0c0c0] [/color][color=#008000]Project[/color][color=#c0c0c0] [/color][color=#008000]created[/color][color=#c0c0c0] [/color][color=#008000]by[/color][color=#c0c0c0] [/color][color=#008000]QtCreator[/color][color=#c0c0c0] [/color][color=#008000]2012-07-20T14:57:41[/color]
[color=#008000]#[/color]
[color=#008000]#-------------------------------------------------[/color]
[color=#800080]QT[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]core[color=#c0c0c0] [/color]gui
[color=#800080]TARGET[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]SFML-Test
[color=#800080]TEMPLATE[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]app
[color=#800080]SOURCES[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]main.cpp\
[color=#c0c0c0] [/color]mainwindow.cpp[color=#c0c0c0] [/color]\
[color=#c0c0c0] [/color]QSFMLCanvas.cpp
[color=#800080]HEADERS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]mainwindow.h[color=#c0c0c0] [/color]\
[color=#c0c0c0] [/color]QSFMLCanvas.hpp
[color=#800080]FORMS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]mainwindow.ui
[color=#008000]#Location[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]save[/color][color=#c0c0c0] [/color][color=#008000]your[/color][color=#c0c0c0] [/color][color=#008000]executable:[/color]
[color=#800080]DESTDIR[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]"C:\Users\Griffin[color=#c0c0c0] [/color]Laptop\Desktop\SFML-1.6-sdk-windows-mingw.zip"
[color=#008000]#Name[/color][color=#c0c0c0] [/color][color=#008000]of[/color][color=#c0c0c0] [/color][color=#008000]your[/color][color=#c0c0c0] [/color][color=#008000]executable:[/color]
[color=#800080]TARGET[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]MyGame
[color=#008000]#SFML[/color][color=#c0c0c0] [/color][color=#008000]libraries:[/color]
[color=#800080]LIBS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]-lsfml-audio[color=#c0c0c0] [/color]-lsfml-graphics[color=#c0c0c0] [/color]-lsfml-window[color=#c0c0c0] [/color]-lsfml-[color=#808000]system[/color][color=#c0c0c0] [/color]-lsfml-main
[color=#008000]#Path[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]linker[/color][color=#c0c0c0] [/color][color=#008000]import[/color][color=#c0c0c0] [/color][color=#008000]files:[/color][color=#c0c0c0] [/color][color=#008000](sfml-audio.a[/color][color=#c0c0c0] [/color][color=#008000]or[/color][color=#c0c0c0] [/color][color=#008000]whatever)[/color]
[color=#800080]LIBS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]-L"C:\Users\Griffin[color=#c0c0c0] [/color]Laptop\Desktop\SFML-1.6-sdk-windows-mingw.zip\SFML-1.6\lib"
[color=#008000]#Path[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]headers:[/color]
[color=#800080]INCLUDEPATH[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]"C:\Users\Griffin[color=#c0c0c0] [/color]Laptop\Desktop\SFML-1.6-sdk-windows-mingw.zip\SFML-1.6\[color=#808000]include[/color]\SFML"

Share this post


Link to post
Share on other sites
Change:
[code]INCLUDEPATH = "C:\Users\Griffin Laptop\Desktop\SFML-1.6-sdk-windows-mingw.zip\SFML-1.6\include\SFML"[/code]
To:
[code]INCLUDEPATH = "C:\Users\Griffin Laptop\Desktop\SFML-1.6-sdk-windows-mingw.zip\SFML-1.6\include\"[/code]

I don't know if your destination directory (DESTDIR) can be inside a zip file. I'd set it to a normal folder just for your project.
You also have 'TARGET' listed twice (with different assignments). Only have one.

That last one should fix your error, since the error is stating that you have too many TARGETs.

Share this post


Link to post
Share on other sites
Wierd........ It didnt fix it........I extracted the files, erased the second target, and changed the include path problem but nothing seemed to be fixed........ It came up with the same error too. The "multiple target patterns. stop. /newline/ File not found: Makefile.Debug" error.... Is there any way to just send you my project and see whats messed up about it? Would that make it help?

Share this post


Link to post
Share on other sites
[color=#008000]#-------------------------------------------------[/color]
[color=#008000]#[/color]
[color=#008000]#[/color][color=#c0c0c0] [/color][color=#008000]Project[/color][color=#c0c0c0] [/color][color=#008000]created[/color][color=#c0c0c0] [/color][color=#008000]by[/color][color=#c0c0c0] [/color][color=#008000]QtCreator[/color][color=#c0c0c0] [/color][color=#008000]2012-07-20T14:57:41[/color]
[color=#008000]#[/color]
[color=#008000]#-------------------------------------------------[/color]
[color=#800080]QT[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]core[color=#c0c0c0] [/color]gui
[color=#800080]TARGET[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]SFML-Test
[color=#800080]TEMPLATE[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]app
[color=#800080]SOURCES[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]main.cpp\
[color=#c0c0c0] [/color]mainwindow.cpp[color=#c0c0c0] [/color]\
[color=#c0c0c0] [/color]QSFMLCanvas.cpp
[color=#800080]HEADERS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]mainwindow.h[color=#c0c0c0] [/color]\
[color=#c0c0c0] [/color]QSFMLCanvas.hpp
[color=#800080]FORMS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]mainwindow.ui
[color=#008000]#Location[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]save[/color][color=#c0c0c0] [/color][color=#008000]your[/color][color=#c0c0c0] [/color][color=#008000]executable:[/color]
[color=#800080]DESTDIR[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]"C:\Users\Griffin[color=#c0c0c0] [/color]Laptop\Desktop\SFML-1.6-sdk-windows-mingw"
[color=#008000]#SFML[/color][color=#c0c0c0] [/color][color=#008000]libraries:[/color]
[color=#800080]LIBS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]-lsfml-audio[color=#c0c0c0] [/color]-lsfml-graphics[color=#c0c0c0] [/color]-lsfml-window[color=#c0c0c0] [/color]-lsfml-[color=#808000]system[/color][color=#c0c0c0] [/color]-lsfml-main
[color=#008000]#Path[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]linker[/color][color=#c0c0c0] [/color][color=#008000]import[/color][color=#c0c0c0] [/color][color=#008000]files:[/color][color=#c0c0c0] [/color][color=#008000](sfml-audio.a[/color][color=#c0c0c0] [/color][color=#008000]or[/color][color=#c0c0c0] [/color][color=#008000]whatever)[/color]
[color=#800080]LIBS[/color][color=#c0c0c0] [/color]+=[color=#c0c0c0] [/color]-L"C:\Users\Griffin[color=#c0c0c0] [/color]Laptop\Desktop\SFML-1.6-sdk-windows-mingw\SFML-1.6\lib"
[color=#008000]#Path[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]headers:[/color]
[color=#800080]INCLUDEPATH[/color][color=#c0c0c0] [/color]=[color=#c0c0c0] [/color]"C:\Users\Griffin[color=#c0c0c0] [/color]Laptop\Desktop\SFML-1.6-sdk-windows-mingw\SFML-1.6\[color=#808000]include[/color]"






Heres what I have again.

Share this post


Link to post
Share on other sites
I just left my development machine, so if you post your source files and header file (post them between [ code ] and [ /code ] tags, like this:

MyHeaderName.h
[ code ] my code goes here [ /code ] //But without spaces between the square brackets.

MySourceName.h
[ code ] my code goes here [ /code ]

MyOtherHeader.h
[ code ] my code goes here [ /code ]

Because I'm no longer on my programming machine, and am just using a laptop somewhere else, I can't test your project at the moment, but I will do so tomorrow morning unless you or someone else figures it out before then.

Share this post


Link to post
Share on other sites
main.cpp
[code]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Headers[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]"QSFMLCanvas.hpp"[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QApplication>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QVBoxLayout>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QFrame>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QLabel>[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Custom[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]canvas[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]class[/color][color=#c0c0c0] [/color][color=#800080]MyCanvas[/color][color=#c0c0c0] [/color][color=#000000]:[/color][color=#c0c0c0] [/color][color=#808000]public[/color][color=#c0c0c0] [/color]QSFMLCanvas
[color=#000000]{[/color]
[color=#808000]public[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Construct[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]canvas[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#800080]MyCanvas[/color][color=#000000]([/color]QWidget[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Parent[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color]NULL[color=#000000])[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]([/color]QSize[color=#000000]([/color][color=#000080]100[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]100[/color][color=#000000]),[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Parent[/color][color=#000000])[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#808000]private[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]/see[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas::OnInit[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnInit[/i][/color][color=#000000]()[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Load[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]image[/color]
[color=#c0c0c0] [/color][color=#800000]myImage[/color][color=#000000].[/color]LoadFromFile[color=#000000]([/color][color=#008000]"datas/qt/sfml.png"[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]sprite[/color]
[color=#c0c0c0] [/color][color=#800000]mySprite[/color][color=#000000].[/color]SetImage[color=#000000]([/color][color=#800000]myImage[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#800000]mySprite[/color][color=#000000].[/color]SetCenter[color=#000000]([/color][color=#800000]mySprite[/color][color=#000000].[/color]GetSize[color=#000000]()[/color][color=#c0c0c0] [/color][color=#000000]/[/color][color=#c0c0c0] [/color][color=#000080]2.f[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]/see[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas::OnUpdate[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnUpdate[/i][/color][color=#000000]()[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color]sf[color=#000000]::[/color]Event[color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000];[/color]
[color=#c0c0c0] [/color][color=#808000]while[/color][color=#c0c0c0] [/color][color=#000000]([/color]GetEvent[color=#000000]([/color][color=#000000]Event[/color][color=#000000]))[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Stick[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]sprite[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]mouse[/color][color=#c0c0c0] [/color][color=#008000]cursor[/color]
[color=#c0c0c0] [/color][color=#808000]if[/color][color=#c0c0c0] [/color][color=#000000]([/color][color=#000000]Event[/color][color=#000000].[/color]Type[color=#c0c0c0] [/color][color=#000000]==[/color][color=#c0c0c0] [/color]sf[color=#000000]::[/color]Event[color=#000000]::[/color]MouseMoved[color=#000000])[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#800000]mySprite[/color][color=#000000].[/color]SetPosition[color=#000000]([/color]ConvertCoords[color=#000000]([/color][color=#000000]Event[/color][color=#000000].[/color]MouseMove[color=#000000].[/color]X[color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000].[/color]MouseMove[color=#000000].[/color]Y[color=#000000]));[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Adjust[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]size[/color][color=#c0c0c0] [/color][color=#008000]of[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]default[/color][color=#c0c0c0] [/color][color=#008000]view[/color][color=#c0c0c0] [/color][color=#008000]when[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color][color=#c0c0c0] [/color][color=#008000]is[/color][color=#c0c0c0] [/color][color=#008000]resized[/color]
[color=#c0c0c0] [/color][color=#808000]if[/color][color=#c0c0c0] [/color][color=#000000]([/color][color=#000000]Event[/color][color=#000000].[/color]Type[color=#c0c0c0] [/color][color=#000000]==[/color][color=#c0c0c0] [/color]sf[color=#000000]::[/color]Event[color=#000000]::[/color]Resized[color=#000000])[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color]GetDefaultView[color=#000000]().[/color]SetFromRect[color=#000000]([/color]sf[color=#000000]::[/color]FloatRect[color=#000000]([/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000].[/color]Size[color=#000000].[/color]Width[color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000].[/color]Size[color=#000000].[/color]Height[color=#000000]));[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Rotate[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]sprite[/color]
[color=#c0c0c0] [/color][color=#800000]mySprite[/color][color=#000000].[/color]Rotate[color=#000000]([/color]GetFrameTime[color=#000000]()[/color][color=#c0c0c0] [/color][color=#000000]*[/color][color=#c0c0c0] [/color][color=#000080]100.f[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Clear[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]view[/color]
[color=#c0c0c0] [/color]Clear[color=#000000]([/color]sf[color=#000000]::[/color]Color[color=#000000]([/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]128[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000]));[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Draw[/color][color=#c0c0c0] [/color][color=#008000]it[/color]
[color=#c0c0c0] [/color]Draw[color=#000000]([/color][color=#800000]mySprite[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Member[/color][color=#c0c0c0] [/color][color=#000080]data[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color]sf[color=#000000]::[/color]Image[color=#c0c0c0] [/color][color=#800000]myImage[/color][color=#000000];[/color][color=#c0c0c0] [/color][color=#000080]///<[/color][color=#c0c0c0] [/color][color=#000080]Some[/color][color=#c0c0c0] [/color][color=#000080]image[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]show[/color]
[color=#c0c0c0] [/color]sf[color=#000000]::[/color]Sprite[color=#c0c0c0] [/color][color=#800000]mySprite[/color][color=#000000];[/color][color=#c0c0c0] [/color][color=#000080]///<[/color][color=#c0c0c0] [/color][color=#000080]A[/color][color=#c0c0c0] [/color][color=#000080]sprite[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]display[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]image[/color]
[color=#000000]};[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Entry[/color][color=#c0c0c0] [/color][color=#000080]point[/color][color=#c0c0c0] [/color][color=#000080]of[/color][color=#c0c0c0] [/color][color=#000080]application[/color]
[color=#008000]///[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\return[/color][color=#c0c0c0] [/color][color=#000080]Application[/color][color=#c0c0c0] [/color][color=#000080]exit[/color][color=#c0c0c0] [/color][color=#000080]code[/color]
[color=#008000]///[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]int[/color][color=#c0c0c0] [/color]main[color=#000000]([/color][color=#808000]int[/color][color=#c0c0c0] [/color][color=#000000]argc[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]char[/color][color=#c0c0c0] [/color][color=#000000]**[/color][color=#000000]argv[/color][color=#000000])[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color]QApplication[color=#c0c0c0] [/color][color=#000000]App[/color][color=#000000]([/color][color=#000000]argc[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]argv[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]main[/color][color=#c0c0c0] [/color][color=#008000]frame[/color]
[color=#c0c0c0] [/color]QFrame[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color]QFrame[color=#000000];[/color]
[color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]setWindowTitle[color=#000000]([/color][color=#008000]"Qt[/color][color=#c0c0c0] [/color][color=#008000]SFML"[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]resize[color=#000000]([/color][color=#000080]400[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]400[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]show[color=#000000]();[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]label[/color][color=#c0c0c0] [/color][color=#008000]for[/color][color=#c0c0c0] [/color][color=#008000]showing[/color][color=#c0c0c0] [/color][color=#008000]some[/color][color=#c0c0c0] [/color][color=#008000]text[/color]
[color=#c0c0c0] [/color]QLabel[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Label[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color]QLabel[color=#000000]([/color][color=#008000]"This[/color][color=#c0c0c0] [/color][color=#008000]is[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]window\nembedded[/color][color=#c0c0c0] [/color][color=#008000]into[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]Qt[/color][color=#c0c0c0] [/color][color=#008000]frame[/color][color=#c0c0c0] [/color][color=#008000]:"[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]Label[/color][color=#000000]->[/color]setFont[color=#000000]([/color]QFont[color=#000000]([/color][color=#008000]"courier[/color][color=#c0c0c0] [/color][color=#008000]new"[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]14[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]1[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]false[/color][color=#000000]));[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]view[/color][color=#c0c0c0] [/color][color=#008000]inside[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]main[/color][color=#c0c0c0] [/color][color=#008000]frame[/color]
[color=#c0c0c0] [/color][color=#800080]MyCanvas[/color][color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]SFMLView[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color][color=#800080]MyCanvas[/color][color=#000000]([/color][color=#000000]MainFrame[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]main[/color][color=#c0c0c0] [/color][color=#008000]layout[/color]
[color=#c0c0c0] [/color]QVBoxLayout[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Layout[/color][color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#808000]new[/color][color=#c0c0c0] [/color]QVBoxLayout[color=#000000];[/color]
[color=#c0c0c0] [/color][color=#000000]Layout[/color][color=#000000]->[/color]addWidget[color=#000000]([/color][color=#000000]Label[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]Layout[/color][color=#000000]->[/color]addWidget[color=#000000]([/color][color=#000000]SFMLView[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#000080]1[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#000000]MainFrame[/color][color=#000000]->[/color]setLayout[color=#000000]([/color][color=#000000]Layout[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#808000]return[/color][color=#c0c0c0] [/color][color=#000000]App[/color][color=#000000].[/color]exec[color=#000000]();[/color]
[color=#000000]}[/color]
[/code]


QSFMLCanvas.cpp
[code]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Headers[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]"QSFMLCanvas.hpp"[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QEvent>[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Platform-specific[/color][color=#c0c0c0] [/color][color=#008000]headers[/color]
[color=#000080]#ifdef[/color][color=#c0c0c0] [/color]Q_WS_X11
[color=#c0c0c0] [/color][color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<Qt/qx11info_x11.h>[/color]
[color=#c0c0c0] [/color][color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<X11/Xlib.h>[/color]
[color=#000080]#endif[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Construct[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
QSFMLCanvas[color=#000000]::[/color]QSFMLCanvas[color=#000000]([/color][color=#808000]const[/color][color=#c0c0c0] [/color]QSize[color=#000000]&[/color][color=#c0c0c0] [/color][color=#000000]Size[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]unsigned[/color][color=#c0c0c0] [/color][color=#808000]int[/color][color=#c0c0c0] [/color][color=#000000]FrameTime[/color][color=#000000],[/color][color=#c0c0c0] [/color]QWidget[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Parent[/color][color=#000000])[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
QWidget[color=#000000]([/color][color=#000000]Parent[/color][color=#000000])[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Resize[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color]
[color=#c0c0c0] [/color]resize[color=#000000]([/color][color=#000000]Size[/color][color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]some[/color][color=#c0c0c0] [/color][color=#008000]states[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]allow[/color][color=#c0c0c0] [/color][color=#008000]direct[/color][color=#c0c0c0] [/color][color=#008000]rendering[/color][color=#c0c0c0] [/color][color=#008000]into[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color]
[color=#c0c0c0] [/color]setAttribute[color=#000000]([/color]Qt[color=#000000]::[/color]WA_PaintOnScreen[color=#000000]);[/color]
[color=#c0c0c0] [/color]setAttribute[color=#000000]([/color]Qt[color=#000000]::[/color]WA_OpaquePaintEvent[color=#000000]);[/color]
[color=#c0c0c0] [/color]setAttribute[color=#000000]([/color]Qt[color=#000000]::[/color]WA_NoSystemBackground[color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Set[/color][color=#c0c0c0] [/color][color=#008000]strong[/color][color=#c0c0c0] [/color][color=#008000]focus[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]enable[/color][color=#c0c0c0] [/color][color=#008000]keyboard[/color][color=#c0c0c0] [/color][color=#008000]events[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]be[/color][color=#c0c0c0] [/color][color=#008000]received[/color]
[color=#c0c0c0] [/color]setFocusPolicy[color=#000000]([/color]Qt[color=#000000]::[/color]StrongFocus[color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]timer[/color]
[color=#c0c0c0] [/color]myTimer[color=#000000].[/color]setInterval[color=#000000]([/color][color=#000000]FrameTime[/color][color=#000000]);[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Destructor[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
QSFMLCanvas[color=#000000]::~[/color]QSFMLCanvas[color=#000000]()[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Nothing[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]do...[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]initializations[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]void[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]OnInit[color=#000000]()[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Nothing[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]by[/color][color=#c0c0c0] [/color][color=#008000]default...[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]its[/color][color=#c0c0c0] [/color][color=#000080]update[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]drawing[/color][color=#c0c0c0] [/color][color=#000080]stuff[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]void[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]OnUpdate[color=#000000]()[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Nothing[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]by[/color][color=#c0c0c0] [/color][color=#008000]default...[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Return[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]paint[/color][color=#c0c0c0] [/color][color=#000080]engine[/color][color=#c0c0c0] [/color][color=#000080]used[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]draw[/color][color=#c0c0c0] [/color][color=#000080]itself[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
QPaintEngine[color=#000000]*[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]paintEngine[color=#000000]()[/color][color=#c0c0c0] [/color][color=#808000]const[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#808000]return[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000];[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]each[/color][color=#c0c0c0] [/color][color=#000080]time[/color][color=#c0c0c0] [/color][color=#000080]an[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]received[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]catch[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]Polish[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]initialize[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]our[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]window[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]bool[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]event[color=#000000]([/color]QEvent[color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000]Event[/color][color=#000000])[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#808000]if[/color][color=#c0c0c0] [/color][color=#000000]([/color][color=#000000]Event[/color][color=#000000]->[/color]type[color=#000000]()[/color][color=#c0c0c0] [/color][color=#000000]==[/color][color=#c0c0c0] [/color]QEvent[color=#000000]::[/color]Polish[color=#000000])[/color]
[color=#c0c0c0] [/color][color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Under[/color][color=#c0c0c0] [/color][color=#008000]X11,[/color][color=#c0c0c0] [/color][color=#008000]we[/color][color=#c0c0c0] [/color][color=#008000]need[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]flush[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]commands[/color][color=#c0c0c0] [/color][color=#008000]sent[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]server[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]ensure[/color][color=#c0c0c0] [/color][color=#008000]that[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]will[/color][color=#c0c0c0] [/color][color=#008000]get[/color][color=#c0c0c0] [/color][color=#008000]an[/color][color=#c0c0c0] [/color][color=#008000]updated[/color][color=#c0c0c0] [/color][color=#008000]view[/color][color=#c0c0c0] [/color][color=#008000]of[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]windows[/color]
[color=#c0c0c0] [/color][color=#000080]#ifdef[/color][color=#c0c0c0] [/color]Q_WS_X11
[color=#c0c0c0] [/color]XFlush[color=#000000]([/color]QX11Info[color=#000000]::[/color]display[color=#000000]());[/color]
[color=#c0c0c0] [/color][color=#000080]#endif[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Create[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]SFML[/color][color=#c0c0c0] [/color][color=#008000]window[/color][color=#c0c0c0] [/color][color=#008000]with[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]widget[/color][color=#c0c0c0] [/color][color=#008000]handle[/color]
[color=#c0c0c0] [/color]Create[color=#000000]([/color]winId[color=#000000]());[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Let[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]derived[/color][color=#c0c0c0] [/color][color=#008000]class[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]its[/color][color=#c0c0c0] [/color][color=#008000]specific[/color][color=#c0c0c0] [/color][color=#008000]stuff[/color]
[color=#c0c0c0] [/color]OnInit[color=#000000]();[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Setup[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]timer[/color][color=#c0c0c0] [/color][color=#008000]to[/color][color=#c0c0c0] [/color][color=#008000]trigger[/color][color=#c0c0c0] [/color][color=#008000]a[/color][color=#c0c0c0] [/color][color=#008000]refresh[/color][color=#c0c0c0] [/color][color=#008000]at[/color][color=#c0c0c0] [/color][color=#008000]specified[/color][color=#c0c0c0] [/color][color=#008000]framerate[/color]
[color=#c0c0c0] [/color]connect[color=#000000](&[/color]myTimer[color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]SIGNAL[/color][color=#000000]([/color]timeout[color=#000000]()),[/color][color=#c0c0c0] [/color][color=#808000]this[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]SLOT[/color][color=#000000]([/color]repaint[color=#000000]()));[/color]
[color=#c0c0c0] [/color]myTimer[color=#000000].[/color]start[color=#000000]();[/color]
[color=#c0c0c0] [/color][color=#000000]}[/color]
[color=#c0c0c0] [/color][color=#808000]return[/color][color=#c0c0c0] [/color]QWidget[color=#000000]::[/color]event[color=#000000]([/color][color=#000000]Event[/color][color=#000000]);[/color]
[color=#000000]}[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]when[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]needs[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]be[/color][color=#c0c0c0] [/color][color=#000080]painted[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]display[/color][color=#c0c0c0] [/color][color=#000080]a[/color][color=#c0c0c0] [/color][color=#000080]new[/color][color=#c0c0c0] [/color][color=#000080]frame[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]void[/color][color=#c0c0c0] [/color]QSFMLCanvas[color=#000000]::[/color]paintEvent[color=#000000]([/color]QPaintEvent[color=#000000]*)[/color]
[color=#000000]{[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Let[/color][color=#c0c0c0] [/color][color=#008000]the[/color][color=#c0c0c0] [/color][color=#008000]derived[/color][color=#c0c0c0] [/color][color=#008000]class[/color][color=#c0c0c0] [/color][color=#008000]do[/color][color=#c0c0c0] [/color][color=#008000]its[/color][color=#c0c0c0] [/color][color=#008000]specific[/color][color=#c0c0c0] [/color][color=#008000]stuff[/color]
[color=#c0c0c0] [/color]OnUpdate[color=#000000]();[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Display[/color][color=#c0c0c0] [/color][color=#008000]on[/color][color=#c0c0c0] [/color][color=#008000]screen[/color]
[color=#c0c0c0] [/color]Display[color=#000000]();[/color]
[color=#000000]}[/color]
[/code]



QSFMLCanvas.hpp
[code]
[color=#000080]#ifndef[/color][color=#c0c0c0] [/color]QSFMLCANVAS_HPP
[color=#000080]#define[/color][color=#c0c0c0] [/color]QSFMLCANVAS_HPP
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Headers[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<SFML/Graphics.hpp>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QWidget>[/color]
[color=#000080]#include[/color][color=#c0c0c0] [/color][color=#008000]<QTimer>[/color]
[color=#808000]class[/color][color=#c0c0c0] [/color][color=#800080]QEvent[/color][color=#000000];[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas[/color][color=#c0c0c0] [/color][color=#000080]allows[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]run[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]in[/color][color=#c0c0c0] [/color][color=#000080]a[/color][color=#c0c0c0] [/color][color=#000080]Qt[/color][color=#c0c0c0] [/color][color=#000080]control[/color]
[color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#808000]class[/color][color=#c0c0c0] [/color][color=#800080]QSFMLCanvas[/color][color=#c0c0c0] [/color][color=#000000]:[/color][color=#c0c0c0] [/color][color=#808000]public[/color][color=#c0c0c0] [/color][color=#800080]QWidget[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]public[/color][color=#c0c0c0] [/color][color=#800080]sf[/color][color=#000000]::[/color][color=#800080]RenderWindow[/color]
[color=#000000]{[/color]
[color=#808000]public[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Construct[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]QSFMLCanvas[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\param[/color][color=#c0c0c0] [/color][color=#000080]Size[/color][color=#c0c0c0] [/color][color=#000080]:[/color][color=#c0c0c0] [/color][color=#000080]Initial[/color][color=#c0c0c0] [/color][color=#000080]size[/color][color=#c0c0c0] [/color][color=#000080]of[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\param[/color][color=#c0c0c0] [/color][color=#000080]FrameTime[/color][color=#c0c0c0] [/color][color=#000080]:[/color][color=#c0c0c0] [/color][color=#000080]Frame[/color][color=#c0c0c0] [/color][color=#000080]duration,[/color][color=#c0c0c0] [/color][color=#000080]in[/color][color=#c0c0c0] [/color][color=#000080]milliseconds[/color][color=#c0c0c0] [/color][color=#000080](0[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]default)[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#0000ff]\param[/color][color=#c0c0c0] [/color][color=#000080]Parent[/color][color=#c0c0c0] [/color][color=#000080]:[/color][color=#c0c0c0] [/color][color=#000080]Parent[/color][color=#c0c0c0] [/color][color=#000080]of[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080](NULL[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]default)[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#800080]QSFMLCanvas[/color][color=#000000]([/color][color=#808000]const[/color][color=#c0c0c0] [/color][color=#800080]QSize[/color][color=#000000]&[/color][color=#c0c0c0] [/color]Size[color=#000000],[/color][color=#c0c0c0] [/color][color=#808000]unsigned[/color][color=#c0c0c0] [/color][color=#808000]int[/color][color=#c0c0c0] [/color]FrameTime[color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color][color=#000080]0[/color][color=#000000],[/color][color=#c0c0c0] [/color][color=#800080]QWidget[/color][color=#000000]*[/color][color=#c0c0c0] [/color]Parent[color=#c0c0c0] [/color][color=#000000]=[/color][color=#c0c0c0] [/color]NULL[color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Destructor[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#000000]~[/color][color=#000000][i]QSFMLCanvas[/i][/color][color=#000000]();[/color]
[color=#808000]private[/color][color=#c0c0c0] [/color][color=#000000]:[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]initializations[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnInit[/i][/color][color=#000000]();[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Notification[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]derived[/color][color=#c0c0c0] [/color][color=#000080]class[/color][color=#c0c0c0] [/color][color=#000080]that[/color][color=#c0c0c0] [/color][color=#000080]moment[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]good[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]for[/color][color=#c0c0c0] [/color][color=#000080]doing[/color][color=#c0c0c0] [/color][color=#000080]its[/color][color=#c0c0c0] [/color][color=#000080]update[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]drawing[/color][color=#c0c0c0] [/color][color=#000080]stuff[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]OnUpdate[/i][/color][color=#000000]();[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Return[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]paint[/color][color=#c0c0c0] [/color][color=#000080]engine[/color][color=#c0c0c0] [/color][color=#000080]used[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]draw[/color][color=#c0c0c0] [/color][color=#000080]itself[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#800080]QPaintEngine[/color][color=#000000]*[/color][color=#c0c0c0] [/color][color=#000000][i]paintEngine[/i][/color][color=#000000]()[/color][color=#c0c0c0] [/color][color=#808000]const[/color][color=#000000];[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]each[/color][color=#c0c0c0] [/color][color=#000080]time[/color][color=#c0c0c0] [/color][color=#000080]an[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]is[/color][color=#c0c0c0] [/color][color=#000080]received[/color][color=#c0c0c0] [/color][color=#000080]by[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]catch[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]Polish[/color][color=#c0c0c0] [/color][color=#000080]event[/color][color=#c0c0c0] [/color][color=#000080]and[/color][color=#c0c0c0] [/color][color=#000080]initialize[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]our[/color][color=#c0c0c0] [/color][color=#000080]SFML[/color][color=#c0c0c0] [/color][color=#000080]window[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]bool[/color][color=#c0c0c0] [/color][color=#000000][i]event[/i][/color][color=#000000]([/color][color=#800080]QEvent[/color][color=#000000]*[/color][color=#c0c0c0] [/color]Event[color=#000000]);[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]Called[/color][color=#c0c0c0] [/color][color=#000080]when[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]widget[/color][color=#c0c0c0] [/color][color=#000080]needs[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]be[/color][color=#c0c0c0] [/color][color=#000080]painted[/color][color=#c0c0c0] [/color][color=#000080];[/color]
[color=#c0c0c0] [/color][color=#000080]///[/color][color=#c0c0c0] [/color][color=#000080]we[/color][color=#c0c0c0] [/color][color=#000080]use[/color][color=#c0c0c0] [/color][color=#000080]it[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]display[/color][color=#c0c0c0] [/color][color=#000080]a[/color][color=#c0c0c0] [/color][color=#000080]new[/color][color=#c0c0c0] [/color][color=#000080]frame[/color]
[color=#c0c0c0] [/color][color=#008000]///[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#808000]virtual[/color][color=#c0c0c0] [/color][color=#808000]void[/color][color=#c0c0c0] [/color][color=#000000][i]paintEvent[/i][/color][color=#000000]([/color][color=#800080]QPaintEvent[/color][color=#000000]*);[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]Member[/color][color=#c0c0c0] [/color][color=#008000]data[/color]
[color=#c0c0c0] [/color][color=#008000]////////////////////////////////////////////////////////////[/color]
[color=#c0c0c0] [/color][color=#800080]QTimer[/color][color=#c0c0c0] [/color][color=#800000]myTimer[/color][color=#000000];[/color][color=#c0c0c0] [/color][color=#000080]///<[/color][color=#c0c0c0] [/color][color=#000080]Timer[/color][color=#c0c0c0] [/color][color=#000080]used[/color][color=#c0c0c0] [/color][color=#000080]to[/color][color=#c0c0c0] [/color][color=#000080]update[/color][color=#c0c0c0] [/color][color=#000080]the[/color][color=#c0c0c0] [/color][color=#000080]view[/color]
[color=#000000]};[/color]
[color=#000080]#endif[/color][color=#c0c0c0] [/color][color=#008000]//[/color][color=#c0c0c0] [/color][color=#008000]QSFMLCANVAS_HPP[/color]
[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this