PDA

View Full Version : QT creator



tertius
21st June 2010, 08:12
How can i create a pointer with QPIxmap so that it can read images from a folder after passing an index value to it?
Any help would be greatly acknowledged.

aamer4yu
21st June 2010, 08:18
How can i create a pointer with QPIxmap so that it can read images from a folder after passing an index value to it?
Can u elaborate what index means ?

Also go through the Qt Demos.. you will find something useful ( Image Viewer example)

tertius
21st June 2010, 08:28
I have to make an application so that on moving a slider it would pass an index value to graphicsview so that it can display the corresponding image file where images are stored in a directory.How can i make such a pointer that will be auto updated by changing its file location and setting address for pixmap?

aamer4yu
21st June 2010, 08:44
You will have to code yourself..
First mainatin all the image files in the directory in a list..
Set the range of slider based on the size of list..

Now when the slider value changes, fetch the value of slider, fetch the filename with given index from the list, and display the image in graphics view or wherever u want.
Hope making image from filename is not a tough job.. ;)

tertius
21st June 2010, 08:54
could you please tell me how to fetch filename with given index from list? I m stuck at this point.

squidge
21st June 2010, 10:26
Have a look at QList & QVector - store your filenames there.

aamer4yu
21st June 2010, 10:27
If you are using QStringList to store filenames, use list.at(index) .
Please give some time studying classes.

squidge
21st June 2010, 11:41
I'd be suprised if [] isn't overloaded too.