problem while sorting a datamodel

Hello guys,.

I declared and initialized my QListDataModel

bb::cascades::QListDataModel* m_model;

and I am trying to sort as follows:

void ClassName::sortByPriceLowToHigh()
{
    int selected;
        for(int i=0;isize()-1;i++)
        {
            selected=i;
            for(int j=i+1;jsize();j++)
            {
                if(/*condition according to ASC or DESC*/)
                {
                    selected=j;
                }
            }
            if(selected!=i)
            {
                m_model->swap(i,selected);
            }

        }
}

on paper, this code works fine.

but when I run it swaps the m_model in the first iteration of i's for loop, but in the second iteration the values remain the same as it was at the beginning of the i's forloop...

can someone tell me where I am doing wrong?

Sorry guys, that was my mistake in the buisness that logical... code above works fine.

Sorry

Tags: BlackBerry Developers

Similar Questions

  • I have no sound watching videos with firefox but no problem while using internet explore

    I have been using mozilla firefox on my laptop for a long time.recently I've upgraded to the new version of mozilla firefox 7. yesterday, I m facing problems while watching videos. I have no sound with videos using mozilla firefox but I have no problem with sound when using internet explorer.kindly solve the problem with my firefox.

    See also:

    You can click on the Volume icon in the Windows taskbar near the clock and click on the link to mix down to open the mixing console.

    You can adjust the volume level for each application in this window, so make sure that Firefox is not set to mute or set at a low level.

    The current versions of Firefox using the process of plugin-container to run plugins, check the volume control for the process of plugin-container.

    You will see the program Firefox or the Plugin Container in the mixer if you are on a website that plays sound.

  • No matter what I try to play, I get this message, "Windows Media Player has encountered a problem while playing the file." And the media player does not work

    Windows Media Player

    No matter what I try to play, I get this message, "Windows Media Player has encountered a problem while playing the file."  And the media player does not work

    Reset the WMP.

    Step by step instructions are given here: -.

    http://www.mydigitallife.info/how-to-uninstall-and-re-install-Windows-Media-Player-12-WMP12-in-Windows-7/

  • Windows Media Player encountered a problem while playing the file. (MPEG)

    Windows Media Player encountered a problem while playing the file. (MPEG)

    Don't know why Windows Media Player does not accept your mpeg.

    Just a suggestion:

    Use a video converter and change your mpeg to wmv format and read it.

    If you don't have a video converter, google for a free Converter. No need to buy a.

    You can also install VLC media player.
    It's free.
    He plays almost all kinds of formats.
    It is widely used and recommended.

    If you are interested, here is the link:

    http://www.videolan.org/VLC/

  • Having problem while playing a game of Wow

    Original title: other for microsoft to scan my computer and find an im problems?

    started to have problems while playing a game of wow. starts fine then cant get in my articles, press Esc. but do not go to the minamizes inter face just, if I got to the laptop will not let me type anything

    Hi James,

     

    1. have you done any recent hardware or software changes to the computer before the show?

    2. What is the number of brand and model of the computer?

    Please follow the link and check with the question:

    Game hangs or quits unexpectedly:

    http://support.Microsoft.com/kb/303032

    Note: Also applies to non-Microsoft games.

    Important note: You must follow step 7 of the article mentioned above to recover the computer to Normal startup after you complete all the steps.

    The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    I hope this helps.

  • Windows Media Player does not. I get the message "Windows Media Player encountered a problem while playing the file. For any additional help click web help. »

    Original title: Windows Media Player does not

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    I have Windows XP Professional and have tried playing the CD through Windows Media Player. I get the message "Windows Media Player encountered a problem while playing the file. For any additional help click web help. "Then I do. Nothing here helps me. The player shows all my music but puts little red x showing that he can't play. Help! I downloaded version 11 of Windows Media Player, but it is saying the same thing.

    Thank you.

    Hello

    1. don't you also get an error with the message code?
    2 have you installed third-party readers part?
    3. What is the format of the files you are trying to play?

    Follow these steps and check if they help.

    Step 1:

    I would have you readers of third party temporarily Uninstall and check if persists it to the question.

    Step 2:

    Most likely you need codecs to play these files with Windows Media Player. I suggest looking up codec in the Internet that supports the file format, download and install them.

    See also:

    Player Windows Media for Windows XP supported Codecs

    WARNING OF THIRD PARTY
    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    See also:

    Windows Media Player Error Message help

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • I am facing problem while seraching & folders inside my computer files.

    I am facing problem while seraching & folders inside my computer files. I have always marked the option "Show hidden files & folders" before I start looking for, but it's automaticaliy turn unmarked & I can't seem to find the hidden files & folders. I use XP Service Pack 3.

    Some infections of virus and spyware uncheck the option "Show hidden files & folders" to keep you from finding their files.

    Update your antivirus program and run a full scan.

    Download, install and run the Microsoft Windows Malicious Software Removal Tool scans and Malwarebytes' Anti-Malware .

  • Error when you try to play multimedia files: Windows Media Player has encountered a problem while playing the file. For any additional help, click Help on the Web

    ERROR: Windows Media Player encountered a problem while playing the file. For any additional help, click Help on the Web.

    I get the error Windows Media Player 11.0.6001.7007.  "Windows Media Player encountered a problem while playing the file. For any additional help, click Help on the Web frequently. "What happens on the music or video files even those I had on my PC for a long time.  They work some days and other days they don't.  I have to reboot to clear it and it's really annoying. I can read a file and then 10 minutes later the same file will not play.  Sometimes after the error message, if I don't click Close, the video is not yet but the audio will not.

    I'm on a laptop HP DV5 with vista 32-bit and 4 GB memory such that shipped HP (Yes, 4 concerts and 32-bit).

    I don't know if it was related, but IE7 would continually fail to open, click on through the windows and should be completely closed.  essentially the WMV and IE are fails miserably on this laptop, and it was only 6 months old.  Firefox fixes my problem of browser.

    How can I fix this WMV as I can't UN/reinstall with Vista?

    I ran sfc/scannow after completion of the analysis, the results were that "windows resource protection finds corrupted but files could not solve some of them" gives then refers to where the cbs.log file is located. I tried to open the cbs log, and he says that access is denied.

    UPDATE: there seems to be a conflict between WMP and any other application that opens which can play the video with sound.  When I close firefox, and then the videos and sound can play (these same questions happened on IE7 and firefox was installed just yesterday).  I met the same problem with more than Pinnacle video editing software.  Is it possible to change a parameter with WMP as there is no sharing violation during a different application can play the video?

    SO thanks a lot!    I had to use the following steps to get your simple solution:

    1. Select Options under the button 'SYNC '.

    2. choose 'other Options '.

    3. click on the tab 'network '.

    4. only check box RTSP/TCP and HTTP and Multicast Streams allow the player Pourrecevoirun multicast stream (which meant I had to uncheck "RSTP/UDP"

    5. click on apply and take advantage of my windows media player.

    Thanks a lot wmd_user!

  • Error when you try to play .wmv files: Windows Media Player has encountered a problem while playing the file. For any additional help, click Help on the Web

    Will not play WMV video files

    I'm having a problem to play wmv. video files.  I have windows vista.  I can play music in Windows Media Player, but can not play any video, that is sent to me by e-mail.  WMP crashes and give a message saying that Windows Media Player has encountered a problem while playing the file. For any additional help, click Help on the Web.  I click web help and receive nothing.  The drivers are up to date.  Why I can't play videos? Thank you

    Hello Henry Michael,.

    Please relay the e-mail program you use.  You can also try to save the file directly on your local computer, and then check if the file is being read correctly. If there has been any recent codec package installation, you can also try to temporarily uninstall the codec package and then check out the question.

    Thank you

  • YouTube still problem while playing

    YouTube always problems playing and try again later.
    So I need to reboot to play youtube normally.
    And get can play.
    Another time I open youtube anda you have problem while playing again.

    That's happened?
    So sad sony product.
    First, I use sony product.
    If I don't know, ofcouse I won't use any sony product.

    @Emyherwin

    Welcome to the community. You have a problem with the YouTube app, which is a product of Google. You do not have Sony to blame for this, but we can try to fix first than the app:

    Go to settings--> Apps--> YouTube-> erase data, updates to uninstall and reboot your phone

    Go to the game store and update your YouTube app, then try if the problem persists.

  • Error reading of disks: Windows Media Player has encountered a problem while playing the file

    Im having a prob. with my Media Player, everthing was working fine until about 15/04/2010.

    Im having a prob. with my media player from vista, everthing was working fine until about 15/04/2010. then all I get when I put a disc that worked before the time this message (Windows Media Player encountered a problem while playing the file. For any additional help, click Help on the Web.)

    any thoughts?

    Hello SUNCITYDAVIS,

    ·         Remember to make changes to the computer (hardware or software) before having this problem?

    ·         Do you get this error during playback of all media files or any size of file in particular?

    ·         This happens when you play multimedia files stored on your computer as well?

    The error indicates that there could be some missing codecs for the file format, you are trying to play with Media Player.

    You can see the article that will give you information about the codecs:

    http://www.Microsoft.com/windows/windowsmedia/player/FAQ/codec.mspx

    Thank you
    Irfan H, Engineer Support Microsoft Answers. Visit our Microsoft answers feedback Forum and let us know what you think.

  • Windows 7 - Windows Media Player encountered a problem while playing the file.

    WMP worked fine one day and then the other, it will not play any type of file.  I just get the error message "Windows Media Player encountered a problem while playing the file." with each trying to play any type of file.  It won't play video or audio files, even those she played a few days ago.

    Dano_TR: try to use system restore to restore to a point from before the problem started to happen, as I have suggested earlier in this thread.

    In addition, if you have any installed codec Pack, try to remove the. Uninstall iTunes and Quicktime could also help.

    Tim Baets
    http://www.BM-productions.TK

  • I'm attemppting to enter the programming unit to operate on an OUYA. I encounter this problem while fixing my game development environment.

    I'm looking to get into the programming unit and finally run that I develop on an OUYA. I encounter this problem while fixing my game development environment. At http://stevetack.com/ouya_unity_tutorial_01.html, I try to do this step:

    ------------------------------------------------------------------------------------------------------------------------------------

    Pull up the android_winusb.inf file in Notepad or your favorite text editor and add this section to both [Google.NTx86] and [Google.NTamd64] sections:

    ;OUYA Console
    %SingleAdbInterface% = USB_Install, USB\VID_2836&PID_0010
    %CompositeAdbInterface% = USB_Install, USB\VID_2836&PID_0010&MI_01------------------------------------------------------------------------------------------------------------------------------------
    

    He tells me that I can't change this in Notepad! It is of crazy! The truth is that I am God in my own digital universe. I am an administrator and my computer needs to be aware of this fact! This refers to an area of permission that I am not familiar with.

    Help, please.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)

    *
  • Windows Media Player encountered a problem while playing the file when Pinnacle Studio HD 14 is running

    Windows Media Player encountered a problem while reading file he when Pinnacle Studio HD 14 is running

    Hello

    I have Windows 7 Home Premium. I installed Pinnacle Studio 14 ultimate test. When the Pinnacle program works-

    a. when I run a WMV file there is no audio data.

    b. when I rang a MPEG 2 file (720 p, 25 frames per second) OR a file m2t, Windows Media Player is not able to read the file and gives the error: "Windows Media Player has encountered a problem when reading what he gives.

    c. when I close the program Pinnacle all right and WMP reads all of the above files correctly.

    I also recently installed and uninstalled Corel VideoStudio X 3 of the trial. First Adobe Elements 8 trial is also installed on the PC.

    I would be grateful yuour help solve the problem.

    Thank you

    Paresh

    Hello Paresh,

    The Pinnacle program is third party software that is causing the problem to occur. Pinnacle may be in conflict with your music files playing in Windows Media Player, that's why, I suggest you to contact pinnacle and check with them.

    Windows Media Player 12 is probably to use the codecs used by pinnacle, which may be the culprit.

    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • There is no sound in my computer and I also get the error "Windows media player has encountered a problem while playing the file" while trying to play audio in Windows Media Player.

    Original title: what is a possible cause for any audio?

    Whenever I try to play any type of audio file I get the error message "Windows media player has encountered a problem while playing the file." All of my audio is disabled, no notification sound, no in his game. All audio drivers are up to date and when I try to diagnose the problem, he told me that there is no problems found. It also gives me this error message when you try to play video files or listen to internet radio on the media player.

    Hello

    If I understand correctly, you are facing problem with playback of the audio files in Windows Media Player. I would like to know more information on the issue, so that we can help you better.

    1. have you made changes on the computer before this problem?

    2. is it works much earlier?

    Let us try the following methods and check if it works for you.

    Method 1:

    Run the troubleshooter in Windows Media Player.

    Open the troubleshooting Windows Media Player settings Troubleshooter

    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

    Method 2:

    Try to re - register the files associated with Windows Media Player.

    a. Click Start, type 'regsvr32 wmp.dll"without the quotes into the search option and press ENTER.

    b. restart your computer later.

    Also see the following Microsoft to issue his No. article.

    http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-sound-problems

    http://Windows.Microsoft.com/en-us/Windows/no-sound-help#no-sound=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    Please reply with the status of the issue, so that we can better help you.

Maybe you are looking for

  • Transfer the purchases account one iTunes to another.

    I would like to transfer my paid purchases from an old account itunes to another itunes account. I have access to these accounts. I have an iPhone Plus 6 and a MacBook Pro (2015)

  • Complete deck Solitaire

    Downloaded v1.62 full deck Solitaire-three times on Apps Store. Does not work. Then read on Apps that 7.0 is required. Why he let me download newer versions when I run OS 10.6.8? Normally, I would expect a message "cannot use it. Not compatible with

  • Computer won't read DVD / CD

    I put forward to CD/DVD a few minutes... nothing...I go to work, and then on the drive itself...I double click on the drive to open the CD/DVD inside the computer and it ejects the disc saying that I need to insert the disc... What is happening and w

  • HP pavilion 500-023w (installing windows 7 questions)

    I just bouth HP pavilion 500-023w desktop PC recently.  It was pre installed windows 8. I tried to install windows 7. Finally, I installed windows 7 but I need the software drivers for my "HP pavilion 500-023w. I tried to download HP Web sites, but t

  • Page ADR 3.0 white

    APEX 4.2.2 of the secondary databases,installed 3.0 ADR like this:java-jar ords.warjava-jar ords.war static picsdeployed on tomcat 8.GoTo this page: http://host:8080 / ADR /simply display the white page.-----------------------------------------------