Moving through images in image viewer example
-
wrote on 12 Oct 2013, 11:43 last edited by
Hi everyone.
I am really new to Qt and am still in early learning phase.
I am trying to learn through the documentations given alongwith the software.
Currently I am working in the image viewer example given with the SDK.
I want to add some functions in the program.
So, here’s what I am looking for-
I opened an image in the window. Now I want to move through the folder i.e. create 2 new Acts of previous and next in the view menu. So, can anyone guide me through the task as in tell me step by step and referring to the same example preferably, about how to program the given functions. -
wrote on 13 Oct 2013, 02:51 last edited by
Can anyone help me in anyway?!?
-
Hi,
If you refer the code you can see how they create the Actions and add them to the Menu. Similarly you have to create 2 actions you require and add them to the Menu.
Then connect these two Actions to a slot so that they are called when the actions are triggered.
Now to display the images as per the actions, first get all absolute paths of the images from a folder(Iterate over that folder using QDir) and store it in QStringList and then just access the items ( using QStringList::at(int i) ) of this QStringList as per the Actions performed (i.e increment or decrement i).
Then once you get the current fullpath of the image just display it
Hope this helps.
-
wrote on 13 Oct 2013, 06:05 last edited by
Thanks a lot, I will check this out. (Y) :)
-
wrote on 17 Oct 2013, 05:54 last edited by
Can u please give a pseudo program for this.
5/5