QML signal handling Q fast

Hey. If I have this line in a class that is exposed to QML (other things are working ok so I think that I exposed the class C++ OK)

        Q_PROPERTY(int downloadedDataSinceStart READ downloadedData NOTIFY downloadChanged)

What is the line of javascript look like process the signal of downloadChanged? I tried

_myClass.onDownloadChanged:  {

     /// do this

}

but nothing happened. SEO _myClass.downloadedDataSinceStart has worked, but not my on... slot code.

What should the qml file javascript look like pls?

See you soon

J

It might be what you want to do is the following:

_myClass.downloadChanged.connect(myJavaScriptSignalHandler);

:
:
:

function myJavaScriptSignalHandler() {
// Code ...
}

See this reference:

http://doc.Qt.IO/Qt-4.8/qmlevents.html

Tags: BlackBerry Developers

Similar Questions

  • DB handle insert faster the cursor inserts?

    I want to just make sure that I'm not missing something, but it seems that Db::put() is faster than using a Dbc::put()?

    I had come up with the idea, since then I insert an already ordered list (keys are integers (ints), using a comparison of integers (ints) function), you use a cursor would eventually be faster as each subsequent insertion would not need that cross all BTree (which is what Db::put(), no?).

    Instead, I find that it is still about 20% slower.

    Maybe I am doing something wrong?

    Test the code demonstrating the behavior:

    Truncate db
    Insert 6000 integers (1-30000 by 5)
    engage.
    insert/update, integers (1-30000 by 4)

    It makes both back to back and timekeeping product. It is built on Solaris 10, so your deck do not have hrtime_t and gethrtime()

    My results (consistantly) are:
    100 ms using Db::put()
    120ms using the::get() Dbc and Dbc::put()
    (also, I use a 512 MB cache)

    -----
    #include & lt; sys/time.h & gt;
    #include & lt; iostream & gt;
    #include & lt; db_cxx.h & gt;
    #include & lt; sys/stat.h & gt;


    int bdbKeyCompare (Db *, const dbt2 dbt1, const Dbt Dbt)
    {

    int * ip1 = (int *) dbt1 - & gt;get_data();
    int * ip2 = (int *) dbt2 - & gt;get_data();

    If (* ip1 & gt; * ip2)
    Return 1;
    ElseIf (* ip1 & lt; * ip2)
    Returns - 1;
    on the other
    return 0;

    }


    void errCb (const env, const char prefix DbEnv, const char * msg)
    {
    std::CERR & lt; & lt; "[BDB ERROR]" & lt; & lt; MSG & lt; & lt; std::ENDL;
    }

    DbEnv * openBerkeleyEnv(char *envLoc)
    {
    DbEnv * env = new DbEnv (0);

    Try
    {

    env - & gt; set_errcall (errCb);
    env - & gt; set_lk_detect (DB_LOCK_YOUNGEST);


    env - & gt; Open (envLoc, DB_CREATE |) DB_INIT_MPOOL | DB_INIT_TXN |
    DB_INIT_LOG | DB_INIT_LOCK | DB_SYSTEM_MEM |
    DB_THREAD | DB_RECOVER | DB_REGISTER, 0);

    }
    catch (DbException & dbex)
    {
    printf ("[FATAL] BDB exception caught while trying to open the environment (%s)": %s ", envLoc, dbex.what ()");
    Remove env;
    Returns false;
    }




    return the env;
    }

    int main()
    {



    DbEnv * env = openBerkeleyEnv("./testEnv");
    DbTxn * txn = NULL;
    DB * dbh = new Db (env, 0);
    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);
    DBH - & gt; set_pagesize (512);
    DBH - & gt; set_bt_compare (bdbKeyCompare);
    DBH - & gt; Open (txn, "test.db", NULL, DB_BTREE, DB_CREATE |) DB_THREAD, S_IRUSR | S_IWUSR);
    TXN - & gt; validation (0);
    TXN = NULL;

    uint32_t c = 0;

    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);
    DBH - & gt; truncate (txn, & c, 0);
    TXN - & gt; commit (0);

    DBC * cursor = NULL;

    DBT gKey;
    DBT gValue.
    TXN = NULL;
    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);


    int v;

    int rc;
    v = 1;
    int count = 0;

    Key to DBT (& County, 4);
    Key.set_flags (DB_DBT_USERMEM);
    Key.set_ulen (4);

    Value of DBT (& v, 4);
    value.set_flags (DB_DBT_USERMEM);
    value.set_ulen (4);

    for (count = 0; count & lt; = 30000; count += 5)
    {
    DBH - & gt; put (txn, & key and value, 0);
    }

    TXN - & gt; commit (0);

    int ret = 0;
    curV int = 0;

    departure from hrtime_t = gethrtime();
    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);
    for (count = 0; count & lt; = 30000; count += 4)
    {
    RET = DBH - & gt; put (txn, & key and value, DB_NOOVERWRITE);
    If (ret is DB_KEYEXIST)
    {
    DBH - & gt; get (txn, & key and value, 0);
    v += 1;
    DBH - & gt; put (txn, & key and value, 0);
    v = 1;
    }

    }
    TXN - & gt; commit (0);
    end of hrtime_t = gethrtime();
    hrtime_t diff1 = end - start;



    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);
    DBH - & gt; truncate (txn, & c, 0);
    TXN - & gt; commit (0);

    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);
    for (count = 0; count & lt; = 30000; count += 5)
    {
    DBH - & gt; put (txn, & key and value, 0);
    }

    TXN - & gt; commit (0);

    int kCount = 0;
    Key.SET_DATA (& kCount);
    Start = gethrtime();
    DBH - & gt;get_env() - & gt; txn_begin (NULL, & txn, 0);
    DBH - & gt; cursor (txn, & slider, 0);



    for (count = 0; count & lt; = 30000; count += 4)
    {
    kCount = count;
    RC = cursor - & gt; get (key, & value, DB_SET_RANGE);

    DBH - & gt; put (txn, & key and value, 0);

    If (rc! = DB_NOTFOUND)
    {


    If (* (int *) key.get_data () == count) / / it is already in the db
    {
    std::cout & lt; & lt; "found the key/value, update in place" & lt; & lt; std::ENDL;
    v += 1;
    cursor - & gt; put (key, & value, DB_CURRENT);
    v = 1;
    }
    on the other
    {
    std::cout & lt; & lt; "Found key/value, but not this one" & lt; & lt; std::ENDL;
    kCount = count;
    v = 1;
    cursor - & gt; put (key, & value, DB_KEYLAST);
    }

    }
    Else if (rc == DB_NOTFOUND)
    {
    std::cout & lt; & lt; "Nothing in the DB, insert" & lt; & lt; std::ENDL;
    kCount = count;
    v = 1;
    cursor - & gt; put (key, & value, DB_KEYFIRST);
    }

    }



    cursor - & gt;close();
    TXN - & gt; commit (0);

    end = gethrtime();
    hrtime_t diff2 = end - start;



    printf ("loading time: %dms\n", diff1/1000000);
    printf ("loading time: %dms\n", diff2/1000000);

    DBH - & gt; closed (0);
    env - & gt; closed (0);

    exit (1);
    }

    Published by: user4205883 on December 29, 2008 10:23

    Hello.

    Using a slider you cannot avoid the tree research on the successive entries. The tree could have changed since the cursor last use, due to deletions or insertions of other sliders or directly handles Db, so it is not prudent for the cursor directly access the last worksheet page he used (this page can no longer exists)! The sliders are really designed to allow access to the duplicates and iterating over all the elements.

    That said, the numbers in your test are biased because cursors do not support your workload as easily as using a Db handle is. The loop using Db::put operation 1 of BDB 80% of the time and BDB 3 operations of 20% of the time, an average of 1.4 in. BDB per iteration. The loop using Dbc::put performs operations of BDB 2 each iteration. I would bet that you would see similar to Db::put and Dbc::put numbers if you were to use the same steps for the handful of the Db.

    Ben Schmeckpeper

  • One qml to another signal

    Hey all, I wonder how do to have a signal triggers a function in a different qml file. I have a navigationPane and need of its onTopChanged signal to trigger a function in one of its child pages, how can it be done? I'm sure it is relatively easy, but I can't find a good example and will continue to explore different ways.

    Hello

    The link below may be similar to your question, it has references and suggestions to overcome what you are trying to do.

    http://supportforums.BlackBerry.com/T5/Cascades-development/custom-QML-components-handling-events-of...

    Alex

  • If the application call the tpabort on a signal for handling? (Usignal used)

    Hi all

    And thanks in advance.

    We perform testing of switching CARS.
    All of our servers to signal SIGSEGV using Usignal.

    We have 2 outstanding issues:

    1 should we call tpabort after receiving a signal such as SIGSEGV (for services called by TMQFORWARD)?
    * its like we shouldn't because we are not the owner of the transaction. (TMQFORWARD is the owner of the transaction)

    2. should call the tpabort after receiving a signal such as SIGSEGV (for services to manually control the transaction IE tpbegin\tpcommit\tpabort call)?
    * its as we should because we are the owner of the transaction.


    Thank you very much
    TechSgin

    Hi TechSign,

    Tuxedo adheres to the XA standard which requires enabled transaction semantics. Specifically what this means is:

    1 tpabort() and tpcommit() can be done by the caller of tpbegin(), that is, the aborter or the validator of the transaction must be at the same level called tpbegin(). So yes, if your service has been called by TMQFORWARD and TMQFORWARD have started the operation, the only option that your service must abandon the transaction is to perform a tpreturn with TPFAIL as the return code.

    2. all activities within the transaction must end before the tpabort() or tpcommit(). In other words, you can complete a transaction so that there is an exceptional activity such as service performed with tpacall() calls. This probably is not directly apply to you.

    In all honesty, if you receive a SIGSEGV signal, shouldn't the server just roll up and die? I mean that you really want the server to continue processing requests if he tried to access a memory that he should not have consulted? In this case your signal handler must get out the entire process. If current service vehicle was in a transaction, the transaction will be marked rollback only and will fail to commit whenever the beginner of the transaction tries to validate the transactions (for example, a TRANSCENDING transaction).

    Kind regards
    Todd little
    Chief Architect of Oracle Tuxedo

  • LTE application: Signal PSS and EU synchronization problem


    Just as I suspected, samples received on the receiver side are only cross correlated with the PSS sequence (PCI mod 3) = 0, this is the reason why the synchronization does not work when the eNB transmits with a (PCI mod 3) 0. The PSS sequence (PCI mod 3) = 0 is integrated as a time fixed signal of the domain in the FIR filters although (the two who treats I and rated a Q of the received signal handling complex). To change this and to implement a different sequence of PSS, should open the basic FIR blocks Xilinx generator and change the sequence.

    I got some guys from support LabVIEW Communication an updated version of the "LTE Cross Correlation.gcdl" function that implements a selective control for the value (PCI mod 3) and seems to change the PSS sequence within blocks of FIR. I post here if someone has the same problem. Although I have not tried myself yet.

  • Computer "is" more low-signal router instead of range extender

    I've seen a few similar posts; but nothing seems exactly like my problem; or I missed it.

    I have a router WRT54G and WRE54G range extender; seem to be working well and talk to each other.  (Took a while, but I got it; and it has been fine since.)   I connected to the signal stronger WRE fast when Internet and slow Internet when WRT connected to the lower signal (which is further) - just like one would expect.

    The problem: my computer (only place Office) will be unrelated to the stronger signal "Range Extender".  I'll work some time or leave and come back - and the link will be back signal Extender, fast router signal slow, lower.  I can click on my profile; Connect and sometimes come back on the most powerful signal.  (If not, try again and again until it crashes into the most powerful signal.)  [Even with "site survey" - I select Connect to the stronger signal, but it seems to connect randomly either.]

    - & - Another post, I think I could do something with the MAC addresses - for example, block my USB MAC of the router wireless receiver, so he 'only' to connect to the Extender.  (Better yet, I can say my network connection to connect only to the MAC of the extender?)

    Operating system is - 2000

    Here's something I put in place earlier - for the most part just repeats above:

    Equipment:

    LinkSys wireless router; WRT54G; 6 worm.  Firmware 1.00.7 (now 1.02.7)

    LinkSys Range Extenders;  WRE54G; Firmware Ver 3 3.01.01 (now 3.04.01.)

    USB LinkSys network adapter: WUSB54G Ver 4

    -WHY it keep coming back to the lowest signal from router?  (The big question).

    -Why, when I do a site survey, select the strongest signal and select Connect, enter the WEP code, he still occasionally connect back right at the lowest signal from router, even if I've highlighted the stronger signal Repeater when I hit the Connect button?

    -If I create profiles with the most powerful signal, it is always the same (that is, sometimes it connects the signal the most powerful signal "Extender" and sometimes the Repeater weaker signal, except that I do not need to enter the WEP code if I connect to the profile instead of the signal of view survey.)

    -According to information online, I found that the router must be on 'Firmware version 2.02.2' to be compatible WRE;   But - if I check for the latest version of the firmware for WRT54G version 6, it is 1.02.7 - does that mean the Extender is incompatible with my router?

    -Are there a way to "force" the wireless network connection to bind to a specific MAC address - so I can restrict to a stronger signal of the Extender?

    Scrooge, thanks for the suggestions.    Earlier, I tried the following solution, based on a similar condition a few - this on another post:

    Solution: Configure the router MAC filtering does not to allow connections to the MAC address of the wireless USB network card.

    Since I tried this a few days ago I was followed and it worked.  So, before he would keep switching to the smaller Repeater link.  In saying the Repeater from the heat to let the link not only the Extender to post a link and it is now to stay connected to the Extender and the speed remains constant.

  • QtQuick - C++ Connections item reported in QML

    Hello everyone

    QtQuick has a connection element for access to C++ in QML signals and manage. It looks like this:

    {Of connections
    target: live
    onLiveUpdateStarted: {}
    Console.Debug ("onLiveUpdateStarted qml")
    updatingLiveData.running = true
    updatingLiveData.visible = true
    }
    onLiveUpdateFinished: {}
    Console.Debug ("onLiveUpdateFinished qml")
    updatingLiveData.running = false
    updatingLiveData.visible = false
    }
    }

    'live' where is defined through main.cpp: viewer.rootContext ()-> setContextProperty ('live', live);

    How can I make this connection with stunts like connections does not seem to be available.

    Best regards

    Sebastian

    In fact the connections item is always available, but you need to 'import QtQuick 1.0"first to enter namespace.  At this point, because it is not a visual node, you also need to place it in a list of attachedObjects instead of just came out with the rest of the content page as you have Qt QML.

    Is not necessary, however. Another option that requires no setting in QtQuick is to make direct connections to signals, something like this:

    onCreationCompleted: {
        live.liveUpdateStarted.connect(someFunction);
        live.liveUpdateFinished.connect(someOtherFunction);
    }
    

    Then, you would obviously regular JavaScript (for example, someFunction) functions with the same content as the managers that you have demonstrated.

  • BlackBerry Q10 timer does not work for a project of 10 Q Lable in Blackberry

    Hi all

    I'm just a new Black Berry Q 10 and just beginner. I get some helpful solutions here to correct my mistakes. I am very grateful for this site and its members.

    In my application, I would like to add a timer to a lable. for every second, I want to Christophe Lable value. Here is my code Qml and timer.

    // Default empty project template
    import bb.cascades 1.0
    import CustomTimer 1.0
    // creates one page with a label
    Page {
        Container {
            id:root
            layout: DockLayout {}
            property int f: 10
            Label {
                id: timerLabel
                text: qsTr("Hello World")
                textStyle.base: SystemDefaults.TextStyles.BigText
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
    
            }
            Timer {
                id: lightTimer
                // Specify a timeout interval of 1 second
                interval: 1000
                onTimeout: {
                    root.f -= 1;
                    timerLabel.text = "Timer:"+root.f;
                    lightTimer.start();
                    if(root.f<0){
                        lightTimer.stop();
                    }
                    } // end of onTimeout signal handler
            } // end of Timer
    
        }
    }
    
    #include 
    #include "timer.hpp"
    
    Timer::Timer(QObject* parent)
         : bb::cascades::CustomControl(),
         _timer(new QTimer(this))
    {
        Q_UNUSED(parent);
        connect(_timer, SIGNAL(timeout()), this, SIGNAL(timeout()));
        setVisible(false);
    }
    
    bool Timer::isActive()
    {
        return _timer->isActive();
    }
    
    int Timer::interval()
    {
        return _timer->interval();
    }
    
    void Timer::setInterval(int m_sec)
    {
        // If the timer already has the specified interval, do nothing
        if (_timer->interval() == m_sec)
            return;
    
        // Otherwise, set the interval of the timer and emit the
        // intervalChanged() signal
        _timer->setInterval(m_sec);
        emit intervalChanged();
    }
    
    void Timer::start()
    {
        // If the timer has already been started, do nothing
        if (_timer->isActive())
            return;
    
        // Otherwise, start the timer and emit the activeChanged()
        // signal
        _timer->start();
        emit activeChanged();
    }
    
    void Timer::stop()
    {
        // If the timer has already been stopped, do nothing
        if (!_timer->isActive())
            return;
    
        // Otherwise, stop the timer and emit the activeChanged()
        // signal
        _timer->stop();
        emit activeChanged();
    }
    
    #ifndef TIMER_HPP_
    #define TIMER_HPP_
    
    #include 
    #include 
    
    class QTimer;
    
    class Timer : public bb::cascades::CustomControl
    {
        Q_OBJECT
    
        Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
        Q_PROPERTY(int interval READ interval WRITE setInterval
                   NOTIFY intervalChanged)
    
    public:
        explicit Timer(QObject* parent = 0);
    
        bool isActive();
        void setInterval(int m_sec);
        int interval();
    
    public
    
    slots:
        void start();
        void stop();
    
    signals:
        void timeout();
        void intervalChanged();
        void activeChanged();
    
    private:
        QTimer* _timer;
    };
    
    #endif /* TIMER_HPP_ */
    

    and I sign up time as follws custome...

    Registering the custome timer
    qmlRegisterType("CustomTimer", 1, 0, "Timer");
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    

    where I'm wrong... I'm just Hello world but Timer shows no lable value. Please help me!

    Hello

    It was my mistake in looking at timer in Qml. The good way to start is given below.

    Already... .i was

      Timer {
                id: lightTimer
                // Specify a timeout interval of 1 second
                interval: 1000
                onTimeout: {
                    root.f -= 1;
                    timerLabel.text = "Timer:"+root.f;
                    lightTimer.start();
                    if(root.f<0){
                        lightTimer.stop();
                    }
                   } // end of onTimeout signal handler
            } // end of Timer
    

    but now to hide a bad start timer and start in the right way

    Timer {
                id: lightTimer
                // Specify a timeout interval of 1 second
                interval: 1000
                onTimeout: {
                    root.f -= 1;
                    timerLabel.text = "Timer:"+root.f;
    //                lightTimer.start();
    //                if(root.f<0){
    //                    lightTimer.stop();
    //                }
                   } // end of onTimeout signal handler
            } // end of Timer
    
        }
        onCreationCompleted: {
            lightTimer.start();
        }
    

    Thank you!!!

  • Create button to create a new TextField

    Hi all

    I'm new to BlackBerry and development building an application. I want to make a button that could create a new TextField. So, whenever I hit this button, a new TextField will appear. Is it possible to do this with qml?

    I managed in the onClicked understanding signal handler to display a text or image, but I still don't know how to create a new TextField with Manager signals. Is it possible to create with slot and signal or function?

    Any help would be appreciated. Thank you.

    So what it will do is add some QML you have test.qml in the scenegraph.

    This line,

    var createdControl = compDef.createObject ();

    Refers to the attachedObject and creates a fromt the test.qml object.

    This line,

    rootContainer.add (createdControl);

    then it adds to the scenegraph.

    Nothing else is necessary other than the creation of the test.qml with your TextField in, you can also replace the source: line with an element itself, if you do not want to put the dynamic qml in a separate file.

  • Display QList ListItemData &lt; QVariantMap &gt; with &lt; QVariantMap &gt; QListDataModel

    Hey,.

    I have a declared list like so:

    ListView {
                    id: PostsList
                    preferredWidth: 700
                    objectName: "PostsList"
                    layoutProperties: DockLayoutProperties {
                        horizontalAlignment: HorizontalAlignment.Center
                    }
    
                    // A single component because there's no list header.
                    listItemComponents: [
                        ListItemComponent {
                            type: "post"
                            PostItem {
                            }
                        }
                    ]
                                    //Tried this hoping items were being misparsed as headers.
                    function itemType(data, indexPath) {
                            return 'item';
                    }
                }
    

    Where is PostItem.qml

    Container {
        id: itemRoot
        layout: DockLayout {
            leftPadding: 30
            rightPadding: leftPadding
            topPadding: 30
        }
    
        Container {
            preferredHeight: 250
            layout: DockLayout {
            }
            Label {
                //text: ListItemData.data.title
                text: ListItemData.title
                layoutProperties: DockLayoutProperties {
                    verticalAlignment: VerticalAlignment.Center
                    horizontalAlignment: HorizontalAlignment.Center
                 }
            }        Label {            //text: ListItemData.data.title            text: ListItemData.description            layoutProperties: DockLayoutProperties {                verticalAlignment: VerticalAlignment.Center                horizontalAlignment: HorizontalAlignment.Center             }        } }
    
        // Signal handler for list item activation.
        ListItem.onActiveChanged: {
            setHighlight (ListItem.active);
        }
    
        // Signal handler for list item selection.
        ListItem.onSelectedChanged: {
            setHighlight (ListItem.selected);
        }
    }
    

    If you begin to feel that this code resembles stamp collector, you something...

    in any case, I stated as follows the data model for the list, copy the following code runs in a callback function SLOT QNetworkAccessManager...

    QList map;QVariantMap variant;foreach (post, posts)
    {
        variant.clear();
        variant.insert("id", post->id);
        variant.insert("title", post->title);
        variant.insert("author", post->author);
        map.insert(map.length(), variant);
    }
    
    ListView *PostsList = mNav->findChild("PostsList");
    
    QListDataModel *model = new QListDataModel;
    model->setParent(this);
    model->clear();
    
    QVariantMap v;
    int i = 0;
    foreach(v, map)
    {
        model->insert(i,v);
        i++;
    }
    
    PostsList->setDataModel(model);
    

    Here is what I expected to happen.

    I compile and debug the program. Some code I have send the network request. I analyze the JSON in a QList (which is my own type). From their I looked in a QList (map, called in the code above). Once I put my ListView data model as the variable according to the guidelines of this line:

    PostsList-> setDataModel (model);

    "PostsList" list updates in the application and displays the data from post-> title, as that inserted in the QVariant inserted in QVariantMap on this line:

    Variant. Insert ("title", post-> title);

    Instead, what is shown is the post-> data of the author, and the only reason I can possible design that is displayed (in reality the point post about 13 members, I removed most of length) is that it is the first in alphabetical order and seems to be the first member of the QVariantMap variable. The author of the message is the unique label presented, so declared both in the QML labels seem to be ignored.

    When I select a list item (by using the code is essentially identical to the example of stampcollector) and page through the QDeclarativeContext method all members of the QVariantMap are accessible and can be used to display items QML.

    Here is an example of how the stamp collector app that performs in the OnSelectionChanged handler:

    ListView* PostsList = dynamic_cast(sender());
    DataModel* Model = PostsList->dataModel();
    
    // Update the content view context property so that it corresponds to
    // the selected item and navigate to the page.
    QVariantMap map = Model->data(indexPath).toMap();
    mQmlContext->setContextProperty("_contentView", map);
    mNav->push(mContentPage);
    

    Can someone explain the behavior that I receive? Why can't I access the articles through the ListItemData.member method as described in the documentation?

    Note: some minor code changes have been made for length and clarity, the code has no compiler errors and like I said the DataModel code works at least to a certain extent all the data members that I expect to be accessible in ListItemData are available in _contentView.

    I haven't checked in depth, but the first thing I would try, is to change your function to return 'post' instead of "item", since you have a component for "post".   I will try an example.

    Stuart

  • issue of cameraView show

    I'm trying to get the cameraView show, but when I open the map it shows just the underlying page.  What funny, however, is that the camera takes pictures when I touch.

    This is the code for my camera QML:

    I call this QML leave of a spreadsheet, don't know if that makes a difference.  Not there at - it no code standard QML to get the base cameraview (as in the camera application) without having to rely on the camera?  I want to reference the pictures stored in my application.

    import bb.cascades 1.0
    import bb.cascades.multimedia 1.0
    import bb.multimedia 1.0
    
    Sheet {
        id: cameraSheet
    
    Page {
        id: photoPage
        titleBar: TitleBar {
            title: qsTr("Take a picture") + Retranslate.onLanguageChanged
            dismissAction: ActionItem {
                title: qsTr("Cancel") + Retranslate.onLanguageChanged
                onTriggered: {
                    // Hide the Sheet.
                    cameraSheet.close()
                    }
            }
        }
    
        // A Container is used to gather visual items together.
        Container {
            layout: DockLayout {
            }
            Container {
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
                // This is the camera control that is defined in the cascades multimedia library.
                Camera {
                    id: camera
                    onTouch: {
                        if (event.isDown()) {
                            // Take photo
                            capturePhoto();
                        }
                    }
    
                    // When the camera is opened we want to start the viewfinder
                    onCameraOpened: {
                        // Using helper function to set resolution
    
                        // Additional camera settings, setting focus mode and stabilization
                        getSettings(cameraSettings)
                        cameraSettings.focusMode = CameraFocusMode.ContinuousAuto
                        cameraSettings.shootingMode = CameraShootingMode.Stabilization
                        applySettings(cameraSettings)
    //                    camera.startViewfinder();
                    }
    
                    // There are loads of messages we could listen to here.
                    // onPhotoSaved and onShutterFired are taken care of in the C++ code.
                    onCameraOpenFailed: {
                        console.log("onCameraOpenFailed signal received with error " + error);
                    }
                    onViewfinderStartFailed: {
                        console.log("viewfinderStartFailed signal received with error " + error);
                    }
                    onViewfinderStopFailed: {
                        console.log("viewfinderStopFailed signal received with error " + error);
                    }
                    onPhotoCaptureFailed: {
                        console.log("photoCaptureFailed signal received with error " + error);
                    }
                    onPhotoSaveFailed: {
                        console.log("photoSaveFailed signal received with error " + error);
                    }
                    onPhotoSaved: {
                        setting.lastFileName = fileName;
                        // Makes the ImageButton visible when a photo is captured.
                        setting.visible = true;
                    }
                    onShutterFired: {
                        // A cool trick here to play a sound. There are legal requirements in many countries to have a shutter-sound when
                        // taking pictures. So we need this shutter sound if you are planning to submit you're app to app world.
                        // So we play the shutter-fire sound when the onShutterFired event occurs.
                        cameraSound.play();
                    }
                    onCameraResourceAvailable: {
                        // This signal handler is triggered when the Camera resource becomes available to app
                        // after being lost by for example putting the phone to sleep, once it has been received
                        // it is possible to start the viewfinder again.
                        camera.startViewfinder()
                    }
    
                    onCreationCompleted: {
                        // Open the front facing camera.
                        camera.open(CameraUnit.Rear);
                    }
    
                    attachedObjects: [
                        CameraSettings {
                            id: cameraSettings
                        },
                        SystemSound {
                            id: cameraSound
                            sound: SystemSound.CameraShutterEvent
                        }
                    ]
                }
            }
    
        } // content Container
    }// Page
    }
    

    Thanks to davnce.  Any help will be loved and solutions will be marked.

    see you soon,

    Nevermind, I found a way to be much easier to do this simply by invoking the camera using C++

    bb::system::InvokeManager manager;
    bb::system::InvokeRequest request;
    request.setTarget("sys.camera.card");
    request.setAction("bb.action.CAPTURE ");
    InvokeTargetReply *targetReply = manager.invoke(request);
    
  • How to add corresponding elements of two arrays in a continuous acquisition?

    Hi all

    I am writing a program (in version 9.0 of labview) to acquire the signal of a fast set. I use the acquisition rate of 1.25 Ms with an external trigger. Now what I need, is to add the "n" data these acqisitions and then further process.  E.g. If I signal to 200µs acqiring can total number of data points with the acquisition of 1.25Ms rate will be 250. I'll get a table 1 d of 250 data points whenever I run my acquisition.

    Let's say Array 1of acquisition number 1, 0.1, 0.3, 0.5, 0.6,... up to a total of 250 data points

    Table 2 of the acquisition by number 2, 0.4, 0.5, 0.8, 0.4,... up to a total of 250 data points

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

    Added table should be 0.5, 0.8, 1.0, 1.3... .route to a total of 250 data points

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

    To do this, I need first to save the table of acqisition number 1, then run the No. 2 acquisition and add points of data corresponding to the saved table. This should continue at a nuber defined by the user to purchase say 10, 20 or 50... I don't know how to do it. Can someone help me with this problem?

    Thank you very much in advance

    Kind regards

    Champion

    I guess that time avarages and acquisition will not change during the measurement, so keep a cela outside loops. If you know your settings for made her make it constant.

    you create task (outside the loop) and a narrow at the end.

    Avoid the dashboard generation where possible. With no.. AV., and no. acq.points declared, the size of the arrays is fixed and you can (re) use a single Bay and replace the elements in the array.

    No need to collect all the data and avarage them after the rally. Just add

    I add a suggestion

  • collection of samples of first N and the last of waveform

    Hello

    I am trying to acquire the circuit voltages. I had a waveform that I have attached to this message. I want just the signals of temps.002 a.007 in this graph. To select a particular sample, what will I do? I don't have enough knowledge in labvie... So please help me.

    Thanking you,

    Manu

    You can republish ot the LabVIEW forum; This is the SignalExpress forum.

    We do not have enough information to answer your question fully.  To get the de.002 a.007 on the chart data, you need a subset of your data table.  Determine what is this subset and fetch it depends on how you got the data and in what form it is in.  The two most likely forms are a type of dynamic data (dark blue wire) and the type of waveform data (Brown wire).  "For the type of dynamic data, use the Express VI of Passage is extracted from the Express ' Signal handling palette.  For the type of waveform data, use the subset of waveform is VI in the palette of waveform .

    If that does not answer your question, please post code you so we can give a better answer.

  • Several strain gauges

    Hello

    I'm trying to run a simple application, where several strain gauges is to read, nothing fency. I use an indicator of the gauge to display the strain reading well. The problem is when I connect multiple calibers, I do not know how to assign the individual indicators to different strain gauges, so all my indicators in gauge end by showing the same value. What I want is the different gauge indicator show the succession of different strain gauges.

    Material: Labview 8.5.1, block SC-2345, CSC-SG01 measuring module connector, card data PCI-6251 acquisition.

    Thank you

    Sine

    On the block diagram, go to Express---> Signal handling.

    You will see some functions to merge and split signals.  It is mobile control.  You can enter the bottom and drag them down, so you can create multiple entries (Merger) or outputs (for split) as needed.

    Eventually you want to get a way to use the Express VI, but they are good for a beginner to get started quickly.

    To learn more about LabVIEW, I recommend watching the LabVIEW tutorials online
    LabVIEW Introduction course - 3 hours
    LabVIEW Introduction course - 6 hours

  • PXI-6713

    Hello world

    I have a data acquisition called NI PXI-6713. Can someone tell me if it is possible to use this card to acquire a voltage signal? This card can support analog inputs? Or I'll buy some new maps to measure the signals and do some math FFT on these signals on frequency range(0-30MHz)? What are the cards you advice?

    Thank you in advance!

    Yami.

    Here is the page of the product: NI PXI-6713.  There not all analog inputs.

    This signal is too fast for all Multifunction DAQ products of NEITHER.  If you want to stick to the material OR you need something OR-Scope line.  I would start by looking at the NI USB-5133.

    Best regards

Maybe you are looking for

  • R100 pilot installation order

    Hello I seem to have misplaced my recovery cd and I need to re - install XP. I downloaded the latest drivers 30 (!) more or less, but I'm totally lost trying to install them in the correct order. I searched the forum and support R100 with no result d

  • Satellite Z830-10W - timer function for the backlight on the keyboard

    Hey, I bought a Toshiba Satellite Z830-10W, that's a fine ultrabook.But I would like to have the timer function for backlight the keyboard work. The next update of the BIOS are change? Flemming regand

  • ProBook 450 G2: password does not work when you try to open a session.

    I've been connecting to my laptop with the same password for several months now and then a few days ago, I tried and it wouldn't let me, it came up with an error message saying offline. The password was absolutely correct and checked caps lock shift

  • Windows server 2012 file server slow speed

    Dear all, I use Windows server 2012 as a server file only with 64 GB RAM and 16-core intel Xeon and size of shared file is only 800 GB. problem is that after a few rate of file transfer from client to server got time slowing down as below. copy data

  • Audio not playing is not in the timeline

    It is a strange problem. I'm editing video featuring several speakers who are each port lavs. For one of the speakers, I hear sound fine in the clips, but not in sequence. Even when she's in a video with another reviewer, I can hear the other speaker