Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User prajna123's Avatar
    Join Date
    Jan 2008
    Posts
    48
    Dear All,
    I am trying to implement next and previous image display for S60Qt.
    Pevious and next image should be displayed based on the current displayed image.

    Same we have implemented for Qt 3 using designer.
    But how to achieve it for Qt 4.4 for S60 .Could you please suggest on which qt 4.4 classes could be used for this?
    Information on this would be helpful.

  2. #2
    Registered User Sorcery-ltd's Avatar
    Join Date
    Dec 2006
    Posts
    2,280
    Hi,

    What classes did you use in Qt 3? Can't you also do this with the designer for Qt 4.4?

    Mark

  3. #3
    Registered User prajna123's Avatar
    Join Date
    Jan 2008
    Posts
    48
    I am using below code to display next and previous image for Qt 4.4.
    But I am unable to load the image.

    int res;
    QStringList::Iterator it1 = names.begin();
    while( it1 != names.end())
    {
    res= QString::compare(QString(*it1),istr);
    if(res!=0)
    {
    ++it1;
    }

    if(res==0)
    {
    it1++;
    if(it1 == names.end())
    {
    it1=names.begin();
    }
    QMessageBox::information(NULL, "", *it1);
    QPixmap pm(240,320);
    pm.load(*it1);
    istr=QString(*it1);
    break;

    }
    }


    where istr is of QString type which contains the current displayed image, according to which we have to display the next image.
    and
    names is of class QStringList.


    Is the method I am using to load image is correct?Information on this would be helpful.

  4. #4
    Nokia Developer Moderator ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    One can only assume that your strings are in fact file paths. Are they pointing to the correct location? What error do you get and from which API?

  5. #5
    Registered User prajna123's Avatar
    Join Date
    Jan 2008
    Posts
    48
    In the above code I have declared
    names << "c:/Data/Images/Pictures/bg13.png" << "c:/Data/Images/Pictures/butterfly.png" << "c:/Data/Images/Pictures/collidingmice.png"<< "c:/Data/Images/Pictures/dragdroprobot-example.png" << "c:/Data/Images/Pictures/glmda.png";


    the thing is "istr" contains "c:\Data\Images\Pictures\selectedpic.png" and "names" contains "c:/Data/Images/Pictures/bg13.png"

    so in the above code, during compare, slashes differ.(one is forward and one is back slash)
    But, Whn I try gving other slash for "names" it won't take.

    So,it is not executing below lines of code.
    if(res==0)
    {
    it1++;
    if(it1 == names.end())
    {
    it1=names.begin();
    }
    QMessageBox::information(NULL, "", *it1);
    QPixmap pm(240,320);
    pm.load(*it1);
    istr=QString(*it1);
    break;


    How to resolve this problem...Information on this would be helpful.

  6. #6
    Nokia Developer Moderator ltomuta's Avatar
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,335
    Quote Originally Posted by prajna123 View Post
    In the above code I have declared
    names << "c:/Data/Images/Pictures/bg13.png" << "c:/Data/Images/Pictures/butterfly.png" << "c:/Data/Images/Pictures/collidingmice.png"<< "c:/Data/Images/Pictures/dragdroprobot-example.png" << "c:/Data/Images/Pictures/glmda.png";


    the thing is "istr" contains "c:\Data\Images\Pictures\selectedpic.png" and "names" contains "c:/Data/Images/Pictures/bg13.png"

    so in the above code, during compare, slashes differ.(one is forward and one is back slash)
    But, Whn I try gving other slash for "names" it won't take.

    ...
    Who/what won't take it? Use:

    Code:
    names << "c:\\Data\\Images\\Pictures\\bg13.png"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved