It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Detailed Description

The QHistoryState class provides a means of returning to a previously active substate.

A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited. A transition with a history state as its target is in fact a transition to one of the other child states of the parent state. QHistoryState is part of The State Machine Framework.

Use the setDefaultState() function to set the state that should be entered if the parent state has never been entered. Example:

QStateMachine machine;
QState*s1 =newQState();
QState*s11 =newQState(s1);
QState*s12 =newQState(s1);
QHistoryState*s1h =newQHistoryState(s1);
s1h->setDefaultState(s11);
machine.addState(s1);
QState*s2 =newQState();
machine.addState(s2);
QPushButton*button =newQPushButton();
// Clicking the button will cause the state machine to enter the child state// that s1 was in the last time s1 was exited, or the history state's default// state if s1 has never been entered.
s1->addTransition(button, SIGNAL(clicked()), s1h);

By default a history state is shallow, meaning that it won't remember nested states. This can be configured through the historyType property.

Member Type Documentation

enum QHistoryState::HistoryType

Only the immediate child states of the parent state are recorded. In this case a transition with the history state as its target will end up in the immediate child state that the parent was in the last time it was exited. This is the default.

QHistoryState::DeepHistory

1

Nested states are recorded. In this case a transition with the history state as its target will end up in the most deeply nested descendant state the parent was in the last time it was exited.

1. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

2. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades radio buttons to display the samples relevant to you.

3. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

You can access all the documentation that you need in the left-hand navigation.

4. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.