What is the question?
And if you mean "How do I do it", is not a good question.
Tell us what you have tried,and ask if you have problems.
What is the question?
And if you mean "How do I do it", is not a good question.
Tell us what you have tried,and ask if you have problems.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Ok,
I have tried using QGraphicsView and QGraphicsScene because it has almost every thing i request, keyboard and mouse event...
But, I have trouble with performance so this is why I asked the question,
Is there any other way to do it efficiently?
One more thing...
Is it possible to use QMainWindow (for tool-bars) and inside it have a Qwidget with QGrahicsScene on QGraphicsView (for mouse and key events) ?
Use your GraphicsWidget as teh Center/CentralWidget in QMainWindow and you are done with that.
About being fast, get your hands on OpenGL, it requires some work and the gain will be rather neglegable (diff<0.1ms *guess*) as QGarphicsScene has internally an OpenGL renderer aswell.
I think the main delay comes from Server-Client-Net-Code, not from showing the picture in the UI.
Did you do a test and messure time with a simple QTimer?
Maybe you should try to trigger a simple update() [SLOT] in your GraphicsView/Scene.
And beware: DO NOT COPY IMAGES!! Pass pointers or refernces to functions!!
shiranraviv (30th December 2009)
Thank you very much !!!
1) I will check the client-server transfer speed.
2) If i understand it right, using i have used is a good solution also?
3) I used the QTimer in order to do the refresh but i thought there is a smarter way to do it.
4) Is there enough functionality of positing the QGraphicsView in the main window as a single widget in it?
I wouldn't use Graphics View if all you want is to render images. It should be faster if you do it by subclassing QWidget or setting a pixmap on a QLabel object. Graphics View does some additional transformations that you don't need so it only creates overhead.
to 3) connect the update() slot to a custom signal, which you emit right after you set your image in the QGraphics*
to 2) not bad I'd say, wait for Waysotas answer
to 3) I wanted to point you to QTimer, to actually meassure how much time takes to actually show the pic (maybe 1000x iterations if value is very small)
to 4) It depends on what you need, any QWidget based (or even a QWidget itself) is enough, thisdepends all on your needs
@Waysota: I am not sure which one is faster. OpenGL is hardware accelerated while QLabel will us a software renderer. But you probably know more about that subject so I'll just leave it with that.
Yours sincerely
Bookmarks