×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    48

    Arrow Regarding implementation of next and previous image display in S60Qt 4.4

    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
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Regarding implementation of next and previous image display in S60Qt 4.4

    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
    Join Date
    Jan 2008
    Posts
    48

    Re: Regarding implementation of next and previous image display in S60Qt 4.4

    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
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Regarding implementation of next and previous image display in S60Qt 4.4

    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?
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    48

    Re: Regarding implementation of next and previous image display in S60Qt 4.4

    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
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Regarding implementation of next and previous image display in S60Qt 4.4

    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"
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×