Why my case of the switch does not work?

Hey gang,

I have a switch statement, but it doesn't seem to work.  When the selectedIndex to a drop-down list property changes, the fire of console.log statements, but the currentFlashMode never is updated.

currentFlashMode is 'property variant currentFlashMode' on the element root of navigationPane on another page.  This switch/case is on a secondary page that is pushed.

If I use if/else instead, everything works fine.

for example, it does not:

                   switch (selectedIndex) {                   console.log("entering switch/case for selectedIndex..");
                        case 0:
                            //
                            console.log(" -->App: FlashModeSelector, On");
                            currentFlashMode = 0;
                            break;
                        case 1:
                            //
                            console.log(" -->App: FlashModeSelector, Off");
                            currentFlashMode = 1;
                            break;
                        case 2:
                            //
                            console.log(" -->App: FlashModeSelector, Auto (default)");
                            currentFlashMode = 2;
                            break;
                        case 3:
                            //
                            console.log(" -->App: FlashModeSelector, Light");
                            currentFlashMode = 3;
                            break;
                    }

but this doesn't:

if (selectedIndex == 0) {
                        currentFlashMode = 0;
                        console.log(" ------------>App: in onSelectedIndexChanged, currentFlashMode is : " + currentFlashMode);
                    }
                    if (selectedIndex == 1) {
                        currentFlashMode = 1;
                    }
                    if (selectedIndex == 2) {
                        currentFlashMode = 2;
                    }
                    if (selectedIndex == 3) {
                        currentFlashMode = 3;
                    }

What I'm doing wrong here?

Hello

This is a known bug in Qt 4 (fixed only in Qt 5):

http://supportforums.BlackBerry.com/T5/native-development/strange-switch-behaviour-in-QML/m-p/228142...

Only the first line of each statement 'case' is executed. QT has incorrectly transformed the second statement back.

Workaround: wrap each case in {} or use instead if/else.

More info about Qt bug tracker:

https://bugreports.Qt-project.org/browse/QTBUG-17012

Tags: BlackBerry Developers

Similar Questions

  • My Pavilion g does not start. The switch does not work. Any ideas how to start the computer?

    My laptop series HP Pavilion G7-1135sd will not start. I get no response from the switch. Some lights come but the display does not illuminate. I tried holding down the power switch for long periods - without success. I tried to take out the battery - also without success. Any ideas?

    Hi @DutchyH,

    Welcome to the Forum.  Sorry to hear of your problem power button on your HP Pavilion g7-1135sd.

    In a situation like this.  You have removed the battery and tried to push the power button with out.

    Have you tried while he was not powered as well.  So basically, remove the battery and hold the power button for 40 seconds with the power cord not plugged in.  Then replace the battery followed by power cord.  Then press the power button again.  If it does not at this stage I would contact HP support by phone.

    Please contact our technical support at the 800-474-6836. If you do not live in the United States / Canada region, please click the link below to get help from your region number.

    Telephone support for other regions.

    I hope this has helped you.

    Thanks again for posting and have a great day.

  • ENVY 15 t-j000 quad edition cto: outputs audio switching does not work in windows 10 birthday when the headset is connected

    Hi guys.

    As you know in 10 anniversary update windows, you can switch between outputs sound when the headphone is plugged directly from the sound icon in the taskbar, but it does not work as it should. If the headset is unplugged then the sound comes from the speakers and they are plugged in when the noise is coming from the headset and I can't select speakers. It shows two devices, but when I select one of them the speakers are selected. Also I tried to playback devices, but still, I can't put the headset as default playback device. She is forced to be like the only communication device. I've updated the audio driver but nothing has not improved. My audio driver is codec IDT high-definition. In addition, I tried the generic driver from the sound of microsoft, which is called "codec high definition audio" and it shows a device like speaker and it doesn't detect any helmet or communication device. So, what's the problem? I am able to use this option of windows 10 birthday or not? If yes how? I need this option because I use a headset a lot and I don't want to plug them each time. Thank you for your attention. I can give additional information if it is needed and I'm hear to help.

    Hi David,

    If you remember, I had problem with the IDT driver after upgrade to windows 10 and other updates. I'll be back to tell you good news. Finally, I solved the problem partially and I'll explain what I did.

    Today, I found that there is some audio drivers in the microsoft catalog site, so I went out there and looked for a codec high definition audio. A list came and saw that there are three tempo IDT Audio driver that are compatible with windows 10. They are all IDT Audio driver version 6.10.6504.0 and they are made in 2015. I downloaded all the drivers of three and tested. The first two of them does not solve my problem but the last which is "Tempo driver update for codec IDT high-definition" made in 08/05/2015 with 13.1 MB did the job. I must mention that you need to install this driver on generic windows sound driver for good results. If you install hp IDT drivers probably do not get good results. After installing this driver now I am able to switch between outputs audio (headphones and loudspeakers). The driver can detect my headset exactly as what it is. He shows me an output until I plug in my headphones and it then adds another exit in the helmet. I put my headphones or internal speakers as default playback device which I couldn't do with other drivers. There are just two problems that does not matter much to me, and I can't ignore them. The first is the light of the button mute on the keyboard does not work with this driver which is not very important, and the second is that there is no Equalization of beats in this driver and instead there is an audio driver IDT, which is very similar to the equalizer, but it beats not affect only the internal speakers the headphones that is more important to me because the sound via the headphones is very clear and good. If there was some ablity to HP to change this driver and add audio beats and allow also the light on the button mute then it would be perfect. The link for this driver is here:

    Driver IDT tempo for windows 10 and put on subsequent day

    Just download the latest driver with 13.1 MB size and enjoy.

  • Why an amplification of the RAM does not change the index performnance of windows vista?

    Why an amplification of the RAM does not change the index performnance of windows Vista?

    Hello

    I m not very well, but maybe you have more than 3 GB of RAM and Vista 32 bit.
    Usually the 32 bit OS is capable to manage and send only 3.2 GB.
    The more than 3.2 GB RAM will not operating system used and therefore would not increase the index
    In addition the laptop will be not really faster after upgrading RAM. You will notice better performance using applications at the same time, but this does not affect the index of Vista.
    But this is only my personal hypothesis.

    Welcome them

  • I put a new ink jet cartridge in the printer and the printer does not work although it is switched on

    Cartridge replacement installed on a lexmark 730 printer inkjet series all the cables and connections ok but the printer does not work

    Hello

    as the poblem started when you changed the ink cartridge contact Lexmark

    http://support.Lexmark.com/index?page=home&channel=supportAndDownloads&locale=en&UserLocale=en_AU

  • Tecra S1: Rf Ubuntu wireless switch does not work

    Hi all

    I recently bought an Intel mini-PCI wifi card for my Tecra S1 under Ubuntu. It is detected without any problem, Intel provides even native drivers for Linux. However, the hardware to activate wireless switch does NOT work. According to iwconfig, the radio is off. I use the ipw2200 driver which can detect the hardware and the software rf_kill. I can enable and disable software killing RF, but kill him material stays on.

    I suspect that the radio feature is disabled in the BIOS but I don't have Windows running on the laptop over to change the setting. Is it possible to access BIOS options under linux? Toshutils are not supported by the tecra because she seems to have a Phoenix BIOS.

    I hope you can help!

    Edwin...

    Hello

    Tecra S1 supports BIOS Toshiba you can access BIOS by pressing ESC at the beginning of the startup.
    In any case I think you won't find anything in the BIOS.

    If you are not able to use the switch of material on the side of the laptop then the Wlan card is not compatible or the hardware switch is malfunctioning. I would say that the card is not supported.

    Maybe the insulation of the 13 pin might help please check that this son:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=19843&MessageID=74074
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=15228&MessageID=56522

  • I can't select or copy text on Firefox for Android 26.0.1 (device: Samsung Galaxy Note 2) OS: Android 4.3. Long press on the text does not work. )

    Can't select or copy text on Firefox for Android 26.0.1.
    Device: Samsung Galaxy 2 Note.
    OS: Android 4.3.
    Long press on the text does not work.

    I would ask someone to check that...

    I'm glad to hear that your problem has been resolved by using the beta version.

    If you have not already the case, please mark this thread as solved by the solution of marking.

    This will help other users experience similar problems helps to find faster and more efficiently.

    I hope that you will continue using our products and we thank you for contacting the Mozilla Support.

  • using firefox 24, yahoo toolbar disappears and the keyboard does not work on some websites

    We have installed firefox 24, yahoo toolbar sometimes disappears. On some web site when trying to enter a password, the keyboard does not work until you double click of the mouse on the registration form. This on two different systems of windows 7. Each thin seemed to work fine before the update prior to the installation of 24.

    Hello

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • Under Windows, you can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac, you can open Firefox 4.0 + in Safe Mode holding the key option key when starting Firefox.
    • Under Linux, you can open Firefox 4.0 + with leaving Firefox then go to your Terminal and running Safe Mode: firefox-safe-mode (you may need to specify the installation path of Firefox for example/usr/lib/firefox)
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    I hope this helps!

    Curtis

  • Shortcuts mouse to "Open the link in a new tab" help "Middle-click on the link" does not work on 10.0.1

    Shortcut of mouse to "Open the link in a new tab" help "Middle-click on the link" does not work on 10.0.1, it worked on version 9.0.1.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • Key on the keyboard does not work in firefox box when you type in the web site, but it works everywhere else?

    Key on the keyboard does not work in firefox box when you type in the web site, but it works everywhere else?

    Try Firefox SafeMode to see how it works there.

    A way of solving problems, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open the mode without failure of Firefox 4.0 + by pressing the SHIFT key when you use the desktop Firefox or shortcut in the start menu.
    • Or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    Do not choose anything at the moment, just use 'continue in safe mode.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox (without the Shift key) to open it again.

    If it's good in Firefox Safe mode, your problem is probably caused by an extension, and you need to understand that one.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

    Can be caused by an add-on to the AVG.

    When find you what is causing that, please let us know. It might help others who have this problem.

  • Satellite X 200-219 - the touchpad does not work as it should

    Hi all

    I recently bought a 2nd hand Toshiba Satellite x 200-219. Had some problems with it that I have overcome now, except one... The touchpad does not work as it should. I think that the cable has been damaged at some point.

    So I'm wondering if I should use the same ribbon cable to connect the keyboard to the motherboard or can I get one of a different model of PC Toshiba laptop?

    I tried searching on the net for advice but have resulted in nothing so thought I would try the forums.

    Any help you can give will be greatly appreciated.

    Thanks in advance,

    Lee

    I think you can use the items to the satellite X 205 series since this seems to be the same series as X 200:
    Found some related parts the touchpad:
    Satellite X 205 / X 200 touchpad Board with cable: reference number: K000047950
    Satellite part number for the TOUCH PAD FFC X 205 / X 200: K000047980

    But why you n t come into contact with a Toshiba authorized service provider in your country and order the part necessary and compatible?

  • Satellite C660 - click of the mouse does not work

    Hello

    I bought this laptop 5 weeks ago and now have problems with the right, click on the mouse does not work. Left click sometimes opens to the left, click on functions and leaves me is impossible to close programs or closed, double clicking in the pavement or enter does not work also.

    I tried to do a system restore to the factory, but I can not click on the next to take me through the restoration and end up having to close it via the main power switch.

    Any ideas please?

    Hello

    You have the same problems with a mouse external or just the touchpad?

    If an external mouse works correctly, you can use it to do a recovery install. This can help you to solve the problem, if this just s software.

    Not least have last but you tried to update the driver for the touchpad? You can find it on the official website of Toshiba:
    http://EU.computers.Toshiba-Europe.com > support & downloads > download drivers

    Check this box!

  • Satellite L300 - 1-5 - the screen does not work

    Recently, I encountered a problem with my laptop, the screen does not work.
    I tested my inverter of the screen and my backlight lamp to see that if that was the problem, but they both worked perfectly, I then tried the entire screen with the parts and that worked too. (I tried in my friends Toshiba Satellite L300 - 217)

    Then I looked around online and got told to try to connect my laptop to an external monitor, so I did and the screen didn't work there either. So now I'm stuck, I have tried everything even made sure all connections aren't loose etc but it still does not.

    Anyone know what the problem with my laptop?

    Thank you, Tom

    Hey Buddy,

    > connect my laptop to an external monitor, so I did and the screen didn't work there either.
    This means that the internal monitor is ok and the reason must be the graphics card or card mother herself.

    I guess for now, you get only a screen empty and nothing happens on your laptop?

    In this case, you should contact the closest service provider authorized in your country. Just get in touch with the guys and ask for help. They can check the cell phone and fix it! ;)

  • Wireless communication switch does not work - Satellite A200 - 23 c

    The laptop has been included, and both a WI - Fi connection stopped working.
    Wireless communication switch does not work. Do not ask is it possible to do?

    Your English confuses me a bit little, but can you please tell me what model of laptop you have and what is the problem here?

    Wireless network card is enabled correctly in Device Manager?

  • Re: Satellite A350 - the lightkeys does not work

    Hello world

    I have a Toshiba Satellite A350, but recently, the lightkeys does not work.
    Can you help me pls?

    What do you mean exactly? Are that they OFF and you can not activated or you cannot use them with player for playback, pause and other functions?

    Have you tried to reinstall Toshiba Value added Package?
    If this isn't the case, please do. Remove the preinstalled version and after mobile download page restart install the most recent version of Toshiba.

Maybe you are looking for