Hi, I'm wondering does QT Team afford
Qt Upgrade repository for Ubuntu 10.04 Lucid?
Current Ubuntu 10.04 affords qt 4.6.2, I'd love to try 4.6.3.
Cheers
JIA
Printable View
Hi, I'm wondering does QT Team afford
Qt Upgrade repository for Ubuntu 10.04 Lucid?
Current Ubuntu 10.04 affords qt 4.6.2, I'd love to try 4.6.3.
Cheers
JIA
Thanks for you prompt reply.
But Qt 4.6.2 seems not to be a stable release at all.
And, you can see from http://qt.nokia.com/downloads/
Qt4.6.3 is the most stable release now, rather than 4.6.2 .
Please refer to my question posted at
http://www.qtcentre.org/threads/3148...ate()-repaint()
and the reply from amoswood is
Quote:
I have had some weird GUI issues with 4.6.2 myself. I recently upgraded to 4.6.3 which came out the other day. It seemed to fix all of the weird GUI issues. I would recommend upgrading.
However, my current problem is if removing all staffs related to current default qt4.6.2, some applications will be removed meanwhile. That's not what I want to face.
Cheers
JIA
Your using Linux, so therefore theres a high chance you have an option of upgrading Qt without uninstalling anything.
Secondly, if you can't find the latest Qt in a package format suitable for your distro you can always download the source and compile it.
Well... having "some weird GUI issues" doesn't mean you are having the same problem. From what I see in the other thread you are making a classical error of setting some flag, doing some drawing based on its value and clearing it in the paint event and expecting it to work. Ask yourself this question: what happens if paintEvent() is called twice (i.e. for different regions) after setting the flag? Or this one: what if you cause a paint event by doing anything else than calling putImage(), i.e. by scrolling the view, modifying the scene in any way or simply moving another window over the view? Qt 4.6.3 won't help you in any way here... the bug is in your code and not in Qt.
Edit: one more thing - a graphics view is composed from two widgets - the view itself and the viewport. And all your items are on the viewport. Updating the view will not necessarily cause an update of the viewport.
Thank you.
But, would you please help to clarify "without uninstalling anything"
Do you mean I can download the source and build the source and copy every built .so files to overwrite those .so installed from Ubuntu repository?
Finally, I found the code at ftp://ftp.trolltech.com/qt/source/
Thank you very much.
Best Regards
JIA
Hi, wysota:
Thank you so much for pointing out the error in my code. But, it's strange that this worked for me in Qt 4.5.2 .
I was hoping paintEvent() should be triggered whenever I call
, but it's not the case.Code:
"this->update();"
I'm wondering if you can help to have a look of this .ogv video file.http://www.visionopen.com/qgraphicsview_paintevent.ogv
You may notice that paintEvent() was called just once, at the very beginning of this application.
It has never been triggered again.
Can you please help to figure out
why for the class QGraphicsView, update() is not able to trigger paintEvent() ?
No matter how I rebuilt the whole program, even the entire workspace,
the breakpoints in paintEvent() never worked.
Best Regards
JIA Pei
That's correct. It's not and has never been the case.
Probably because it's the viewport that changes so there is no point in redrawing the view. Or the other way round - remember paintEvent() is called for the viewport here.Quote:
You may notice that paintEvent() was called just once, at the very beginning of this application.
It has never been triggered again.
Things become more weird now.
Please refer to this video http://www.visionopen.com/qgraphicsview_paintevent2.ogv
Now, after I changed my code a little bit to
Code:
this->m_QTGraphicsScene->invalidate(); this->repaint();
repaint() now is able to trigger paintEvent() as you can see from the above video file.
However, no matter it's
in function paintEvent(),
I'm not able to display what has been drawn on the screen.
The processed image have been successfully stored, but it just didn't show up on the screen.
By the way, I guess why now paintEvent() was successfully triggered by
is just because I overwrote all qt 4.6.2 related .so files, and reconstruct the symbolic links to qt 4.6.3 .so files.Code:
this->repaint() ; // which was supposed to have the same functionality with this->update();
We may neglect whether this is a qt 4.6.2 or qt 4.6.3 issue first.
But, as you may noticed from the video of this time,
paintEvent() is now successfully called whenever a new image is loaded (for processing),
but paintEvent() just didn't really draw the image on the screen.
Can you please help?
Cheers
JIA
Now, I'm even able to Save the QImage out, and I can see the saving is absolutely correct.
That is to say, I'm now very sure paintEvent causes this problem.
After staring at the GUI application for quite a while, I found something interesting.
It looks like paintEvent() did draw !!! But draw to a wrong position.
Not quite sure, but see the attached two .png pictures.
Images removed
Pay attention to the very top left corner, there is little rectangle which has exactly the same color of my loaded image's background.
Did you see?
What could be the problem??
Cheers
JIA
The problem is in your code. You can be chasing ghosts all the time or you can just correct your code and forget about the problem. Your code is clearly incorrect. You lack understanding of how Graphics View and Qt's painting works but you keep pushing pretending you do understand it. The paint event of the viewport is not called because the scene doesn't change and Qt takes the rendering of the viewport from the backing store. If you invalidate the whole scene then contents of the backing store is marked dirty and the viewport is repainted using your event because Qt thinks there are some changes in the scene.
repaint() and update() have different functionality - the first performs an immediate redraw, the other schedules one. A practical example:
will cause the paint event to be executed twice andCode:
repaint(); repaint();
will cause the paint event to be executed once.Code:
update(); update();
Hi, my compilation configuration is
Code:
./configure -v -prefix /usr -debug-and-release -phonon -phonon-backend -declarative
and the configuration output contains quite a lot of error messages
Quote:
floatmath.cpp:44: warning: unused parameter ‘argc’
floatmath.cpp:44: warning: unused parameter ‘argv’
libjpeg.cpp: In function ‘int main(int, char**)’:
libjpeg.cpp:51: warning: ‘cinfo’ is used uninitialized in this function
db2.cpp:42:20: error: sqlcli.h: No such file or directory
db2.cpp:43:21: error: sqlcli1.h: No such file or directory
make: *** [db2.o] Error 1
ibase.cpp:42:19: error: ibase.h: No such file or directory
make: *** [ibase.o] Error 1
oci.cpp:42:17: error: oci.h: No such file or directory
make: *** [oci.o] Error 1
tds.cpp:42:22: error: sybfront.h: No such file or directory
tds.cpp:43:19: error: sybdb.h: No such file or directory
make: *** [tds.o] Error 1
egl.cpp:42:21: error: EGL/egl.h: No such file or directory
egl.cpp: In function ‘int main(int, char**)’:
egl.cpp:46: error: ‘EGLint’ was not declared in this scope
egl.cpp:46: error: expected ‘;’ before ‘x’
egl.cpp:47: error: ‘EGLDisplay’ was not declared in this scope
egl.cpp:47: error: expected ‘;’ before ‘dpy’
egl.cpp:48: error: ‘EGLContext’ was not declared in this scope
egl.cpp:48: error: expected ‘;’ before ‘ctx’
egl.cpp:49: error: ‘dpy’ was not declared in this scope
egl.cpp:49: error: ‘ctx’ was not declared in this scope
egl.cpp:49: error: ‘eglDestroyContext’ was not declared in this scope
make: *** [egl.o] Error 1
egl4gles1.cpp:42:22: error: GLES/egl.h: No such file or directory
egl4gles1.cpp: In function ‘int main(int, char**)’:
egl4gles1.cpp:46: error: ‘EGLint’ was not declared in this scope
egl4gles1.cpp:46: error: expected ‘;’ before ‘x’
egl4gles1.cpp:47: error: ‘EGLDisplay’ was not declared in this scope
egl4gles1.cpp:47: error: expected ‘;’ before ‘dpy’
egl4gles1.cpp:48: error: ‘EGLContext’ was not declared in this scope
egl4gles1.cpp:48: error: expected ‘;’ before ‘ctx’
egl4gles1.cpp:49: error: ‘dpy’ was not declared in this scope
egl4gles1.cpp:49: error: ‘ctx’ was not declared in this scope
egl4gles1.cpp:49: error: ‘eglDestroyContext’ was not declared in this scope
make: *** [egl4gles1.o] Error 1
glib.cpp: In function ‘int main(int, char**)’:
glib.cpp:55: warning: ‘pollfd’ is used uninitialized in this function
gstreamer.cpp:53: warning: unused parameter ‘argc’
gstreamer.cpp:53: warning: unused parameter ‘argv’
xsync.cpp: In function ‘int main(int, char**)’:
xsync.cpp:51: warning: statement has no effect
xsync.cpp:52: warning: statement has no effect
xsync.cpp:50: warning: unused variable ‘value’
stltest.cpp: In function ‘int main()’:
stltest.cpp:145: warning: unused variable ‘n’
alsatest.cpp:47: warning: unused parameter ‘argc’
alsatest.cpp:47: warning: unused parameter ‘argv’
Among all the above error messages,
what is OpenVG? It's right here http://www.khronos.org/openvg/
but, do I need to install something?
or, how can I activate it?
Looking forward to your detailed explanation.
Thank you very much in advance.
Best Regards
JIA
wysota:
You might be correct. I seriously have no idea how Qt's painting works. I dropped the question just to find the correct solution.
You gave so much explanation but only without a solution.
I'm wondering if you can afford me a direct solution, for example, affording an inherited class
and the demo code, which is really able to successfully display an QImage .
By the way, I didn't pretend to do anything.
If I pretend to be like that, I will never drop questions.
The reason why I drop the question is just to let the whole world to know I'm not familiar with that,
and I beg a solution sincerely.
So, can you please help?
All kinds of blame is of no use, compared to giving out a solution.
Seriously hope you can give me a hand, by a solution to demonstrate you can do it.
Looking forward to your solution.
Best Regards
JIA
I have no idea what you are doing so I can't give you a solution.
If you want to display an image on Graphics View then either add it as an item to the scene or set it as the background brush of the scene (or reimplement drawBackground() if you need something more complex).
Hi, wysota:
I just want to show up an image using QGraphicsView widget.
As you can see from here
http://www.morethantechnical.com/200...ting-qwidgets/
This guy successfully display something out by using
andCode:
this->update();
Code:
... }
He finally draw QImage m_i out at the position
"QPoint(ui.frame->x(),ui.frame->y()" .
Why he succeeded in doing this?
BTW, I promise this website is not owned by me and we are absolutely different developers.
So, according to your opinion, both of us succeeded in doing this but both of us are wrong, right?
I believe you can realize your correct solution and demonstrate it now, just based upon the full code at
http://www.morethantechnical.com/200...ting-qwidgets/
Seriously hope you can give me a hand. Could be useful for that guy as well.
Cheers
JIA
"This guy" is not using graphics view.
Hi, so, do you mean that
if I inherit my class from QWidget, namely,
revise
to
I should be able to make my code work, right??
Thanks for your suggestion.
And, could you please help to explain why QGraphicsView is not work?
Because QGraphicsView is just a type of QWidget.
Refer to the official documentation:
http://doc.qt.nokia.com/4.6/qgraphicsview.html
QGraphicsView<-QAbstractScrollArea<-QFrame<-QWidget.
Best Regards
JIA
Yes.
Because it's much more complex than a simple QWidget and it works in a different fashion.Quote:
And, could you please help to explain why QGraphicsView is not work?
If you are so smart then why are you asking the questions and why is your code failing to work?Quote:
Because QGraphicsView is just a type of QWidget.
Refer to the official documentation:
http://doc.qt.nokia.com/4.6/qgraphicsview.html
QGraphicsView<-QAbstractScrollArea<-QFrame<-QWidget.
BTW. you fail to see the difference between "subclass of" and "type of".
Please just set the background brush for your scene as I told you if you want an immediate effect and then devote some time to study the documentation of graphics view architecture.
I love you man !! hehe...
Yes, you are right.
Have to change the scene, instead of the view !
Still not quite understand the whole theory at the back, but it works now.
I'm using
after I reload a new image !Code:
this->m_QTGraphicsScene->clear(); this->update();
And it seems I don't need to overload paintEvent() now.
Not quite sure whether this is the right solution, but this works for me.
The reason why I didn't want to use "addPixmap"
is because it has to do a conversion from QImage to QPixmap,
which I had guessed would slow down the process speed.
Thanks wysota.
Cheers
JIA