Global Varianl on Js and QML

Hello world

I have a question on using in order to create a global variable shared between all QML files I add this line

.pragma library

on the JS file and it works perfectly (on request Descktop or Symbian), but it seems does exist on BB10

so is there an equivalent of this solution

Thanks in advance

'Underlined in red' is probably Momentics? I do not use Momentics so I don't see that. My own text editor, of course, is not noted in red. ;-)

If this works or not in the current mechanism does not depend on if Momentics (perhaps wrongly) seen as a problem. Try to use it in your code and see if it works... it is the only true test, unless Momentics actually prevents you from building when this red underscore is present...

Tags: BlackBerry Developers

Similar Questions

  • A global variable is adjustable, and a Boolean value in LV3.1.1?

    A global variable is adjustable, and a Boolean value in LV3.1.1? I can do in LV 8.0, but 3.1.1 I need because of instrument gives me the penalty.

    All suggestions from users for a long time?

    Well, I'm a long time user, but that will come back some time.

    A global variable is basically a VI without a block diagram, so you should be able to place a Boolean control on the global variable just as you would place a digital command. Boolean values are treated differently at the time, but it probably won't affect what you do. The prices you say you tried, you can't put a Boolean value controlling this? I honestly don't remember not that is the case, but if this is the case, you can still use the functional overall construction, which is what we did before global variables have been introduced.

  • How can I use qt without cascades and qml

    I want to use the Qt API without cascades and qml in my native application. I tried to use the Qt header files, but he tries to link with the static Qt libraries which are missing in the bb10 NDK (10.04). so can any body me suggestions on how to use the Qt API in the native application development

    Deploy the libraries you want to use with your application.  See here http://supportforums.blackberry.com/t5/Native-Development/How-to-port-your-Qt-Projects-to-Playbook/m... and here http://qt-project.org/wiki/QNX

    See you soon,.

    Jon

  • XmlDataModel and qml: model read of data directory

    Hello

    I am building a partially written application with qml.

    I made a page with a ListView and XmlDataModel qml.

    All works if the xmldatamodel read the source of goods .xml file...

    But if I change the XML source to point to a file in the data directory, the journal report that it cannot access the file...

    Why?

    The file is present, and the content seems OK.

    Should I need to enable something?

    Thank you

    Okay, that was a path problem... the source path: '.. '. /.. /.. / data / yourmeallist.xml ' was wrong. "

    I knew not how to pass the good reference to the application data directory... so the solution I found, it's pass the path of the file to like a ContextProperty QML... Like this:

    QDeclarativePropertyMap * propertyMap = newQDeclarativePropertyMap;

    propertyMap-> insert ("XMLPATH", QVariant (QString (QDir::homePath() + "/ yourmeallist.xml")));

    _qml-> setContextProperty ("_propertyMap", propertyMap);

    and that in qml read this property

    ....

    {To ListView

    dataModel: {XmlDataModel}

    Source: _propertyMap.XMLPATH

    }

    ...

    Not the best solution... but it works

  • Question on the development of Cascades using C++ and QML

    Hi all, I have been experimenting and creating waterfalls applications for more than a month.

    I used c ++ (where I am a newbie c ++ too) all the time to create applications and ignore qml.

    I'm at the point where I need to create the list in my application and it uses the MVC architecture, I'm not familiar with.

    So my question is:

    Lets say I have a Page, a container that are coded in C++, can I create a list in qml and then "call" and add to my C++ container?

    If the answer is Yes, is there anyone kind enough to provide a bit of code sample on that?

    Thank you

    Your words are a bit confusing.

    If you add a page to a listitem then no, not possible.

    If you want to add a list created in QML and add it to your C++ container then Yes.

    If it's a static object qml you can load the page in code c++ at compile time.

    If you want to dynamically add a ListView QML to a container during execution, then you will need to pass the object by a Q_PROPERTY or a Q_INVOKABLE one.

    A simpler method is to set the name of your ListView object and then going to a function in your C++ that it finds and adds.

    QML

    ListView {
       id: lv
       objectName: "bob"   // Dynamically change if you wish
    
       //  ... ListView stuff
    }
    
    Button {
        text: "Click to add ListView"
        onClicked: {
            _app.addList(lv.objectName)
        }
    }
    

    C++

    void addList(QString name) {
       ListView* lv = (ListView *)mPage->findChild(name);
       mContainer->add(lv);
    }
    

    Not in front of my computer (which is encoded in memory), so maybe not quite accurate, but something like that.

  • Global switches for Blend and Motion Blur setting will not work with the new version of After Effects 2014.1.1

    I have been using After Effects regularly since 1995. If this isn't an operator error.

    I'm on a new Mac Pro six main with OSX 10.9.5 and 32 GB of RAM.

    Is someone else in trouble with activation mixture and motion blur setting?

    Sometimes I am able to make the global switch seem to be on. It won't even activate the directional blur or frame the mixture.

    I'll answer my own question. Global switches actually work. The separate black boxes that indicate when the global switches are on have been removed and replaced by a light blue outline of the icon of the switch.

  • How global master pages changes and reference...?

    Here is my scenario, I have several technical documents (books) who are between 40 and 90 chapters.  I need to make overall on the master pages overrides and reference (logos, etc).  How can I change the master pages in the book without having to change each chapter separately master/reference page?

    I was not the creator of these books, and I'm fairly new to framemaker.  I have a lot of experience in Indesign and Pagemaker.

    The original documents were created in version 8.0 and I use version 9.0

    Thanks for the help-

    Rob

    [email protected]

    Either get a chapter just as you want, or create a master (recommended) file, is not in any book, but who has all the settings properly.

    Open your file of "master".

    Open all the files in the book (Shift + file > open). In the book file, select all the files of the component to which you want to apply the changes. Do file > import Formats > and specify your master file as source.

    If you only want to update the master and ref pages, simply select these options (template =) layouts.

    In most cases, you do not want to activate the checkboxes that remove the replacements.

    Art

  • Two-way Navigation: side AND Top Navigation: Page header contained in the Global Page causes overlap of the following regions

    Environment:

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

    APEX 5.0.1 on ADR in Tomcat

    Universal theme

    Global page

    New application (no migration)

    The goal:

    -----------

    In addition to the navigation, I want to use a horizontal Navigation at the top of all application pages at the same time.

    My way up to now:

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

    (1) left Navigation ist defined as default user interface.

    1A) Unfortunately it is not possible to have two means of navigation defined at the same time!

    (2) therefore... I created a global page

    (3) and added a list with the list of attribute (= Menu bar) template to the PAGE of a global Page header. -> Well, looks good, but:

    The problem and the Question:

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

    When adding a list according to menu (or something else like static text) to the global header of the page then the left hand side Navigation AND Breadcrumb area is oberlapped by the 'Logo' and 'Navigation Bar area' because the Page header is pushing it down. Parts of the side Navigation and navigation bar are not more.

    Please see the 2 following screen captures:

    Initial position:

    no_global_menu.jpg

    After the addition of menu on the global page:

    with_global_menu.jpg

    Unfortunately I can't understand myself, how to set the position or the css page template, or values... and at what level (model, page,...) I have to put.

    = > y at - it a way to let these following regions (dynamically) be pushed down? How can we define the position?

    Best regards

    Joerg

    Hello out there!

    In case anyone has the same issue here the answer I would give for-> me I found the following solution:

    .) I defined a new style with the following custom css theme roller:

    .apex-side-nav .t-body-nav, nav-side-.apex .t-body-stocks, .apex-side-nav .t-body-title

    {

    top: 80px;

    }

    .) And then of course saved as a new style.

    Hope this is the right way and good / best practices to deal with it!

    Best regards!

    Joerg

  • Local and Global Index confusion...

    Hi all

    Oracle Database 10 g Enterprise Edition Release 10.2.0.3.0 - 64 bit

    I have a partitioned table, when developing the application, they have committed an index ON this table. Previously, whenever we use to run 'Alter Table add partition..' global index becomes unusable and I used to rebuild the same. But in recent months, each time we add partition (Alter Table... ADD Partition..) on this table, index will get unusable to stat instead it shows that indexes THE data dictionaries (Lacality = Local in USER_PART_INDEXES). Partitioned indexes are also automatically created with each table partition creation.

    But the query below shows the output indexes are GLOBAL.

    Select double dbms_metadata.get_ddl('INDEX','ABCD','USER_A');

    Can someone me help on what actually happened here.

    But the example above has the keyword LOCAL?

    CREATING INDEX 'SEB '. "" CDRV_I1 ""SEBS ". "" CDRV ' ('CDRV_CURNT_FL', 'IND_LAST_VERSN', 'GMT_SEIZ_DT_TIME', 'CLECT_ZONE', 'CALL_ID',

    "SWTCH_ADMIN_ABBR")

    PCTFREE, INITRANS 10 2 MAXTRANS 255 LOGGING

    STORAGE (INITIAL 10485760 NEXT 10485760 MINEXTENTS 2 MAXEXTENTS 2147483645)

    PCTINCREASE 0 DEFAULT USER_TABLES)

    "SEBS_CDRV_TAB" of LOCAL TABLESPACE

    (PARTITION "CDRV_HISTORIC"

    PCTFREE, INITRANS 10 2 MAXTRANS 255

    STORAGE (INITIAL 10485760 NEXT 10485760 MINEXTENTS 2 MAXEXTENTS 2147483645)

    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)

    TABLESPACE "SEBS_CDRV_TAB."

    If it looks like a duck and quacks like a duck, it is very probably a duck (or the local index)

    See you soon

    Richard Foote

    http://richardfoote.WordPress.com/

  • JS function as a type of page in QML property

    Hi all

    I'm trying to create useful js 'class' for my blackberry application and save here some information about qml object here is the example of such file js:

    /* * my js */
    
    function Utils(devInfo){ this.devInfo = devInfo; this.text = "test text";
    
     this.getInfo = function(){ return this.text; };}
    

    I want to group some utils functions here and use this js in qml file object, but I don't want to create "Utils" every time, I would like to have a single instance of page qml. I tried to use properties:

    import bb.cascades 1.3
    import com.example.bb10_samples_states 1.0
    import "myscripts.js" as Scripts
    
    Page {
        property variant utils : new Scripts.Utils(deviceInfo)
    
        Container {
            Label {
                id: myLabel
                text: "Hello World"
            }
    
            onTouch: {
                var newLabeltext = utils.getInfo(); // freezing
                myLabel.text = newLabeltext;
            }
        }
    
        attachedObjects: [
            DevInfo{
                id: deviceInfo
            }
        ]
    }
    

    * DevInfo is registered object c ++

    I got the following in the notecard event error message:

    "asset:///main.qml:15: TypeError: result of expression 'utils.getInfo' [[object Object]] is not a function."

    If I do not use the property and only with variable work, everything is ok. The following code works correctly:

    import bb.cascades 1.3
    import com.example.bb10_samples_states 1.0
    import "myscripts.js" as Scripts
    
    Page {
        //property variant utils : new Scripts.Utils(deviceInfo)
    
        Container {
            Label {
                id: myLabel
                text: "Hello World"
            }
    
            onTouch: {
                var utils = new Scripts.Utils(deviceInfo);
    
                var newLabeltext = utils.getInfo();
                myLabel.text = newLabeltext;
            }
        }
    
        attachedObjects: [
            DevInfo{
                id: deviceInfo
            }
        ]
    }
    

    In general, I don't know where I can store object js in qml page to access my functions utils without need to create each time. Any ideas?

    I think I found the answer

    According to this link, there is no global js object and every instance of component QML has own unique copy resources imported from JS:

    ...

    Code-Behind implementation resources

    Most of the JavaScript files imported into a document QML are implementations with State of the QML importation document. In these cases, each instance of the QML object type defined in the document requires a separate copy of the JavaScript and State objects to behave properly.

    The default behavior when importing the JavaScript files must provide a unique and isolated copy for each instance of the QML component. If this JavaScript file any resources or modules with a statement .import, its code will be executed in the same scope as the instance of the QML component and therefore can access and manipulate objects and properties declared in the QML component. Otherwise, it will have its own unique scope, and the objects and properties of the QML component should be passed to the JavaScript file as parameters functions if they are required.

    ...

    http://Qt-project.org/doc/Qt-5/qtqml-JavaScript-resources.html

    So it seems there is no need to implement the model of sigleton or store JS resources in the QML document. I changed my code as follows:

    /**
     * js
     */
    var utils = {
      devInfo : null
    };
    
    function init(deviceInfo){
      utils.devInfo = deviceInfo;
    };
    
    function getText(){
      return utils.devInfo + " done.";
    };
    

    and qml:

    import bb.cascades 1.3
    import com.example.bb10_samples_states 1.0
    
    import "myscripts.js" as Scripts
    
    Page {
        Container {
            Label {
                id: myLabel
                text: "Hello World"
            }
    
            onCreationCompleted: {
                Scripts.init(deviceInfo);
            }
    
            onTouch: {
                myLabel.text = Scripts.getText("Tra-ta-ta");
            }
        }
    
        attachedObjects: [
            DevInfo{
                id: deviceInfo
            }
        ]
    }
    

    It works fine - I can store information in the variable 'utils' and work with qml js objects. Hope so, it will help someone

  • How can I stay on zoom 120 all the time? It goes back to 100 and some Web sites in new tabs

    Between Web pages he keeps going back down to 100. Is it possible to set it to 120 between the tabs and Web pages?

    The zoom settings are on a per site basis.

    NoSquint {web link}
    NoSquint allows you to adjust the text-only and the full page
    (text and images) zoom and color settings levels
    both globally (for all sites) and by site.

  • How to set up thunderbird with IMAP accounts and using an Inbox, and send

    I just installed Mozilla that I need to set up multiple e-mail accounts using IMAP. I need to read all the emails and to refer to the 'old' sent when using my Ipad. I implemented 4 profiles and they each have their inbox, outbox, etc removed child. It's embarrassing for me because I need to have a global inbox, Outbox, sent and deleted items. Essentially a place where all the emails of all accounts are kept. I tried to unified value but then find that emails go inside or outside are not synchronized with my other devices.

    I hope the above makes sense and the air of someone who can point me in the right direction.

    Thank you

    Mark

    With IMAP, the email client shows you what is on the server. If you put something in a folder in Thunderbird, it this copy on the server. So, in principle, a shared common inbox is not possible. Messages from accounts B and C would be copied to account A, and vice versa.

    We can close a common Inbox. The integrated solution is to use unified folders which creates virtual folders.

    View | Records | Unified

    So you will have a folder Inbox, composite and Ditto for files common to all accounts: sent, drafts, and trash/Bin/deleted. It fails where you have unique records in one or more accounts, because he doesn't know what else to blend with.

    I prefer an approach do it yourself which is pretty much the same technology; This is a Saved Search folder, where you create your own folder that combines the contents of other files. So, not only can you have a common inbox, but also a folder all unread messages, or messages involving specific correspondents, or related to a specific project or interest, through a series of accounts.

    https://support.Mozilla.org/en-us/KB/using-saved-searches

  • several loops with error handling and controll

    I have a project where I spin 4 loops at the same time and must stop all the loops with a stop button as well as all the loops if one of the loops will receive an error.

    Loop 1.

    Loop start

    control the other 3 loops

    Loop 2.

    Analog voltage reading

    Loop 3.

    Digital inputs to read

    Loop 4.

    Write digital output

    Someone knows how to do this?

    Two other methods not mentioned in the otherwise excellent document that mentioned Matt are the use of a global variable 'stop all' and a relative using a Global Variable of VIG/functional.  The reason to talk about, is that they can be used also stop 'detached' live, live which are defined to run asynchronously (and therefore a bit 'out of control') regarding the main VI.

    I use a "combination of ingredients" for some projects I'm developing using LabVIEW 2016 and its support of the channels.  For example, I use a Messenger channel to create something akin to a message in queue manager.  When the event loop detects that the exit button has been pushed back, it puts a Message "Exit" on the channel of Messenger and stops himself.  When the Message Loop sees "Exit", it sends one release Message who else has need to see (in one case, the producer of a producer/consumer model) and stops himself.  When the producer Gets the output Message, it puts a "last element is invalid" on the flow of the channel for consumers and stops himself.  When the consumer gets the message of the last element, he stops himself.  A magnificent waterfall.

    And I work (not yet 100% complete) how to extend this to start the asynchronous calls that do not (yet) support channels as easily...

    Bob Schor

  • Global WORM

    Suite of the former subject.

    Here is my latest version of the WORM Global.  For those who are not familiar with this project, a Global of WORM is a way to store variables where you can write on it once.  WORM means Write Once Read Many.  This vi holds an array of variant.

    You can add any variable at any time.  When you add, you write the value to the variable.  After you have added, you can not burn again, there is no mechanism to do so.  But you can read the variable as many times as you want.  This prevents race conditions does not happen.

    It is useful store constants (variables that are defined and then do not change).  An example of its use would be to store addresses GPIB of instruments, datalog names of files, the config file names, flags of constants and others.

    On first convocation, the variants table is emptied to get rid the remains of previous use.  It is best to call this vi inside a loop, with two arrays as inputs to the loop: a global array of names and an array of corresponding values.  Wire the Add enum at the entrance of the Action.  Now the globals are defined and can be used anywhere in the program.  To use, call the vi with reading in action.  Thread on behalf of global you want to read.  The output is a Variant, but can be converted into their own types using the variant of the function Data.

    Another action is to remove.  You can delete globals that are no longer needed at any time.

    If you try to add a world with an empty name, you will get an error.  If he tries to read a world with an empty name, you will get an error.  If you try to add a world whose name already exists, you will get an error.  If you try to read a world whose name does not exist, you will get an error.  If you try to delete a world that does not exist, or one in which the name is empty, you will get an error.

    Check the vi and give me some feedback.  If you see problems, bugs, or have a better idead, I'd like to hear about them.

    OK here is the long awaited (about 2 hours), very waited, new WORM_Globals.vi.  Thank you for your and Ray and others who have contributed.  Now he has two enum items, add and read.  No deletion and not delete.  Given that remove all only served to the first call, I just run the action in a case first convened structure.  Name is checked are empty before any action takes place.  If empty, a single error is given, no action taken.  The array of globals is not passed on the world, I deleted the terminal.

    Other suggestions are welcome.

  • How to stop the VI and a Sub VI together

    Hi, in my application, I have a vi with a state machine with a loop of event handler. One of the events in my loop of event handler is out who runs the State of the output of my state machine. I also have an under vi outside my statemachine.

    The problem:

    1. at the exit of pressing my Vi does not stop.

    Reason: my sub vi is still running.

    Need solution : How tp stop the two loops together using the exit button.

    StateMachine P.S:1.My is inside a while loop and while loop runs inside my sub vi also.

    2. both the loops are parallel, since I'm on queues in it.

    2. both the loops are parallel, since I'm on queues in it.

    There are many ways, depending on your architecture.

    Can pass you a message from out of your event loop to your another loop on the queue?

    Another way is to use a global Boolean variable 'Stop' and use it in your second loop exit condition. Set it in the event loop when you want to stop the program.

    The producer consumer example stops the second loop by closing the queue during the first loop stops and then to capture the error when the second loop trying to read the queue.

Maybe you are looking for

  • Yoga 3 14 - parts Confusion

    Hi all I'm about to order a replacement fan for my lenovo 3 14 yogo (80 JH). However, I have noticed there are only two pieces number indicating the fan. Module thermal L Yoga 14 3 DIS - 5H40H35615 Module thermal L Yoga 3 14 UMA - 5H40H35610 What is

  • Compilation of LabVIEW FPGA on crash RT cRIO 9082

    Hello I developed a project of NI VeriStand FPGA (see Project.png) for a target of 9082RT cRIO (which contains 2 cRIO: 9205 & 9264). I have develop a piece of software code to run it on the chassis of RT cRIO 9082 because I never used this kind of fr

  • How to disable Autostart music when the headset is connected and smartconnect?

    Hello After rooting my Z3C and upgraded to fw.5.77, I have disabled some packages app via the Asian Development Bank, as the package "SmartConnect" (com.sonyericsson.extras.liveware). But I still have this annoying music autostart when I connect my h

  • Unable to send or receive 0x800488EB error messages

    Original title: cannot send or receive messages Can't send or receive messages for the Live (degeerfamily06) account. Server error: 0x800488EBServer: 'https://mail.services.live.com/DeltaSync_v2.0.0/Sync.aspx '.Windows Live Mail error ID: 0x800488EB

  • Just got the new computer but did get no o/s. How to install win 7. ??

    Cannot start Windows 7 grid on the new Lenovo ideacenter computer Q180. Screen says something about freedos and freecom. I just got the C:\ >. Have you tried pressing f8 and f5 are mentioned, but? HELP please. The computer has not not any software wi