How to view Images
-
I have placed images in QLabel and want to view it larger when I clicks it ......
-
In a new window or resize QLabel?
-
If you want to achieve such things, you have to react on the click, either by sub classing QLabel or by an eventFilter.
If you want to enlarge the label, you can set minimum size etc, otherwise you can create a dialog / top level window or whatever you need there. -
thanks for your reply....Can you please give me a link related to keyPress and mousePressEvent or any example for this....
-
Subclass and override the event handlers. See the QWidget docs for it.
-
can you please give me the link.......
-
"QWidget keyPressEvent":http://doc.qt.nokia.com/4.7/qwidget.html#keyPressEvent
-
Anyway it is always a good starting point to search the documentation
-
Regarding examples: you can download the examples for the book C++ GUI Programming with Qt4, 2nd Edition "here":http://www.informit.com/store/product.aspx?isbn=0132354160. This also can be helpful to learn from practical examples.
-
[quote author="Prajnaranjan Das" date="1292591323"]thanks for your reply....Can you please give me a link related to keyPress and mousePressEvent or any example for this....[/quote]
you can check the scribble example that ships with Qt SDK
also see "this":http://doc.qt.nokia.com/latest/statemachine-rogue-movementtransition-h.html