Go through the c function control ++ QML

Hello

I'm new with blackberry-cascade/qt and have problem when setting qml to c ++. Any idea?

Here's the qml

Container {
        layout: DockLayout {}

        ImageView {
            id: imageView
            imageSource: "asset:///images/icon/book.png"
            horizontalAlignment: HorizontalAlignment.Center
        }

        Button {
            text: "Click Me"
            verticalAlignment: VerticalAlignment.Bottom
            onClicked: {
                app.doTest(imageView)
            }
        }
    }

App has already set as context property

qml->setContextProperty("app", this);

the error:

Warning: asset:///TestPage.qml:21: Error: Unknown method parameter type: ImageView*

I used like that. It works...

Page {
    Container {
        ImageView {
            id: img_temp
            imageSource: "pop_up_bg.png"
        }
        Button {
            text: "change"
            onClicked: {
                app.changeImage(img_temp); // app is the context property for this page
            }
        }
    }
}

and in C++:

// I am changing the image source of the imageview controlvoid Test::changeImage(QObject* obj_image)
{
    ImageView *img_temp = qobject_cast(obj_image);
    img_temp->setImageSource(QUrl("asset:///header.png"));
}

-Rezé

Tags: BlackBerry Developers

Similar Questions

  • The callback functions control array?

    My apologies for my basic question.

    I'm experimenting with control arrays and so far able to collect data in controls of a string that is contained in the tables of controls.  Works well.  Of course, none of these controls need callback functions.

    Now, I need a few momentary controls in a control array as well.  So my question is, should I use a single callback for all button controls function in this unique table?  And if so, how can I do to determine which element in the control array called the function?  Reading the forums, it seems as if the use of the data parameter of the callback could happen to me.

    I just wanted to ask before we get off the track.  Thank you!

    Yes, callbackData can be useful in such a situation, but if you can limit to switch to array index to distinguish what to do the recall of your button might be something on this line:

    int CVICALLBACK BtnAttayCallback (int panel, int control, int event,
            void *callbackData, int eventData1, int eventData2)
    {
        int    handle, index;
    
        switch (event)  {
            case EVENT_COMMIT:
                handle = GetCtrlArrayFromResourceID (panel, control);
                GetCtrlArrayIndex (handle, panel, control, &index);
                switch (index) {
                    // Your code here
                }
        }
        return 0;
    }
    

    (No CVI install here so I can't test it: check the code, but it should work reasonably)

  • How to start a printer without going through the control panel?

    Anyone know how to pin printers at the BEGINNING instead of having to go through the app same control panel would be OK

    To pin the Devices/Printers folder:

    1. Open Control Panel, go to hardware and sound
    2. Right click "Devices and printers" and choose "Pin to Start."

  • Omen: The omen application control has disappeared

    A couple of days ago all of a sudden my keyboard did not meet the user profile settings I changed through the application of control the central operations of omen omen. Today, after looking for some reviews online, I decided to update, thanks to HP support assistant, anything that was not updated and then if I click in the operations Central Omen in the pop up with options is no longer the symbol to open the omen keyboard control.

    That's happened? How can I get that back in order to be able to customize the keyboard?

    I've updated the following text:

    HP Notebook system BIOS (Intel processor)

    Event utility HP system

    Intel graphics driver high definition (HD)

    Intel (r) CEtrino (R) 4.0 adapter

    Thank you.

    I suspect the BIOS update. You can restore the BIOS to the previous version to see if that solves it.

    When to start the BIOS recovery, do not power the laptop or distrurb it until the end.

    Plug the laptop power adapter.

    Hold the Windows key and the B key and press the power button. Hold the Windows key and the B key until the laptop BIOS reacts and the BIOS recovery window appears on the screen. Now you can release the keys and let the BIOS back to the previously installed version.

  • Improve the "Sweep" function to block all senders from a domain.

    Please, improve function "Sweep" to block all senders in this area.  Dozens of names attached to a field of Spam, and they get easily through the scan function.  We're going to put spammers out of business.

    The terms of the mail has the ability to block domain addresses.

    I'll add that the scan function has a limit of 500 entry.

  • control keyboard to scroll through the window of the observer?

    I use the current version of mail.app (9.3) in OS X 10.11.5 (El Capitan).

    I would like to be able to do basic operations of reading email with the keyboard controls.    There are keyboard shortcuts to create new messages, reply to or delete messages, move up/down in the list of messages in the message list pane, etc.   That's great.   But for most common task of simply read messages, support for the default is keyboard commands.

    In previous versions of Mail.app, I could use the arrow keys to move through the message list window and I couldn't use the previous page and next page controls (up arrow fn and fn-Basel on macbook pro keyboard) to scroll the message up and down view pane.   It was also possible to scroll up/down in message window using the space space and shift.   The page-up/page-down and SPACEBAR space/shift conform to the General conventions of Mac, including Safari.

    In El Capitan, it seems that this feature has been removed.  Instead, previous page and next page just cause scroll through the message list window.   Space does nothing.   A work around of all kinds is to hit the tab to move the keyboard focus in the list of messages display message, followed by commands to scroll, and then either hit tab twice or press shift + tab (but no space or shift-space) to focus back to the list of messages again.    It is not practical for an operation that I easily hundreds of times every day.

    Anyone has any ideas it is possible to restore the former function?   Hacks like hidden messaging preferences settings?    ... or a way to use the Resource Editor utility (what is the sort of thing even exist anymore?) to modify the application?

    Was it a former function that I have just forgotten or abandoned by Apple?   Or was it a bug or an oversight that it was omitted in the new version?     Doesn't have Apple deemed incompatible with the new directives of the interface?   This feature replaced some other keyboard shortcut that I don't know everything?    Y at - it a 3rd party plugin or something that I can use?   Any ideas would be appreciated.

    Space bar always works for me.

    Opt + arrow up / Dn also works.

    I don't know which would not interfere with these things. Perhaps a third-party app, but I don't know what.

    Have you connected outbound/inbound or restarted?

  • Dynamically add controls QML since a QML function

    Hello!

    I would like to add a control available, under certain conditions. To do this, I want to write a function in QML which it will manage. But I don't know how to instantiate a label and add it. Container has the method add() but syntax that new Sun doesn't.

    Is it still possible?

    Thank you

    Hello!

    This can be done using ComponentDefinition. This page is an example:
    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__qmlcomponentdefinition.html

  • Where control the summary function in 10.8.5?

    I want applications do not reopen when I restart my machine. I'm running 10.8.5, and when I watched it live, I saw people talking by disabling the Resume function in the General window in system preferences. The problem is my general preferences window is not! It looks like not people of screenshots are displayed. I don't know I'm missing something simple, but: How can ensure me that my various applications don't you open every time that I reboot? I don't mean those in the login items - I have a few utilities in there (like Growl, etc.) and those who are very good.  But what he does now is open to things such as Microsoft Word, Photoshop, etc that are not in my list of Login, but were rather things that I had worked on (but closed!) until I rebooted the machine. Where can I control this behavior in 10.8.5? Here is my general window:

    When you shut down the computer, on the closure of the warning screen, make sure that the box to reopen applications (not exact wording) is not checked.

  • How to define the range of data to a strict typdef through the control reference

    Hello world

    I'm trying to define the range of data to a strict typdef through the reference of the order, when I do, I get an 'error of property node.

    Is it possible to set the range of the strict typdef.

    Thank you

    Vignesh

    Vignesh1987 wrote:

    I'm trying to define the range of data to a strict typdef through the reference of the order, when I do, I get an 'error of property node.

    Is it possible to set the range of the strict typdef.

    Try to set the original control (type-def) and not its instances... to open the reference of the original type-def command, use 'Open VI reference'.

    Published:

    These properties are not available with STRICT TYPE DEF.

    a. data entry limits: increment property

    b. data entry property of limits: Maximum

    c. property limits: Minimum for the data entry

  • Is the function of automatic update of Windows found in the use of control panel of your compensation for the use of the Internet from my ISP?

    Original title: Windows updates

    Is the function of automatic update of Windows found in the use of control panel of your compensation for the use of the Internet from my ISP? If so, how? In addition, how to hide an update, I don't want to? For example, I use (and I'm happy with) Windows Internet Explorer (v7), but receive reminders to update update to Internet Explorer v9, which I don't want.

    Is there a way to prevent Windows Update for sending this reminder in the future?

    Geoff

    Hide and Yes will use you PSI data usage. It depends on how much the updates install you, on the amount of data it uses

  • Scrolling the mouse not working not not to scroll through the pages. cannot change the Volume control. How to fix?

    Original title: scroll of the mouse wheel only adjusts the volume. How to scroll through the pages again?

    Using the wireless mouse (Silvercrest MTS2218-m with win 7 x 64) and scroll wheel is no longer made scroll page up and down in any program. Only, it adjusts the volume. How to scroll through the pages again?

    Already checked the settings in Control Panel > mouse nothing obvious here to change this annoying feature. And have already uninstalled the driver for the mouse in Device Manager but no change. have also stopped and started several times laptop.

    Close to the scroll wheel is a dpi button, which can also be used to pass
    between normal mode and media holding for 3 seconds. In media mode
    the volume control wheel and does not scroll.
    Read the manual... ;-)

  • InDesign CS5 for windows only allow me to scroll through the functions with the mouse wheel

    Nice day

    InDesign CS5 for Windows only allow me to scroll through the functions with the mouse wheel and for example not allow me to access drop down menus, any help will be much appreciated

    https://helpx.Adobe.com/InDesign/KB/InDesign-tools-panels-Don ' t - respond.html

  • I want to get multiple clips horizontally through the frame, how can I control the speed at which the move?

    I want to get multiple clips horizontally through the frame, how can I control the speed at which the move?

    And the second

  • failure of pre-flight print saved PDF files through the "save under" function because of the current JavaScripts

    How can I disable using JavaScript in a PDF file that is saved with "Save as" option? PDF files print via postscript and distill are without JavaScript. PDF files that contain any JavaScripts fail the printing process before the flight and so we need to know how to disable all the JavaScripts in a PDF file even if Save as function is used to generate a PDF file.

    Thank you

    Peter

    Peter,

    I looked a little more on it, and regardless if you're reviewing post-processing routines or not, it seems that FM now always writes a javascript model when you use the SaveAsPDF routines. The script is actually empty, that is, it identifies the source as coming from FM, and here is the script embedded in the PDF document [he hasn't]:

    //

    FrameMaker

    //

    / * belongs to: Document-level: FrameMaker * /.

    //

    //

    It seems that your options are limited here. You cannot use the SaveAsPDF road and get rid of the script to the end of the FM of things. So you can use AcrobatPro to sanitize the document, create a script that will remove the javascript or talk to your printing provided by supplier to see if they will let the script above spend their pre-flight.

    Alternatively, use the print function to create your postscript and then distilling to create the final print-ready PDF. If you need to create a CMYK & Spot ready color output using the way of printing, then you will need to use GrafikHuset (today a freebie) PubliPDF in postscript output FM CMYK + Spot PDFs. download convert RGB:http://design.grafikhuset.dk/index.php/kontakt/downloads/grafikhuset-publi-pdf and more details available at the: http://www.grafikhuset.net/PubliPDF/

  • new window, the javascript function to control the size

    Hello world

    I have the following code, and it works well:

    var url = ' http://www.someplace.com/mystuff.html';
    var props = 'width = 450 height = 570';
    var js = ' window.open ("" + url + '","popup"," ' + accessories + "" + "void (0);") ";"
    getURL ("javascript:" + js);

    However, the window that has the original .swf flash file updates with this on the page:

    [object window]

    What is happening in Firefox and IE just returns [object].  Safari is very good.  Is it possible that I can avoid this message back, or I'm at the mercy of the browser gods?

    Thank you!

    -Dave

    a button to create a popup otherwise you won't miss against the problems of popup blocker.  and use the externalinterface class to run the js functions.  It is more reliable:

    to import flash.external.ExternalInterface;
    var url = 'http://www.someplace.com/mystuff.html';
    var props = 'width = 450 height = 570';
    JS var = ' window.open ("" + url +' "," popup"," '+ props +' "+" void (0);")';

    mc.onRelease = function() {}
    ExternalInterface.call("saveglobalscore",score) (js);
    };

Maybe you are looking for