Hi
How do display icons on image, when i am moving curser on image..
please suggest me to set icons on image
Thanks
Yuvaraj R
Hi
How do display icons on image, when i am moving curser on image..
please suggest me to set icons on image
Thanks
Yuvaraj R
have a look at QPainter::drawImage or QPainter::drawPixmap.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Hi
Just had gone through that one...
can anybody post the sample code here
Thanks
Yuvaraj R
you should write something like this
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Don't mistake me
How do i run this code
Thanks
yuvaraj
like this
Qt Code:
#include <QtGui> #include <QApplication> int main(int argc, char **argv) { QLabel label; label.setPixmap(pixmap); label.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Hi
Thanks spirit
How can i set the icons ,it si visible only when curser is moving on image
Please suggest me
Thanks
Yuvaraj
R
use code above in mouseMove or keyPressEvent.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
thanks for your reply
can i set actions for label to display that
Dont mistake me, but do you use Qt Assistant ? or see Qt Demos ?
As for your problem, you could use a QToolButtonor QPushButton, and set the icon when mouse is over it. You will need to subclass them, and as spirit said, override the mouse events.
If you are using label, you could make button as a child of label, and show/hide when the user hovers over a given area. For this too, you will need to subclass QLabel
Hi
I can we display the image using push button and tool button
Read documentation for QToolButtonand QPushButton
Hi
Thanks for your reply..
I thing is different...
Initially i am showing one image using
this codethen when i am moving the curser on image , that 4 icons will be displaying on image that time..Qt Code:
To copy to clipboard, switch view to plain text mode
Here i have used the label to display my image ...But label doesn't have mouse over,click event options.
How can i do this
Don't mistake me ,i am a beginner..
Please suggest me
Thanks
Yuvaraj R
set setMouseTracking in true for a label and then process mouseMoveEvent of the label.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
That one problem of mine..
If click the slot options for label ,it is showng only 5 options,,,
like
1) link activated
2) link hy..
3) destroyed
4) destroyed(QObject *)
5)costumcontextmenu required...
I don't get slots like mouseover, clicked like that...
That why i am struggling.....
please suggest me
Thanks
Yuvaraj R
yes, there is no such slot like mouseOver, you have to process QMouseEvent.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
yuvaraj.yadav (21st April 2009)
hi
My code for mouse over event
Qt Code:
bool mouseover() { { QLabel label; label.setPixmap(pixmap); label.show(); } else { return FALSE; } }To copy to clipboard, switch view to plain text mode
But it is not working , i think my problem is in condition....
I have another doubt...
if mouse satisfied the position of image ,how do display the icons on image,
Is it using the push button, tool button. I need that icons should in event...
please suggest me
Thanks
Yuvaraj R
you never reach this code
because return true; is located in a wrong placeQt Code:
... QLabel label; label.setPixmap(pixmap); label.show(); ...To copy to clipboard, switch view to plain text mode
try this
Qt Code:
bool mouseover() { QLabel label; label.setPixmap(pixmap); label.show(); return TRUE; } return FALSE; }To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
But it is giving error in main program
My main program code isQt Code:
#include <QtGui/QApplication> #include "widget.h" int main(int argc, char *argv[]) { Widget w; w.show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
the errors is
E:/Qt Programs/yuvaraj/main.cpp:10: error: expected `}' at end of input
E:/Qt Programs/yuvaraj/main.cpp:10: error: expected unqualified-id at end of input
can you attach your project?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Bookmarks