Navigating the screens using signals

New thread, forget the old.

/*
 * Copyright (c) 2011-2013 BlackBerry Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import bb.cascades 1.2

NavigationPane {
    id: navPane

    function pushFunction(){
        // here you can push page
        navPane.push();
    }

    onCreationCompleted: {
        quoteApp.clickedButtonDone.connect(pushFunction)
    }
Page {
    Container {
        id:rootContainer
        // Strips out non numeric characters allowing only 0-9 and '.'
        function numericOnly (textin) {

            var m_strOut = new String (textin);
            m_strOut = m_strOut.replace(/[^\d.]/g,'');

            return m_strOut;

        } // end numericOnly
        background: Color.Red

        layout: DockLayout {

        }
        topPadding: 100.0

        TextField {
            inputMode: TextFieldInputMode.Text
            autoFit: TextAutoFit.Default
            maximumLength: 5
            textStyle.textAlign: TextAlign.Center
            preferredWidth: 205.0
            horizontalAlignment: HorizontalAlignment.Center
            hintText: ""
            id:txtAmount
            onTextChanging: {
                txtAmount.text = rootContainer.numericOnly(text);
            }

        }
        Button {
            text: "Submit"
            onClicked: {
                quoteApp.clickedButton(txtAmount.text);

            }

            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center

        }

    }

}

}

This is main.qnml, how can I push hi .qml t ILO?

my class application.cpp and application.hpp

.cpp

/*
 * Copyright (c) 2011-2013 BlackBerry Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "applicationui.hpp"

#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace bb::cascades;

AbstractPane *root;
NavigationPane *myNavi;

ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
        QObject(app)
{

    // prepare the localization
    myNavi = new NavigationPane;
    m_pTranslator = new QTranslator(this);
    m_pLocaleHandler = new LocaleHandler(this);

    bool res = QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this, SLOT(onSystemLanguageChanged()));
    // This is only available in Debug builds
    Q_ASSERT(res);
    // Since the variable is not used in the app, this is added to avoid a
    // compiler warning
    Q_UNUSED(res);

    // initial load
    onSystemLanguageChanged();

    // Create scene document from main.qml asset, the parent is set
    // to ensure the document gets destroyed properly at shut down.
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

    if (!qml->hasErrors()) {

            qml->setContextProperty("quoteApp", this);
        }
    // Create root object for the UI
    root = qml->createRootObject();

    // Set created root object as the application scene
    app->setScene(root);
}

void ApplicationUI::onSystemLanguageChanged()
{
    QCoreApplication::instance()->removeTranslator(m_pTranslator);
    // Initiate, load and install the application translation files.
    QString locale_string = QLocale().name();
    QString file_name = QString("Meter_%1").arg(locale_string);
    if (m_pTranslator->load(file_name, "app/native/qm")) {
        QCoreApplication::instance()->installTranslator(m_pTranslator);
    }

}
void ApplicationUI::clickedButton(QString text)
{
    qDebug() << "The azimuth is " << text << " degrees.";
    emit clickedButtonDone();
}

all

/*
 * Copyright (c) 2011-2013 BlackBerry Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ApplicationUI_HPP_
#define ApplicationUI_HPP_

#include 

namespace bb
{
    namespace cascades
    {
        class Application;
        class LocaleHandler;
    }
}

class QTranslator;

/*!
 * @brief Application object
 *
 *
 *
 */

class ApplicationUI : public QObject
{

    Q_OBJECT
public:
    ApplicationUI(bb::cascades::Application *app);
    Q_INVOKABLE void clickedButton(QString text);

    Q_SIGNALS:
        void clickedButtonDone();
    virtual ~ApplicationUI() { }
private slots:
    void onSystemLanguageChanged();
private:
    QTranslator* m_pTranslator;
    bb::cascades::LocaleHandler* m_pLocaleHandler;

};

#endif /* ApplicationUI_HPP_ */

I get this error

make [2]: Entering directory "" C: / users/krikor/momentics-space work/Navigation/arm ' "
C:/bbndk/host_10_2_0_15/Win32/x86/usr/bin/MOC.exe-DQT_NO_IMPORT_QT47_QML-DQ_OS_BLACKBERRY-DQT_DECLARATIVE_DEBUG-DQT_DECLARATIVE_LIB-DQT_CORE_LIB-DQT_SHARED - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-CQS -... /... / Navigation - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/qt4/QtCore - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/qt4/QtDeclarative - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/qt4 - I...-Io.le-v7-g/.moc/SRC - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/freetype2 - i. - D__QNXNTO__... / SRC/applicationui. HPP o o.le-v7-g/.moc/moc_applicationui.cpp
.. / SRC/applicationui. HPP (50): parse error in the 'virtual '.
CQS-Vgcc_ntoarmv7le-Wno-psabi-lang-c ++-fstack-protector - fstack-protector-all - mcpu = cortex-a9 - g - Wno-psabi-wall-W-D_REENTRANT-DQT_NO_IMPORT_QT47_QML-DQ_OS_BLACKBERRY-DQT_DECLARATIVE_DEBUG-DQT_DECLARATIVE_LIB-DQT_CORE_LIB-DQT_SHARED - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-CQS -... /... / Navigation - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/qt4/QtCore - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/qt4/QtDeclarative - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/qt4 - I...-Io.le-v7-g/.moc/SRC - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include - Ic: / bbndk/target_10_2_0_1155/qnx6/usr/include/freetype2 - i. x - c ++ - header - c... Precompiled.h o o.le-v7-g/.obj/Navigation.gch/c++
make [2]: * [o.le-v7-g/.moc/moc_applicationui.cpp] error 1
make [2]: * waiting unfinished...
make [2]: leaving directory ' C: / users/krikor/momentics-space work/Navigation/arm.
make [1]: * [debug] error 2
make [1]: leaving directory ' C: / users/krikor/momentics-space work/Navigation/arm.
make: * [Device-Debug] error 2

Okey is

NavigationPane {
    id: navPane

    function pushFunction(){
        var blogpage = goToWebView.createObject();
        navPane.push(blogpage);
    }
    attachedObjects: [
        ComponentDefinition {
            id: goToWebView
            source: "hello.qml"
        }
    ]
    onCreationCompleted: {
        quoteApp.clickedButtonDone.connect(pushFunction)
    }

This did

Tags: BlackBerry Developers

Similar Questions

  • I have Dell ispron B130 running windows xp, how do I print what is displayed on the screen using the PRNT SCRN key?

    I have Dell ispron B130 running windows xp, how do I print what is displayed on the screen using the PRNT SCRN key?

    The 'Print screen' button is misnamed.  In fact, what happens when you press it, it is that an image of the screen is copied to the Clipboard.  You must then open an application that can work with images (paint works) and paste in the opened window (or right-click > paste or edit > paste).  Then you can use the regular print of this application (for example, the file > print).

    You can also download free IrfanView.  It is a very handy utility.  It allows you to open and view a wide variety of image file formats and also has the capability of the bulk renaming of files and - for your current number - capture screen images and prints them out.

  • How to recover a selection of the screen using the tool of cross hatching? S worked on the old pc to control...

    I used to be able to select a piece of the screen using Ctrl-S, how I got a cross-hatch tool (it looks like the Selection tool in Photoshop)

    Please help - lost without this feature!

    Maybe your version of Vista has the Snipping Tool...

    Windows Vista - activate the Vista Snipping Tool
    http://www.PCWorld.com/article/137099/activate_vistas_snipping_tool.html

    Use capture tool to capture screenshots
    http://Windows.Microsoft.com/en-us/Windows-Vista/use-Snipping-Tool-to-capture-screen-shots

    Vista tutorial - How to use the tool captures of Vista
    http://www.Vistax64.com/tutorials/148532-how-use-Snipping-Tool-Vista.html

  • Support for the creation of menus in which is the center of the screen using AS3, with MovieClip that contains buttons

    Hello beautiful ActionScript Guru-

    I'm new on learn AS3 and have run obstacle after roadblock to getting what, in my view, should be a simple thing to work. I'm trying to create a menu on many levels using a MovieClip that contains simple buttons. I'm facing 2 problems while posting what I've built.

    1. my Menu.as (code below), says it takes "5000: the class 'Menu' must subclass"flash.display.SimpleButton"because it is linked to a symbol in the library of this type.» That's fine, except when I don't change the code to reflect the change the error message wants to difficulty, my beautiful menu driven with options turns into an absolutely useless image, with no opportunity to serve a menu at all. I have read other forums that I have what Miss me is to create a MovieClip that contains buttons, but I think that's exactly what I did. I'm not sure how to fix this error.

    2. when I compile my main class (ConsStartMenu.as) did not finish the compilation error 1119: line 29 and 46, claiming that my link to my subclass (Menu.as) called a potentially indefinite property Menu through a reference with static type ConsStartMenu. After searching on Google and the forums navigation for long hours, I do have absolutely no idea what means this error, or what he wants me to difficulty. I think that this is also the reason why my sizing and centering code does not work. It's as if he can't quite find my Menu.as. Maybe a quick glance at my code will shed some light on this?

    Thank you very much in advance for your help.

    -connor

    errors.png

    ConsStartMenu.as-

    package {}

    import flash.display.MovieClip;

    import stuff from the lib of valve

    Import ValveLib.Globals;

    Import ValveLib.ResizeManager;

    SerializableAttribute public class ConsStartMenu extends MovieClip {}

    These three variables are required by the engine

    public var gameAPI:Object;

    public var globals: Object;

    public var elementName:String;

    public void ConsStartMenu(): void {}

    }

    This function is called when the user interface is loaded

    public void onLoaded(): void {}

    make this visible user interface

    Visible = true;

    Let customer across the user interface

    Globals.instance.resizeManager.AddListener (this);

    trace ("Cons Start Menu loaded!");

    This. Menu.Setup (this.gameAPI, this.globals);

    }

    public void onResize(re:ResizeManager): * {}

    var scaleRatioY:Number = re. ScreenHeight/900;

    If (re. ScreenHeight > 900) {}

    scaleRatioY = 1;

    }

    This. Menu.screenResize (re. ScreenWidth, re. ScreenHeight, scaleRatioY);

    }

    }

    }

    Menu.As-

    package {}

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    Import fl.transitions.Tween;

    Fl.transitions.easing import. *;

    to import flash.display.SimpleButton;

    SerializableAttribute public class Menu extends MovieClip {}

    var gameAPI:Object;

    globals var: Object;

    public void Menu() {}

    }

    public void Setup (api: Object, globals: Object) {}

    define our variables

    api = this.gameAPI;

    Globals = This.Globals;

    }

    public void screenResize (stageX:int, stageY: int, scaleRatio:Number) {}

    'this', the position being this module, in the center of the screen

    This.x = stageX/2;

    This.y = stageY/2;

    Save the original scale of this movieClip

    If (this ["originalXScale"] is nothing)

    {

    This ["originalXScale"] =-this.scaleX;

    This ["originalYScale"] = this.scaleY;

    }

    This module/movieClip to scale the scaleRatio

    this.scaleX = this.originalXScale * scaleRatio;

    this.scaleY = this.originalYScale * scaleRatio;

    }

    }

    }

    you are missing a fundamental knowledge of classes and how they work.

    the bottom line: you cannot reference Menu unless it's a static class.

    You must create an instance of your class of Menu:

    menu: Menu of var = new Menu();

    and then you can add to your addChild (menu) for the use of ConsStartMenu, or maybe that you don't have.  I can't.

    is ConsStartMenu your document class?

  • Satellite C660d-A2k - how to increase the backlight of the screen using battery operation

    I bought a new computer laptop, installed all the drivers and it works.
    How to turn on the backlight?

    It works only when I charge the laptop. Turn off when it turns off.
    If add to the brightness of the screen up and turn the screen gets brighter the load.

    How to make led lights fixed, I put it in the market only when the load.

    Hello

    The brightness of the display can be changed using the key combination FN + F6 (increase) and FN + F7 (decrease).
    Have you read the user manual? This is mentioned in the manual that is preinstalled on your laptop.

    In addition, you should also check power Win 7 Options.
    You can find it in the control panel-> power options.

    I guess that switches from laptop to another optimized battery Central while you disconnect the adapter. In this case the brightness of the screen falls down to ensure longest battery working time. You can change the level of brightness for this plant too.

  • Question on the Organization of the elements on the screen using the disposal of the battery

    I have 4 images (384 [half of the width of the screen] by 384).

    I want to organize 2 next to each other at the top and 2 under these two next to each, in the middle of the screen. Here's a shot: here's a picture for you show

    In this way, when the orientation is changed to landscape mode, the images will remain in the same position.

    I'm trying to find a way to do it with StackLayout. So far I have root container with SL, from top to bottom and inside, two StackLayouts for top and bottom images, both from left to right. This is not however lead to 4 images at the center of the screen. If I ask a top padding to Center, she led the top padding be there when its landscape in orientation, and therefore looks like a place empty at the top when it shouldn't be.

    Can anyone offer an idea on how to do it? Thank you!

    Why not use a GridListLayout?

    http://developer.BlackBerry.com/Cascades/reference/bb__cascades__gridlistlayout.html

  • Inability to make a selection of the screen using the built-in browser

    Hi all.

    Java newbie here - coding experience is VB.

    I'm trying to code using the JDE Eclipse against Sun JDK 6 for a Curve 8900 platform, V4.6.1.250, 4.2.0.113.

    I have a dirt simple browser application that accesses a single Web page. Exit the screen of the page is formatted for PDAS and other portable devices.

    The images on the site looks like a BB or PDA screen with up and down buttons that call graphical objects for display. It also allows zoom in on certain parts of the image when you position then click and hold the trackball on a Blackberry. (The description above is how it works when you browse using the standard BB browser.)

    When I try to click on buttons or graphic, nothing happens.  I guess I did a class/method required and appeals against it, but being new, I don't know how to do it and did not find documentation online to point me in the right direction.

    What I want to do is one click of the buttons via the trackball or press and hold the trackball to zoom feature work.

    Here is the code I use:

    package com.beginningblackberry;

    Import net.rim.blackberry.api.browser.Browser;
    Import net.rim.blackberry.api.browser.BrowserSession;
    Import net.rim.device.api.ui.UiApplication;

    SerializableAttribute public class BrowserApp extends UiApplication {}
        
    Public Shared Sub main (String [] args) {}
    BrowserApp instance = new BrowserApp();
    instance.enterEventDispatcher ();
    }

    public BrowserApp() {}
    Private site = Browser.getDefaultSession ();
    site.displayPage ("http://www.ssec.wisc.edu/data/paw/usus_usa_radr_imag_none.html");
    System.Exit (0);
    }
    }

    Any help is very appreciated.

    VBRefugee, I think you should start your programming BlackBerry checking the development layout of how the UIApplications are built. The UiApplication class does not display of really anything on the screen by itself, rather you would lead to an extension of a class of display on the screen where you can be private pushScreen (MainScreen()) again and you would customize your layout in the constructor of your screen extension adding your controls with a field of embedded browser. Take a look at some of the applications delivered by the JDE and the eclipse plugin example. I think it could help you, but I could have misunderstood.

  • How to drag the screen using the trackball

    Hello

    I have several screens and I want to access each of them using the trackball.

    Please help me on how to drag each one screen using the trackball.

    the user can drag in the direction left or right.

    I want to effect such as BB AppWorld.

    Thank you

    Afonso

    Override navigationMovement to detect the roll.

  • Angle of Rotation of the screen use + video problems

    Hi netpos,.

    Recently, I stumbled on the following problem with the video appearance on a portrait based on the Lcd screen.

    So, I ve set the DMP to rotate the screen 90 degrees to fit the current orientation of the LCD screen.

    Presentations that have images, swf are looking really good. But, if the presentation includes a video file, then the video file does not turn with the rest of the presentation but is presented in landscape orientation (such that it appears the LCD screen was mounted in landscape orientation).

    The current solution to do this is to modify (using the video editing) the video and turning at 90 degrees. Then everything seems ok.

    But, in doing so, the whole appearance of the video is reduced and also, time is lost as well!

    If anyone has encountered this before?

    Thanks to you all

    Hello


    What you describe works as expected.  The DMP will NOT alter the video.

    If the video is the film in 'landscape' or 'big' screen, the video will be played

    in the original mode, even if the display is shot in portrait mode.

    The video must be registered with mode\vertical portrait in mind.  If this is not

    the video will need to be changed via an application of part 3 to fit the dimensions of

    You vertical video object.


    If this answers your question, take the time to mark this

    discussion answered & rate the answer.


    Thank you!


    T.

  • Prevent the locking of the screen using GPO

    I'm having all kinds of problems with this one.  I have 50 machines of Win7, connected to a domain.  I want to avoid that Win7 machines never blocks their screens after a period of inactivity.  I've already disabled the screensaver using GPO and disabled "password protect the screen saver" in the GPO.  However, after ten minutes of inactivity, the screen locks and the user must retype his password.

    It is a kiosk type environment, so having the screen lock is a specific problem.

    I found all sorts of tips on how Activate lockout, but nothing that works on Disabling it.  This is the last little problem I must correct before the deployment of the system gets, and I've been home for weeks, so any help would be greatly appreciated.

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.

    TechNet Forum

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/threads

     

    Hope this information helps.

  • resolution of the screen using hdmi cables

    I have a dell inspiron 15 3520. It has a resolution of 1366 x 768. The hdmi cable I have is a cable game and 4096 x 2160.

    I use the hdmi cable only to watch movies from my laptop to my tv.

    When I plug the hdmi cable, my phone tells me the screen resolution does not. It is said that my viewing can be affected.

    Is it OK to use this cable or should I replace it with another?

    Cables have no resolution, only screens/monitors/TVs do.

    Most HDTVs have a resolution of 1024 x 768, but it can vary.  But it does not harm your computer, simply use the resolution setting that your TV manual recommends.

  • Navigating the screens

    Hello

    I would like to set up a kind of functionality to the button edit on OPM to

    so when the user clicks the edit button, the user's access to this screen where the user made the changes and then tried to continue the flow of the screen from there. However not able to do and advanced to the next screen screen edit button.

    Please let me know a work around for this.

    Hello

    Your question is unclear, but I implemented a similar feature in one of the applications. Instead of buttons, we had Boolean questions asking the user on the nag screen which it wanted to change the attributes all.

    Based on the choice of the user (yes/no) we have redirected the stream to the respective screens using a decision boxes in a flow of custom screen we have defined (in the file inrerview/screen).

    I think you can get the same functionality in your application using a screen Flow approach instead of letting the rules decide which screens to show through.

    If you want I can send u an example project.

    I hope this helps.

    Njoy OPA!

  • Impossible to enlarge the screen using gestures

    UUnable to enlarge the screen gestures.

    What app? What gesture? If it is in the Safari note that some web pages do not allow changing the size.

  • BlackBerry Q10 need help navigating the screen

    When I have an app Androd open I like to hide the toolbar, but I don't know how go back an impression of the page with the toolbar opening. I know what to do but I can't do work in all is a video showing how or can someone say how to?

    Thank you

    I had the same problem - the gesture (swipe left/right) is correct, but I guess you drag too far up. Stay in the bottom quarter of the screen.

    This post helped me to http://forums.crackberry.com/blackberry-q10-f272/swipe-gesture-back-android-runtime-873566/#post9541...

    And as usual, as soon as you know what to do, you need a bit of practice and suddenly, it is quite normal to swipe this way... (and you wonder why he didn't is not supported in the native BB applications )

  • I can capture the screen using 11 first?

    Hi guys

    I thought I was doing a training video for a short time about some software and settings.

    I wanted to capture what appeared on the screen and add it to the imported clips.

    It is possible to capture the activity of the display Windows in the first 11 - or can you recommend a good HD screen capture program?

    Thank you

    N ° you will need a program like Camtasia Studio (best) or FRAPS (one of the more affordable).

Maybe you are looking for

  • I dropped my iPod 5 ANDS is weird

    I dropped my iPod 5 and the screen turned gray and touchscreen does not respond, I tried to stop him, and nothing has worked.

  • Tecra A9 XP SP3 - TOSHIBA Management Console TOSHealth VB Script error

    I reformatted the disk on Tecra A9 and wiped Vista and all the drivers, etc.Installed XP Home SP2 downloaded the drivers from Toshiba & installed & debugged.I have upgraded XP to SP3. Then installed programs. There is an error at startup.This origfin

  • HP Pavilion Notebook PC - letter N g6-1372sa has stopped working

    I have a HP Pavilion g6-1372sa Notebook PC, and last night at the N key suddenly stopped working, no matter what I do, its does not work.I have attached an external keyboard usb to the laptop computer and its operation, the on-screen keyboard is work

  • R500 &amp; 8 GB RAM

    Everyone has upgraded its Thinkpad R500 with more than 4 GB of RAM? I think buying this model, but first I want to be sure that the hardware and BIOS supports 8 GB of RAM. I ask, because there are some shops that offer them (not tested) with an upgra

  • No privacy after update to lollipop A6000 more

    Hi guys. !I have updated my phone A6000 more to the lollipop formatted but always reason due to problems. Not just any what privacies in my phone after the update because I tried manny apps to install and fix some app in editing app app lock and secu