Call C++ qml button Fuctions

Button * newButton = root->findChild ("eat");
Connect (newButton, signal(Button::clicked()),this,slot(ont()));)

You may need to provide a little more information for anyone to determine what the problem is. But try the link below, it has good examples of C++ / QML integration and then ask your question on this basis, with more details

https://developer.BlackBerry.com/Cascades/documentation/dev/integrating_cpp_qml/index.html

Tags: BlackBerry Developers

Similar Questions

  • Need a FormCalc script to call a hidden button

    I have a FormCalc script on the sending by the Send button Click event. I need to call a second hidden button that uses a JavaScript when the click on send the form by e-mail.

    Each button is working on its own, but I have a problem with the script to call the hidden button display button.

    Thank you

    MDawn

    You can use the method exeEvent of the hidden button.

    In the example, I am executing the Click of Button1 event from a different control below.

    Replace Button1 with full path of your control and the name of the event.

    Button1.execEvent ("Click");

    Thank you

    Srini

  • Trouble to C++ signal to call a QML slot

    Hello

    I can't get a signal from C++ code to call a function of slit in my QML.  I have currently resembles right (compared to the examples I have seen online), but the slit function is never called.  Can you see a problem?  Here is my code:

    applicaitonui. HPP:

    class ApplicationUI: public QObject {
    Q_OBJECT
    public:
        ApplicationUI(bb::cascades::Application *app);
    
        virtual ~ApplicationUI() {
        }
    
    signals:
        void successfulAuthentication();
    
    private:
        ActivityIndicator *mActivityIndicator;
        QNetworkAccessManager *mNetworkAccessManager;
    };
    
    #endif
    

    applicationui.cpp:

    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app) {
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("app", this);
    
        AbstractPane *root = qml->createRootObject();
    
        mActivityIndicator = root->findChild("indicator");
    
        connect(this, SIGNAL(successfulAuthentication()), root,
                SLOT(onSuccessfulAuthentication()));
    
        // set created root object as a scene
        app->setScene(root);
    }
    

    main.cpp:

    ...
    
    emit successfulAuthentication();
    
    ...
    

    hand. QML:

    // Default empty project template
    import bb.cascades 1.0
    import bb.system 1.0
    
    NavigationPane {
        id: navigationPane
        Page {
            id: loginPage
            Container {
                layout: StackLayout {
                    orientation: LayoutOrientation.TopToBottom
                }
    
                ...
            }
        }
        function onSuccessfulAuthentication() {
            console.log("onSuccessfulAuthentication()");
        }
    }
    

    I don't know if it is possible to connect on the side of C++, but in QML, you can do something like:

    NavigationPane {
      onCreationCompleted: {
        app.successfulAuthentication.connect(onSuccessfulAuthentication)
    

    Or use the element of {QtQuick 1.0 connections (it should be placed in attachedObjects):

    http://supportforums.BlackBerry.com/T5/Cascades-development/QML-connections-element/m-p/2063301#M955...

  • show and hide a text with a qml button

    Hi, I have a button and when onClicked I want to display a label and with a second click it hide again, what is the best way to do this in qml?

    Lable{
      id:lable
      text: "My Text"
      visible: false
    }
    
    Button{
      text: lable.visible? "Hide" : "Show"
      onClicked{
        lable.visible = !lable.visible
      }
    }
    

    something like this should work

  • End the call of a button field

    In my application, after a touch, the phone Invoke and a call is made to the specified phone number. Then the phone screen disappears when the call is answered and my app screen fades. I want to put an end to an ongoing call by clicking another button. How do I do that?

    injection of the event. in 4.5 or earlier, you can also use the menu execution. Search the forums for an example of code if you need.

  • call in QML Appworld

    Hello good evening brothers, how could invoke in QML Appworld to use an icon in my app with it.

    Here's some code for you

    Page {
                id: tab2
                Button {
                    id: awbutton
                    text: "Click me"
                    attachedObjects: [
                              Invocation {
                                    id: invoke
                                    query: InvokeQuery {
                                    mimeType: "application/x-bb-appworld"
                                    uri: "appworld://content/124432"
                                    }
                            }
      ]
    
                onClicked: {
                invoke.trigger("bb.action.OPEN")
                  }
    
            }
    }
    
  • procedure call with a button

    Hello

    I create a procedure from pl/sql like

    create or replace procedure MY_PROC  (p_NAME IN VARCHAR2) as
    
    

    Now, I have a button (the_button) in a region a selection list (s_List / P123_Name)

    I want to call the procedure, but I did not now how

    I try: condition Expression PL/SQL type button

    EXPRESSION 1

    BEGIN
       MY_PROC (:P123_name);
    END;
    

    but the code is not valid.

    anyone can explain to me how can I call this procedure?

    THX

    René

    Hello

    What this procedure assumes what to do?

    I guess your button to submit the page.

    Then call procedure after submit processes.

    State of the button, is conditionally display button.

    No not for the performance of the procedures.

    Kind regards

    Jari

  • action of the call after pressing button on enter on textbox

    Greetings,

    I'm sorry to ask such a simple question, but I look around on the internet and all the solutions I have try do not work 100%

    What I do is simple, I have a login page that redirects on my homepage in case of success. I have a username & password to a text box and button 1

    to call the function of connection of my Bean. I just want when the press user enter the password to the CALL button of my login, click action (it is a function of java bean).

    Do not interact with my server or anything, by directly calling a java class function, but just call button click() method so he calls the action that she signed in.

    I try the code below with no luck:

    FUNCTION:

    function clickMe (evt) {}

    var _keyCode = evt.getKeyCode ();

    If (_keyCode == _keyCodeAdfKeyStroke.ENTER_KEY) {}

    model var = evt.getSource ();

    AdfCustomEvent.queue (model, "EnterEvent", {fvalue:comp.getSubmittedValue ()}, false);

    evt. Cancel();

    }

    PASSWORD TEXT BOX

    < af:inputText id = value = "#{BeanLogin.password 'it2'} ' secret = 'true' autoSubmit ="true"> "

    < af:clientListener method = "clickMe" type = "keyPress" / >

    < af:serverListener type = "EnterEvent" method = "#{BeanLogin.clickMe}" / >

    < / af:inputText >

    Can you help me on this please?

    SPECS: Windows 7, JDeveloper 11.1.2.4.0, JSF Page

    Try with this code:

    part of javaScript

    function loginSubmit (event) {}
    If (event.getKeyCode () == AdfKeyStroke.ENTER_KEY) {}
    var button = AdfPage.PAGE.findComponent ('loginForm:loginBtn');
    actionEvent var = new AdfActionEvent (button);
    actionEvent.queue (button, false);
    }
    }

    password field:

    ID = "password" secret = 'true '.
    showRequired = 'true' maximumLength = "30" >
    Type = "keyPress" / >

    where loginBtn resides in the loginForm, and AdfPage.PAGE.findComponent ('loginForm:loginBtn') can find him:

    ......

    "ID ="loginBtn"
    clientComponent = 'true '.

  • Remote call to a button

    Is it possible to call the remote of a change button click event in the input text?


    <! [CDATA]
    Import spark.events.TextOperationEvent;
    import mx.controls.Alert
    protected function button1_clickHandler(event:MouseEvent):void
    {
    Alert.Show ("Hello World")
    }

    protected function textarea1_changeHandler(event:TextOperationEvent):void
    {
    HOW TO CALL THE CLICK ON THE BUTTON ABOVE TO HERE?
    }

    []] >
    < / fx:Script >

    Thank you

    GT

    protected function textarea1_changeHandler(event:TextOperationEvent):void
    {
                   Button1.dispatchEvent (new MouseEvent (MouseEvent.CLICK));
    }

  • keyboard popping up during the call and previous button does not work...

    Why can't I write during a call? I tried other keyboards, but the result is the same...

    is there a solution?

    You have app smart key? If so, remove or disable the calls.

  • call a QML file code c ++

    Hello.

    I am newbie to blackberry 10 development...

    actaully I got the credentials to the server and power analyzes the user name and password...

    now I have to redirect to the new file qml by c ++.

    So I will be gratefull if you guide or help me...

    Thanks to anticipate...

    You should find a lot of code when you check out the samples.

    to send a signal of c ++ you define first the signal in the header. Here's an example, let's say this is in app.hpp:

    signals:
        void numberOfItems(int numberOfItems);
        void numberOfItemsError(QString message);
    

    to send the signal in c ++ you write

    emit numberOfItems(5);
    

    to receive the signal in QML, you must register at the first class (this is already done when you create a new application of waterfalls).

    Just to show you, that it would look like this:

    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("app", this);
    

    Qml, you connect the signal to a qml function, for example onNumberOfItems

    app.numberOfItems.connect(onNumberOfItems)
    

    the function is executed when the signal is emitted:

    function onNumberOfItems(number){
      console.log("number of items: "+number);
    }
    

    That should cover it. It gets a little more complicated when you want to send complex objects with the signal.

  • Calling function in QML?

    Hi all

    I need to call invite to BBM while clicking on a qml button, I am attaching my code example, but it does not

    Button {
               text:"Invite"
               id: invite_button
                onClicked: {
                invokeQuery.updateQuery();
                 }
                  attachedObjects: [
                        InvokeActionItem {
                          id:invokeQuery
                          title: "Invite to BBM"
                         query {
                         invokeActionId:"bb.action.INVITEBBM"
                               uri: "pin:2100000A"
                          }
                        }
                      ]
                    }
    

    How can someone send me some solutions for this problem. ?

    Thank you

    Hi all

    I found a solution about the guest call to BBM at the click of a button, I can't go to invite page but can not able to send invitations by selecting contacts, here is my code

    Button {
                text: "Invite"
                onClicked: {
                    invokeQuery.uri = "pin:210000A"
                    invokeQuery.updateQuery();
                }
                attachedObjects: [
                    Invocation {
                        id: invokeShare
                        query: InvokeQuery {
                            id: invokeQuery
                        }
                        onArmed: {
                             trigger("bb.action.INVITEBBM");
    
                        }
                    }
                ]
            }
    

    Can someone send me solutions

  • ImageButton error call .qml (beta 3 of waterfall)

    Hello friends, after beta 3 came the waterfall had several errors of new variables and some chains of command in my mobile, entiendiendo already realized a few fix a little problem I had this code works perfectly in Beta 3, I have a button called a qml

            ImageButton {
                id: donar
                defaultImageSource: "asset:///images/donacion.png"
                pressedImageSource: "asset:///images/donacion.png"
                layoutProperties: AbsoluteLayoutProperties {
                }
                onClicked: {
                navigationPane.deprecatedPushQmlByString("donaciones.qml");
                }
                preferredWidth: width
                preferredHeight: height
                translationX: 80.0
                translationY: -60.0
            }
    

    But when I run the application in the alpha dev and I click on the ImageButton control I opened the QML, I think it's due to the structuring of new programming language, could help me with this problem to invoke the QML?

    Greetings.

    I have the Alpha of Dev with Os 10.0.9.44

    Hello

    Please check below link

    https://developer.BlackBerry.com/Cascades/documentation/dev/dynamic_qml/index.html

    Use ComponentDefinition.

    Thank you.

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

    feel free to press the button like on the right side to thank the user who has helped you.

  • Disconnection of call with button / stop

    Hello

    Is it possible to have call disconnect with button system / stop?

    Ex:. Samsung gives call witness (Home button) and disconnect with (power button)

    Concerning

    Paddy


  • How can I change the background color of a button in .qml

    Hello, everyone! I have a problem now.

    When I define a componnet in QML button, it has a white background color by default. While I want to change the background color, for example red.

       Container {
            layout: StackLayout {}
            background: backgroundPaint.imagePaint
            attachedObjects: [
                ImagePaintDefinition {
                    id: backgroundPaint
                    imageSource: "asset:///images/background.png"
                }
            ]
            Button{
                text: "button"
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
            }
        }
    

    I read the reference that write it a clickable button with a height fixed and the visual aspect of the button is predefined and cannot be changed and so forth... look herehttp://developer.blackberry.com/cascades/reference/bb__cascades__button.html

    I tried this way to change the theme of the application. But I failed! See more details here http://developer.blackberry.com/cascades/reference/bb__cascades__themesupport.html

    How can I achieve this? Please give me help. Thank you in advance. Please forgive my bad English

    Hello

    Button style is predefined according to me. Dark theme can be activated in the bar - descriptor.xml, but it is applied to the application on a global scale and affect all other controls as well.

    You can use a container with background image instead of a button. Example code:

    http://supportforums.BlackBerry.com/T5/Cascades-development/button-with-a-background-image/m-p/21489...

Maybe you are looking for