Go QML given to the C++ function parameters

I want to spend my page of a C++ function QML data so it can be used/saved in C++.

How should I do this? I have a point of action as follows

actions: [
        ActionItem {
            title: "Save"
            onTriggered: app.saveData(nameField.text)
            ActionBar.placement: ActionBarPlacement.OnBar
        }
    ]

saveData is called but the QML throws an error indicating that the string of unknown method parameter, I don't know how I should pass the data in order to get it and save as a string in the C++ code. Also how we'd spend other data like a datefield, Boolean values of checkboxes, etc. in a C++ function,

Hello

QML

import bb.cascades 1.0

Page {
    content: Container {
        TextField {
            id: txtField

        }
    }
    actions: [
        ActionItem {
            title: "Save"
            onTriggered: app.loadData(txtField.text)
            ActionBar.placement: ActionBarPlacement.OnBar
        }
    ]
}

all

   Q_INVOKABLE
    void loadData(QString);

.cpp

void ApplicationUI::loadData(QString str) {
    qDebug() << str;
}

Tags: BlackBerry Developers

Similar Questions

  • Digital output frequency seems to be twice the frequency generated by the basic function generator

    Hi Labview forum,

    I wrote a program (attached) Labview to generate 3 PWM, square wave, signals that has the same frequency and phase delay right (so that when a signal is off, the other signal is lit. Then the next signal). Everything seems to work fine except that the frequency of the PWM signals generated seems twice as the frequency given to the basic function generator. Anyone have any idea why this is happening? Anyhelp would be greatly appreciated.

    Thank you!

    Totally agree with the advice of all GerdW than the hardware timing of your hardware DAQ will be much more reliable.  That said, part of what you are probably hitting is a little quirk of the primitive delay msec.   Requests for 1 msec have long been particularly little reliable (although they * seem * to have improved in recent years, probably due to the better OS support in Win 7 or something).

    I did minimal mods to your code with comments from you switch to a timed loop.  My quick test showed he is good enough to hit the 1 length of loop of target msec.

    -Kevin P

  • Create parameters for the WriteData function

    Hello

    How would create parameters for the writedata function to populate the html code?

    CODE:

    Function GetCluster {}
    and {{foreach ($Datacenter (Get-Data Center))
    foreach ($Cluster in (Get-Cluster-location $Datacenter)) {}
    New-Object PSObject-property @ {} TypeName
    vCenter = $Datacenter.Uid.Split("@") [1]. Split(":") [0]
    Datacenter = $Datacenter.Name
    Cluster = $Cluster.Name
    HAEnabled = $Cluster.HAEnabled
    DrsEnabled = $Cluster.DrsEnabled
    DrsMode = $Cluster.DrsMode

    }
    }
    }
    # Function compiles the data transmitted by the GetCluster function in HTML table format
    Function writedata {
    param ($vCenter, $Datacenter, $Cluster, $HAEnabled, $DrsEnabled, $DrsMode)
    # < td > < Center > < b > < of police = "Tahoma" > $Datacenter < / police > < / b > < / center > < table


    {$tableEntry = "< tr > < td > < font ="Tahoma">$vCenter< / fonts > < table > < td > < Center > < b > < of police ="Tahoma">$Datacenter< / font > < / b > < / center > < table > < td > < Center > < b > < of police ="Tahoma">$Cluster< / fonts > < / b > < / center > < table > < td > < Center >"} < b > < of police = "Tahoma" >$HAEnabled< / fonts > < / b > < / center > < table < td > < Center > < b > < font = "Tahoma" >$DrsEnabled< / police > < / b > < / center > < table < td > < Center > < b > < font = 'Tahoma' color 'dark blue' = >$DrsMode< / fonts > < / b > < / center > < table > < /tr ' > '.
    Add-Content, $fileName $tableEntry
    Write-Host $tableEntry}

    Thank you

    You specify when you call the writedata function, so I guess it's in the function Get-Cluster.

    You can pass the object you create in the GetCluster function as a parameter.

    Try something like this

    Function GetCluster {
        & { foreach ($Datacenter in (Get-Datacenter)) {
                foreach ($Cluster in (Get-Cluster -Location $Datacenter)) {
                    $clusObj = New-Object -TypeName PSObject -Property @{
                        vCenter = $Datacenter.Uid.Split("@")[1].Split(":")[0]
                        Datacenter = $Datacenter.Name                    Cluster = $Cluster.Name                    HAEnabled = $Cluster.HAEnabled                    DrsEnabled = $Cluster.DrsEnabled                    DrsMode = $Cluster.DrsMode
                    }
                    writedata $clusObj            }
            }
        }
    }
    
    # Function will compile the data passed from the GetCluster Function into HTML table format
    Function writedata {
        param ($object)
    
        $tableEntry = "$($object.vCenter)" +
            "
    $($object.Datacenter)
    " + "
    $($object.Cluster)
    " + "
    $($object.HAEnabled)
    " + "
    $($object.DrsEnabled)
    " + "
    $($object.DrsMode)
    " Add-Content $fileName $tableEntry Write-Host $tableEntry}
  • Call the javascript function using parameters cause run an immediate dependant

    Hello.

    I saw a strange behavior, if I try to use javascript parameters in the method af:clientListener property.

    Using the syntax
     <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="OnInitControl1" type="click"/>
    </af:commandButton>
    and javascript
    function OnInitControl1() {
      alert('OnInitControl1 called');
    }
    the method oninitcontrol1 is called first with the click of the button.

    But with the syntax
    <af:commandButton text="Init" id="cb1"
       partialSubmit="true">
       <af:clientListener method="InitCtrl('Control1')" type="click"/>
    </af:commandButton>
    and javascript
    function InitCtrl(frameName) {
      alert('InitCtrl(' + frameName + ') called');
    }
    the InitCtrl function is called immediately to the loading of the page.

    In both cases, the javascript file is inserted into the use of af: document
    <af:resource type="javascript" source="/ScriptHelper.js"/>
    Is my "method" of the af property syntax: clientListener the problem?

    Paul.

    Paul,

    I don't know if you can call javascript with parameters in the way that you are currently using. However, have you tried using an af:clientAttribute and enhance the javascript?

    Check the operating instructions by Frank on the related topic.

    http://www.Oracle.com/technology/products/jdev/tips/fnimphius/passingAdditionalArgumentsToClientListener.html

    Arun-

  • It is possble the out/inout parameters in function?

    It is possble the out/inout parameters in function?

    student001 wrote:

    Could you please explain why...

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e10592/functions254.htm#SQLRF06181

    For example, user-defined functions can be used in the following:

    -The select list of a SELECT statement
    -The condition of a WHERE clause
    -CONNECT BY START WITH ORDER BY and GROUP BY clauses
    -The VALUES of an INSERT clause
    -The SET of an UPDATE statement clause

    Because you will not be able to do these things.

  • How can I disable the newtab most used feature display sites. I want the new tab to open the page displayed in the newtab:url in the topic: function config

    How can I disable the newtab most used feature display sites. I want the new tab to open the page displayed in the newtab:url in the topic: function config

    41 of Firefox is no longer uses the browser.newtab.url setting in about: config because he was constantly attacked by malware. From 41 of Firefox, you need an add-on to change the new tab page.

    Here are a few options (I'm learning more all the time):

    • If you are already using the extension classic restaurateur theme: There is an option somewhere (!) in his dialogues of the parameters to select another page in the new tab.

    Setting up substitute again tab

    After installing this extension, you must use the Options page to set the new desired tab page (instead of use subject: config).

    Open the page modules using either:

    • CTRL + SHIFT + a (Mac: Cmd + shift + a)
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click Extensions. Then on the side right, find the new tab override and click the Options button. (See first screenshot attached).

    Depending on the size of your screen, you may need to scroll down to enter the address in the form. (See second screenshot attached). For example:

    • (Default) page thumbnails = > subject: newtab
    • Blank tab = > subject: empty
    • Built-in Firefox homepage = > topic: welcome
    • Any other page = > full URL of the page

    Then tab or click this form field and you can test using Ctrl + t.

    Success?

    Once you have set it as you wish, you can close the Add-ons page (or use the back button to return to the list of Extensions of this Options page).

  • Call the DLL function with a pointer to a complex structure

    Hello

    I try to call a function by using COLD LAKE. My problem is the function parameters that I'm trying to access.

    Here is the function and its parameters:

    typedef struct _BAR_INFO
    {
    ULONG dwSize;
    ULONG dwFlag.
    } BAR_INFO, PBAR_INFO;

    typedef struct _DEVICE_INFO
    {
    ULONG dwBarNum;
    BAR_INFO BarInfo [6];
    } DEVICE_INFO, * PDEVICE_INFO;

    Int GetDeviceInfo DLLIMPORT)
    unsigned int CIH.
    PDEVICE_INFO pdevinfo
    )
    {
    ULONG i;

    If (DFR > = DevNum)
    Return PCICORE_DEVICE_NO_FOUND;

    If (DevTable [JC]. DevHandle is NOTHING)
    Return PCICORE_DEVICE_NO_INITIALIZE;

    if(pdevinfo == null)
    Return PCICORE_INVALID_PARAMETER;

    pdevinfo-> dwBarNum = DevTable [JC]. DevInfo.dwBarNum;
    < pdevinfo-="">dwBarNum; i ++)
    {
    pdevinfo-> .dwFlag BarInfo [i] =
    DevTable [JC]. DevInfo.BarInfo [i] .dwFlag;
    pdevinfo-> .dwSize BarInfo [i] =
    DevTable [JC]. DevInfo.BarInfo [i] .dwSize;
    }

    Return PCICORE_SUCCESS;
    }

    As an attachment, there is the Info.vi device Get trying to access this feature. The code crashes when the function is called.

    I have probably not pass parameters of data properly to COLD LAKE.

    Thank you for your lights.

    An array of fixed size in C is equivalent to a cluster of LabVIEW that contains the same number of identical items, replace the table with a cluster. In addition, structs are always passed by reference and the C function expects a pointer to a structure, you don't need to unbundle. Skip the cluster to function as a single parameter. Try the attached revised version of your VI.

  • How to implement a callback to the help function call library function node in LabView?

    I try to call a fuction from a SDK.dll library by using the node call library feature. The SDK has been provided to

    me and I don't have the source code, just the .dll and .h files.

    The SdkSetPropertyEventHandler function has a function of recall as one of its parameters. How to apply the

    callback using the NSI node? I'm a good programmer LabView but this is my first time using the library to call

    Function node. I read all the info I can find on the web site of NOR and the discussion Forum, but can not understand

    This one out. I'm using LabView 8.6.

    The deacribes SDK.h function as:

    Function: SdkSetPropertyEventHandler

    (SdkSetPropertyEventHandler) SdkError SDKAPI
    SdkCameraRef inCameraRef,
    SdkPropertyEvent inEvnet,
    SdkPropertyEventHandler inPropertyEventHandler,
    SdkVoid * context);

    //
    Description:
    Registers a callback function to receive the status
    change the notification events for the States of property on a camera.
    //
    Parameters:
    In: inCameraRef - designate the object camera.
    inEvent - designated one or all the events will be completed.
    inPropertyEventHandler - designate the pointer to the callback
    function to receive the camera property-related events.
    inContext - designated application information must be passed
    way to the callback function. All the data necessary to
    your application can be passed.
    Output: no
    //
    Returns: A sdk errors.
    -----------------------------------------------------------------------------*/

    A separate header called SDKTypes.h file contains the following data:

    typedef SdkUInt32 SdkPropertyEvent;
    typedef SdkUInt32 SdkPropertyID;
    typedef void SdkVoid;

    typedef struct __SdkObject * SdkBaseRef;
    typedef SdkBaseRef SdkCameraRef;

    /*-----------------------------------------------------------------------------
    SdkPropertyEventHandler
    -----------------------------------------------------------------------------*/
    typedef SdkError (SDKCALLBACK * SdkPropertyEventHandler))
    SdkPropertyEvent inEvent,
    SdkPropertyID inPropertyID,
    SdkUInt32 inParam,
    SdkVoid * context);

    Thanks for your help.
    Alejandro

    Andrew_E wrote:

    Hi Rolfk,

    You are absolutely right. This article describes what you were talking about? I'm just trying to get as much information as possible on this thread if the solution is easier to find for the future. Thank you.

    Yes, but I find the idea of using .net to call a LabVIEW VI as callback function C a bit as using a roll of Steam ironing your pants. Why do it? Well the steamroller has extra security guards that make it less likely that you'll break your pants in the process, but it's not elegant IMHO.

    Write a C DLL that translates between a C callback and a user event LabVIEW using the PostLVUserEvent() of the interface of the kernel to run LabVIEW function seems so eleganter for me. Yes, it's a bit of programming in C, but good!

    Rolf Kalbermatter

  • Call the DLL function with pointer to a simple structure

    Hello

    I try to call a function by using COLD LAKE. My problem is the function parameters that I'm trying to access.

    Here is the function and its parameter:

    typedef struct {}
    int major;
    minor int;
    review of int;
    build int;
    } VersionNumberType;

    int Comm_BTE_softVersion (VersionNumberType * pVersion)
    {
    BYTE ByBuffer [2048];

    If (!.) Comm_BTE_readYMem (byBuffer, COMM_BTE_TX14_SOFTVERSIONADDR,
    COMM_BTE_TX14_SOFTVERSIONSIZE))
    {
    return FALSE;.
    }

    //. process the response
    pVersion-> major = (int) (byBuffer [0] & 0xFF);
    pVersion-> minor = (int) (byBuffer [1] & 0xFF);
    pVersion-> revision = (int) (byBuffer [2] & 0xFF);
    < 8)="" )="" |="" ((int)="" (="" bybuffer[5]="">

    Return TRUE;
    } //. end Comm_BTE

    As an attachment, there is the Version.vi soft Comm BTE who try to access this feature. The code crashes when the function is called and labVIEW is closed.

    I have probably not pass parameters of data properly to COLD LAKE.

    Thanks for help.

    Kind regards. NewCLAD.

    Everything is configured properly EXCEPT the digital representation of the values in the cluster. They must match int, which is likely 32 bit on your platform. They are your VI, U8.

  • Call the library function does not find the DLL in the directory where are my LLBs

    I'm using LabVIEW 8.6.  I have a set of screws in several LLBs.  All LLBs located in a directory.  Most of my screws is wrappers for the functions in a DLL.  I was told to put my DLL in the directory where are the LLBs, and apparently this is how the previous programmer has worked (using an earlier version of LabView).

    In the configuration of the library call, I've specified .dll without path.  (This is how we want our screws are an API that will integrate other programmers, so I don't know where they put things and I can't use absolute paths).

    When I insert the VIs in LabVIEW, LabVIEW can not find the DLL and wonder of spotted.  It's just that here in the directory with the LLBs and when I double click on it, everything works fine.  However my absolute path to the DLL now appears in the library to call configuration, and we don't want that.

    Does anyone know how to make this work?  I guess the location of the screw (or LLBs, in this case) should be the current directory and thus Windows search there for the DLL.  However, it seems that this is not the case (in the least, in the latest version of LabVIEW).

    Thank you.

    Batya

    Well someone using your library should not have to dig into your screws and do it all on his own. Instead your library must wrap that and hide disorders it altogether.

    The cluster of error has been added when the dynamic path option has been added. It is not useful hide this error output, so it's always there. As well as the dynamic path, there was the improved error handling added the CLN. One of them is that the level of verification when calling function errors (exception handling) can be specified. I guess that some of these options may generate an error code instead of bring up a dialog box, as they did before and that the output of error code can be useful even in the case of static calls.

    As to what you want to do, I would have long managed that with a DLL that has essentially the same functions as your other wrapper DLLs and an initiliasation function that returns a pointer to a structure of functional distribution based on the actual DLL you want to call. Quite like what an object-oriented function dispatch table is. Then, when your interface initilising you call initialize function and specify the device interface/type that you want to use and after that all other functions take a pointer extra function parameter expedition as the first parameter, in addition to the parameters of the real function. This dispatch function pointer would be just a pointer to a structure that contains the table of function for this interface pointers and the sake of LabVIEW would simply be an integer of size pointer.

    The wrapper function then checks the pointer structure validity send feature and call the actual function with the remaining parameters. It is a C programming and may require a planning and desigining the different interfaces to facilitate this kind of technique of the expedition, but it will certainly pay to long-term and make your library even can be used in previous versions of LabVIEW, so that VB etc. without delicate dynamic loading in the level high, programming environment.

    Rolf Kalbermatter

  • Does anyone have an example VI for using the SendInput function in User32.dll?

    Hi all

    I am creating a VI that creates a click of the mouse.  I looked at the MSDN Web site and found that I need to use the SendInput function in User32.dll.  The problem is that some of the parameters for this function are nested structures.  How to use this function in a call library function node?  Is there already a LabVIEW wrapper for this function?

    Thank you

    MechEman

    I would use rather MouseEvent.  I looked at my VI and it can be cleaned up a bit, but it works for what you want to do.

  • The 'Search' function on the start menu does not work. It seems to freeze and will not even close until I have shut down the computer. What can I do to correct this situation?

    I tried to use the "Search" function to locate a specific file.  The computer froze... not allow me to cancel when I realized that it wasn't working.  The only way I could get the closing of the window had to shut down the computer.

    Hi DyleAcker,
     
    -Search function work is no problem earlier?
     
    Run the troubleshooter from the link given below and if it helps to fix the problem:
  • FIX: STOP error 0x0000007E (0xC0000005, changes, changes, changes) of the last three parameters change

    I installed Norton Internet Security 2010 on a Windows XP SP2 computer... during a full scan of the system and browsing the internet the computer froze... he needed to force a shutdown down... in 10 sec power button... started as a new profile in the same pc... computer froze during the scan of Norton and navigate on the internet... we had to force quit... now When we try to start the PC we get the BSoD (blue screen of death) with the error code...

    STOP: 0X0000007E (0XC0000005, 0X812FD562, 0XF99A77EC, 0XF99A74E8)

    weird... but... seems the last three parameters are always changing at the start... There is no given name (SOME_THING_IN_ALL_CAPS) error... Here's what I've tried so far...

    -restart of the last known configuration of the work

    -starting in safe mode

    -boot in dos mode

    -went out and reset the memory chip

    -removed and put back the battery

    ... which none worked.

    Any ideas?

    Hi HyperD,

    Follow the steps in the article mentioned. The article presents seven methods to solve the problem.

    Settings and filenames in this error message may vary depending on the cause of the stop error.

    Link: How to fix a Stop error 0x0000007E in Windows XP:http://support.microsoft.com/kb/330182

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • The speech of the text function works in Microsoft 2010 so if how?

    The speech of the text function works in Microsoft 2010 so if how?

    Hello

    1. are you referring to Microsoft Office 2010?

    2. are you referring to the speech recognition program?

    I suggest you to see link below and check if it helps.

    Windows speech recognition

    http://www.Microsoft.com/enable/products/windowsvista/speech.aspx

    Guide step by step Windows Vista speech recognition

    http://msdn.Microsoft.com/en-us/library/bb530325.aspx

    See also the advice given by M Thahaseema from the link below:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-windows_programs/Windows-7-speech-recognition-is-not-working/49e1d4c9-4322-41BD-9a6c-026ab0587286

    Let us know if it helps.

  • allows you to set the callback function to extension webworks

    I see in BBM webworks API, the callback function (blackberry.bbm.platform.onaccesschanged) is defined as a field variable, then call the register function.

    Is the only way to pass a callback to webworks?

    You can pass a callback function as a parameter to a function call?

    In my exercise, I tried to define an acceptable extension webwork function a ScriptableFunction as one of the parameters.  When I pass the function() {alert("test")} as an argument, the webwork expansion feature does not work. The debugger displays the webworks function is not called when I try to get to the function as an argument.

    June

    Hi June,

    A callback function right at the method as fact in good number of our API, you can actually pass. On the top of my head, take a look at the readFIle API. You can find the source of the code here - https://github.com/blackberry/WebWorks/blob/master/api/io/src/main/java/blackberry/io/file/ReadFileF...

    You should be able to move from the ScriptableFunctions back with no problems

Maybe you are looking for